summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-10-04 16:08:10 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-10-04 16:08:10 (GMT)
commit8ca471e7304e813fa55ebf512a8f30f146fe6b41 (patch)
treee962968f1f7afc0bc6c73a776e3ee75e8c7deaba /Swiften/Roster/ContactRosterItem.cpp
parent026e8a67d871d99f4f0c0bddb6d16d12521f1e1c (diff)
downloadswift-8ca471e7304e813fa55ebf512a8f30f146fe6b41.zip
swift-8ca471e7304e813fa55ebf512a8f30f146fe6b41.tar.bz2
Assign contacts to groups.
Another patch will follow shortly to stop them appearing offline after a roster change like this. Resolves: #272 Release-Notes: It's now possible to assign your contacts to groups.
Diffstat (limited to 'Swiften/Roster/ContactRosterItem.cpp')
-rw-r--r--Swiften/Roster/ContactRosterItem.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Swiften/Roster/ContactRosterItem.cpp b/Swiften/Roster/ContactRosterItem.cpp
index 9251fad..bbf3928 100644
--- a/Swiften/Roster/ContactRosterItem.cpp
+++ b/Swiften/Roster/ContactRosterItem.cpp
@@ -98,6 +98,18 @@ void ContactRosterItem::applyPresence(const String& resource, boost::shared_ptr<
onDataChanged();
}
+const std::vector<String> ContactRosterItem::getGroups() const {
+ return groups_;
+}
+
+/** Only used so a contact can know about the groups it's in*/
+void ContactRosterItem::addGroup(const String& group) {
+ groups_.push_back(group);
+}
+void ContactRosterItem::removeGroup(const String& group) {
+ groups_.erase(std::find(groups_.begin(), groups_.end(), group));
+}
+
}