Commit f851800d authored by Rafał Malinowski's avatar Rafał Malinowski

contacts: change wiring of roster state events

Signed-off-by: Rafał Malinowski's avatarRafał Przemysław Malinowski <rafal.przemyslaw.malinowski@gmail.com>
parent 1cb0851c
......@@ -175,7 +175,7 @@ Contact ContactManager::byId(Account account, const QString &id, NotFoundAction
ChangeNotifierLock lock(contact.rosterEntry()->changeNotifier(), ChangeNotifierLock::ModeForget); // don't emit dirty signals
contact.setId(id);
contact.setContactAccount(account);
contact.rosterEntry()->setState(RosterEntrySynchronized); // TODO: setId desynchronized it, make a factory
contact.rosterEntry()->setState(RosterEntrySynchronized); // TODO: setId and setContactAccount desynchronized it, make a factory
if (action == ActionCreateAndAdd)
addItem(contact);
......
......@@ -224,6 +224,7 @@ void ContactShared::setOwnerBuddy(const Buddy &buddy)
Entry->setState(RosterEntryDesynchronized);
changeNotifier().notify();
emit buddyUpdated();
}
......@@ -242,6 +243,7 @@ void ContactShared::setContactAccount(const Account &account)
if (*ContactAccount && ContactAccount->protocolHandler() && ContactAccount->protocolHandler()->protocolFactory())
protocolFactoryRegistered(ContactAccount->protocolHandler()->protocolFactory());
Entry->setState(RosterEntryDesynchronized);
changeNotifier().notify();
}
......@@ -339,7 +341,7 @@ RosterEntry * ContactShared::rosterEntry()
void ContactShared::avatarUpdated()
{
changeNotifier().notify();
Entry->setState(RosterEntryDesynchronized);
}
void ContactShared::changeNotifierChanged()
......@@ -377,6 +379,7 @@ void ContactShared::setContactAvatar(const Avatar &contactAvatar)
return;
doSetContactAvatar(contactAvatar);
changeNotifier().notify();
}
......
......@@ -59,7 +59,7 @@ void RosterService::disconnected()
setState(RosterState::NonInitialized);
}
void RosterService::contactUpdated()
void RosterService::contactDirtinessChanged()
{
auto contact = Contact{sender()};
......@@ -151,12 +151,12 @@ bool RosterService::shouldReplaceTask(RosterTaskType taskType, RosterTaskType re
void RosterService::connectContact(const Contact &contact)
{
connect(contact, SIGNAL(updated()), this, SLOT(contactUpdated()));
connect(contact, SIGNAL(dirtinessChanged()), this, SLOT(contactDirtinessChanged()));
}
void RosterService::disconnectContact(const Contact &contact)
{
disconnect(contact, SIGNAL(updated()), this, SLOT(contactUpdated()));
disconnect(contact, SIGNAL(dirtinessChanged()), this, SLOT(contactDirtinessChanged()));
}
void RosterService::addTask(const RosterTask &task)
......
......@@ -286,7 +286,7 @@ private slots:
* This slot can only by called for contacts that were previously added to roster using addContact() methods
* and were not removed.
*/
void contactUpdated();
void contactDirtinessChanged();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment