mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
Fix #2243: use server url instead of hard coded string.
Signed-off-by: Camila <hello@camila.codes>
This commit is contained in:
parent
0516db5e10
commit
6d6cc3852b
2 changed files with 12 additions and 5 deletions
|
@ -486,6 +486,11 @@ bool User::serverHasTalk() const
|
||||||
return _account->hasTalk();
|
return _account->hasTalk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AccountApp *User::talkApp() const
|
||||||
|
{
|
||||||
|
return _account->findApp(QStringLiteral("spreed"));
|
||||||
|
}
|
||||||
|
|
||||||
bool User::hasActivities() const
|
bool User::hasActivities() const
|
||||||
{
|
{
|
||||||
return _account->account()->capabilities().hasActivities();
|
return _account->account()->capabilities().hasActivities();
|
||||||
|
@ -643,14 +648,15 @@ Q_INVOKABLE void UserModel::openCurrentAccountLocalFolder()
|
||||||
|
|
||||||
Q_INVOKABLE void UserModel::openCurrentAccountTalk()
|
Q_INVOKABLE void UserModel::openCurrentAccountTalk()
|
||||||
{
|
{
|
||||||
if (_users.isEmpty())
|
if (!currentUser())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString url = _users[_currentUserId]->server(false) + "/apps/spreed";
|
const auto talkApp = currentUser()->talkApp();
|
||||||
if (!(url.contains("http://") || url.contains("https://"))) {
|
if (talkApp) {
|
||||||
url = "https://" + _users[_currentUserId]->server(false) + "/apps/spreed";
|
QDesktopServices::openUrl(talkApp->url());
|
||||||
|
} else {
|
||||||
|
qCWarning(lcActivity) << "The Talk app is not enabled on" << currentUser()->server();
|
||||||
}
|
}
|
||||||
QDesktopServices::openUrl(QUrl(url));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_INVOKABLE void UserModel::openCurrentAccountServer()
|
Q_INVOKABLE void UserModel::openCurrentAccountServer()
|
||||||
|
|
|
@ -36,6 +36,7 @@ public:
|
||||||
QString server(bool shortened = true) const;
|
QString server(bool shortened = true) const;
|
||||||
bool hasLocalFolder() const;
|
bool hasLocalFolder() const;
|
||||||
bool serverHasTalk() const;
|
bool serverHasTalk() const;
|
||||||
|
AccountApp *talkApp() const;
|
||||||
bool hasActivities() const;
|
bool hasActivities() const;
|
||||||
AccountAppList appList() const;
|
AccountAppList appList() const;
|
||||||
QImage avatar(bool whiteBg = false) const;
|
QImage avatar(bool whiteBg = false) const;
|
||||||
|
|
Loading…
Reference in a new issue