aboutsummaryrefslogtreecommitdiff
path: root/src/QXmppRosterManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/QXmppRosterManager.cpp')
-rw-r--r--src/QXmppRosterManager.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/QXmppRosterManager.cpp b/src/QXmppRosterManager.cpp
index fd948e99..92b150ea 100644
--- a/src/QXmppRosterManager.cpp
+++ b/src/QXmppRosterManager.cpp
@@ -163,12 +163,22 @@ void QXmppRosterManager::rosterIqReceived(const QXmppRosterIq& rosterIq)
foreach (const QXmppRosterIq::Item &item, items) {
const QString bareJid = item.bareJid();
if (item.subscriptionType() == QXmppRosterIq::Item::Remove) {
- // notify the user that the item was removed if we previously had it
- if (m_entries.remove(bareJid))
+ if (m_entries.remove(bareJid)) {
+ // notify the user that the item was removed
emit itemRemoved(bareJid);
+ }
} else {
- // notify the user that the item changed
+ const bool added = !m_entries.contains(bareJid);
m_entries.insert(bareJid, item);
+ if (added) {
+ // notify the user that the item was added
+ emit itemAdded(bareJid);
+ } else {
+ // notify the user that the item changed
+ emit itemChanged(bareJid);
+ }
+
+ // FIXME: remove legacy signal
emit rosterChanged(bareJid);
}
}