use of org.jivesoftware.spark.ui.ContactGroup in project Spark by igniterealtime.
the class NotificationPlugin method registerListener.
private void registerListener() {
preferences = SettingsManager.getLocalPreferences();
// Iterate through all online users and add them to the list.
ContactList contactList = SparkManager.getWorkspace().getContactList();
for (ContactGroup contactGroup : contactList.getContactGroups()) {
for (ContactItem item : contactGroup.getContactItems()) {
if (item != null && item.getJID() != null && item.getPresence().isAvailable()) {
String bareJID = XmppStringUtils.parseBareJid(item.getJID());
onlineUsers.add(bareJID);
}
}
}
// Add Presence Listener
SparkManager.getConnection().addAsyncStanzaListener(this, new StanzaTypeFilter(Presence.class));
}
Aggregations