diff --git a/src/localbuddy.cpp b/src/localbuddy.cpp index 55f7e27cbe8f7c98090620d25b9357892ea21586..6d8d75305c9e92d3f10a4881d05a8d9453dd7c61 100644 --- a/src/localbuddy.cpp +++ b/src/localbuddy.cpp @@ -48,4 +48,24 @@ void LocalBuddy::setAlias(const std::string &alias) { } } +void LocalBuddy::setGroups(const std::vector &groups) { + bool changed = m_groups.size() != groups.size(); + if (!changed) { + for (int i = 0; i != m_groups.size(); i++) { + if (m_groups[i] != groups[i]) { + changed = true; + break; + } + } + } + + m_groups = groups; + if (changed) { + if (getRosterManager()->getUser()->getComponent()->inServerMode() || getRosterManager()->isRemoteRosterSupported()) { + getRosterManager()->sendBuddyRosterPush(this); + } + getRosterManager()->storeBuddy(this); + } +} + }