clearing presences and statuses on disconnect of an account

This commit is contained in:
Blue 2019-06-23 14:31:03 +03:00
parent 49aa99d4db
commit 833913cac2
6 changed files with 38 additions and 0 deletions

View file

@ -30,6 +30,9 @@ void Models::Account::setState(Shared::ConnectionState p_state)
if (state != p_state) {
state = p_state;
changed(2);
if (state == Shared::disconnected) {
toOfflineState();
}
}
}
@ -198,3 +201,8 @@ void Models::Account::setError(const QString& p_resource)
}
}
void Models::Account::toOfflineState()
{
setAvailability(Shared::offline);
Item::toOfflineState();
}