return name;
}
-QString User::server() const
+QString User::server(bool shortened) const
{
QString serverUrl = _account->account()->url().toString();
- serverUrl.replace(QLatin1String("https://"), QLatin1String(""));
- serverUrl.replace(QLatin1String("http://"), QLatin1String(""));
- if (serverUrl.size() > 21) {
- serverUrl.truncate(19);
- serverUrl.append("...");
+ if (shortened) {
+ serverUrl.replace(QLatin1String("https://"), QLatin1String(""));
+ serverUrl.replace(QLatin1String("http://"), QLatin1String(""));
+ if (serverUrl.size() > 21) {
+ serverUrl.truncate(19);
+ serverUrl.append("...");
+ }
}
return serverUrl;
}
_users[_currentUserId].openLocalFolder();
}
+Q_INVOKABLE void UserModel::openCurrentAccountTalk()
+{
+ QString url = _users[_currentUserId].server(false) + "/apps/spreed";
+ if (!(url.contains("http://") || url.contains("https://"))) {
+ url = "https://" + _users[_currentUserId].server(false) + "/apps/spreed";
+ }
+ QDesktopServices::openUrl(QUrl(url));
+}
+
+Q_INVOKABLE void UserModel::openCurrentAccountServer()
+{
+ QString url = _users[_currentUserId].server(false);
+ if (! (url.contains("http://") || url.contains("https://")) ) {
+ url = "https://" + _users[_currentUserId].server(false);
+ }
+ QDesktopServices::openUrl(QUrl(url));
+}
+
Q_INVOKABLE void UserModel::switchCurrentUser(const int &id)
{
_users[_currentUserId].setCurrentUser(false);
ActivityListModel *getActivityModel();
void openLocalFolder();
QString name() const;
- QString server() const;
+ QString server(bool shortened = true) const;
bool serverHasTalk() const;
QImage avatar() const;
QString id() const;
QImage avatarById(const int &id);
Q_INVOKABLE void openCurrentAccountLocalFolder();
+ Q_INVOKABLE void openCurrentAccountTalk();
+ Q_INVOKABLE void openCurrentAccountServer();
Q_INVOKABLE QImage currentUserAvatar();
Q_INVOKABLE int numUsers();
Q_INVOKABLE bool isCurrentUserConnected();
hoverEnabled: true\r
onClicked:\r
{\r
+ userModelBackend.openCurrentAccountTalk();\r
}\r
}\r
\r
Layout.preferredWidth: (trayWindowHeaderBackground.height)\r
Layout.preferredHeight: (trayWindowHeaderBackground.height)\r
flat: true\r
- visible: false\r
\r
icon.source: "qrc:///client/theme/white/more-apps.svg"\r
icon.color: "transparent"\r
hoverEnabled: true\r
onClicked:\r
{\r
+ userModelBackend.openCurrentAccountServer();\r
}\r
}\r
\r