diff options
author | Kevin Smith <git@kismith.co.uk> | 2009-11-05 22:05:15 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2009-11-05 22:06:16 (GMT) |
commit | 3fbab3b40dfc31da46924f13984415b18087a8d4 (patch) | |
tree | 161e6a8f4479153120fc61548bd6407f260f347f /Swiften/Roster/Roster.cpp | |
parent | ff9b04252cbdd3bda5f1d01e1bad4a077f99791b (diff) | |
download | swift-contrib-3fbab3b40dfc31da46924f13984415b18087a8d4.zip swift-contrib-3fbab3b40dfc31da46924f13984415b18087a8d4.tar.bz2 |
A block of the work for roster pushes.
Still needs unit testing
Diffstat (limited to 'Swiften/Roster/Roster.cpp')
-rw-r--r-- | Swiften/Roster/Roster.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Swiften/Roster/Roster.cpp b/Swiften/Roster/Roster.cpp index b09964c..28245af 100644 --- a/Swiften/Roster/Roster.cpp +++ b/Swiften/Roster/Roster.cpp @@ -72,6 +72,18 @@ void Roster::removeContact(const JID& jid) { } } +void Roster::removeContactFromGroup(const JID& jid, const String& groupName) { + std::vector<RosterItem*>::iterator it = children_.begin(); + while (it != children_.end()) { + GroupRosterItem* group = dynamic_cast<GroupRosterItem*>(*it); + if (group && group->getName() == groupName) { + group->removeChild(jid); + } + it++; + } +} + + void Roster::applyOnItems(const RosterItemOperation& operation) { std::deque<RosterItem*> queue(children_.begin(), children_.end()); while (!queue.empty()) { |