summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-08-27 18:58:01 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-08-27 18:58:01 (GMT)
commitba774f85e77531c7971804cb738c6b434a197258 (patch)
treeeed0887a9494256b5271e14045cfb537737bcd00 /Swiften
parentdd9e8b6bb212128c0e5c82a7cf80e2f49597bc31 (diff)
downloadswift-ba774f85e77531c7971804cb738c6b434a197258.zip
swift-ba774f85e77531c7971804cb738c6b434a197258.tar.bz2
Rerequest the roster at reconnect.
Resolves: #548
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Roster/XMPPRoster.cpp5
-rw-r--r--Swiften/Roster/XMPPRoster.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/Swiften/Roster/XMPPRoster.cpp b/Swiften/Roster/XMPPRoster.cpp
index 4478f86..28b04c6 100644
--- a/Swiften/Roster/XMPPRoster.cpp
+++ b/Swiften/Roster/XMPPRoster.cpp
@@ -34,6 +34,11 @@ void XMPPRoster::removeContact(const JID& jid) {
onJIDRemoved(jid);
}
+void XMPPRoster::clear() {
+ entries_.clear();
+ onRosterCleared();
+}
+
bool XMPPRoster::containsJID(const JID& jid) {
return entries_.find(JID(jid.toBare())) != entries_.end();
}
diff --git a/Swiften/Roster/XMPPRoster.h b/Swiften/Roster/XMPPRoster.h
index 97477bc..e449d28 100644
--- a/Swiften/Roster/XMPPRoster.h
+++ b/Swiften/Roster/XMPPRoster.h
@@ -32,6 +32,7 @@ class XMPPRoster {
void addContact(const JID& jid, const String& name, const std::vector<String>& groups, const RosterItemPayload::Subscription subscription);
bool containsJID(const JID& jid);
void removeContact(const JID& jid);
+ void clear();
RosterItemPayload::Subscription getSubscriptionStateForJID(const JID& jid);
const String& getNameForJID(const JID& jid);
const std::vector<String>& getGroupsForJID(const JID& jid);
@@ -39,6 +40,7 @@ class XMPPRoster {
boost::signal<void (const JID&)> onJIDAdded;
boost::signal<void (const JID&)> onJIDRemoved;
boost::signal<void (const JID&, const String&, const std::vector<String>&)> onJIDUpdated;
+ boost::signal<void ()> onRosterCleared;
private:
//std::map<JID, std::pair<String, std::vector<String> > > entries_;