- Remove repeated hard coded "spreed" string.
Signed-off-by: Camila <hello@camila.codes>
, _waitingForNewCredentials(false)
, _maintenanceToConnectedDelay(60000 + (qrand() % (4 * 60000))) // 1-5min delay
, _remoteWipe(new RemoteWipe(_account))
- , _hasTalk(false)
{
qRegisterMetaType<AccountState *>("AccountState*");
return _account;
}
-bool AccountState::hasTalk() const
-{
- return _hasTalk;
-}
-
AccountState::ConnectionStatus AccountState::connectionStatus() const
{
return _connectionStatus;
qCWarning(lcAccountState) << "Status code " << statusCode << " Not Modified - No new navigation apps.";
} else {
_apps.clear();
- _hasTalk = false;
if(!reply.isEmpty()){
auto element = reply.object().value("ocs").toObject().value("data");
navLink.value("id").toString(), QUrl(navLink.value("icon").toString()));
_apps << app;
-
- if(app->id() == QLatin1String("spreed"))
- _hasTalk = true;
}
}
}
bool isSignedOut() const;
- bool hasTalk() const;
-
AccountAppList appList() const;
AccountApp* findApp(const QString &appId) const;
ConnectionStatus _connectionStatus;
QStringList _connectionErrors;
bool _waitingForNewCredentials;
- bool _hasTalk;
QElapsedTimer _timeSinceLastETagCheck;
QPointer<ConnectionValidator> _connectionValidator;
QByteArray _notificationsEtagResponseHeader;
bool User::serverHasTalk() const
{
- return _account->hasTalk();
+ return talkApp() != nullptr;
}
AccountApp *User::talkApp() const
return _users[_currentUserId]->server();
}
-Q_INVOKABLE bool UserModel::currentServerHasTalk()
-{
- if (_users.isEmpty())
- return false;
-
- return _users[_currentUserId]->serverHasTalk();
-}
-
void UserModel::addUser(AccountStatePtr &user, const bool &isCurrent)
{
bool containsUser = false;
}
if (UserModel::instance()->appList().count() > 0) {
+ const auto talkApp = UserModel::instance()->currentUser()->talkApp();
foreach (AccountApp *app, UserModel::instance()->appList()) {
// Filter out Talk because we have a dedicated button for it
- if (app->id() == QLatin1String("spreed"))
+ if (talkApp && app->id() == talkApp->id())
continue;
beginInsertRows(QModelIndex(), rowCount(), rowCount());
Q_INVOKABLE QString currentUserServer();
Q_INVOKABLE bool currentUserHasActivities();
Q_INVOKABLE bool currentUserHasLocalFolder();
- Q_INVOKABLE bool currentServerHasTalk();
Q_INVOKABLE int currentUserId() const;
Q_INVOKABLE bool isUserConnected(const int &id);
Q_INVOKABLE void switchCurrentUser(const int &id);