use of org.jivesoftware.smack.roster.packet.RosterPacket in project xabber-android by redsolution.
the class RosterManager method setGroups.
public void setGroups(String account, String bareAddress, Collection<String> groups) throws NetworkException {
final Roster roster = getRoster(account);
if (roster == null) {
return;
}
final RosterEntry entry = roster.getEntry(bareAddress);
if (entry == null) {
return;
}
RosterPacket packet = new RosterPacket();
packet.setType(IQ.Type.set);
RosterPacket.Item item = new RosterPacket.Item(bareAddress, entry.getName());
for (String group : groups) {
item.addGroupName(group);
}
packet.addRosterItem(item);
ConnectionManager.getInstance().sendStanza(account, packet);
}
Aggregations