public void actionPerformed(ActionEvent actionEvent) { Collection<ContactItem> contacts = contactList.getActiveGroup().getContactItems(); startConference(contacts); } };
public void removeAllContacts() { // Remove all users from online group. for (ContactItem item : new ArrayList<>( getContactItems() )) { removeContactItem(item); } // Remove all users from offline group. for (ContactItem item : getOfflineContacts()) { removeOfflineContactItem(item); } }
/** * Returns true if the ContactGroup contains available users. * * @return true if the ContactGroup contains available users. */ public boolean hasAvailableContacts() { for (ContactGroup group : contactGroups) { if (group.hasAvailableContacts()) { return true; } } for (ContactItem item : getContactItems()) { if (item.getPresence() != null) { return true; } } return false; }
private void updateTitle() { if (Res.getString("group.offline").equals(groupName)) { setTitle(Res.getString("group.offline")); return; } int count = 0; List<ContactItem> list = new ArrayList<>( getContactItems() ); int size = list.size(); for (int i = 0; i < size; i++) { ContactItem it = list.get(i); if (it.isAvailable()) { count++; } } setTitle(getGroupTitle(groupName) + " (" + count + " " + Res.getString("online") + ")"); if (model.getSize() == 0) { model.addElement(noContacts); } }
private void updateAvatarsInContactList() { final ContactList contactList = SparkManager.getContactList(); for (ContactGroup contactGroup : contactList.getContactGroups()) { if (contactGroup.isOfflineGroup()) { continue; } for (ContactItem contactItem : contactGroup.getContactItems()) { updateContactItem(contactItem); } } }
for (ContactItem contactItem : contactGroup.getContactItems()) { if (!contactMap.containsKey(contactItem.getJID())) { contacts.add(contactItem);
for (ContactItem item : group.getContactItems()) for (ContactItem item : group.getContactItems()) { CheckNode itemNode = new CheckNode(item.getDisplayName(), false, item.getIcon()); itemNode.setAssociatedObject(item.getJID());
contactItems.add(item); List<ContactItem> tempItems = getContactItems();
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()) { BareJid bareJID = item.getJid().asBareJid(); onlineUsers.add(bareJID); } } } // Add Presence Listener SparkManager.getConnection().addAsyncStanzaListener(this, new StanzaTypeFilter(Presence.class)); }
if (itemFound != null && !unfiled && group != getUnfiledGroup() && group != offlineGroup) { if (!userGroupSet.contains(group.getGroupName())) { if (group.getContactItems().isEmpty()) { removeContactGroup(group); } else {
public void setIconsForList(SparkPrivacyList list) throws SmackException.NotConnectedException { for (PrivacyItem pItem : list.getPrivacyItems()) { if (pItem.getType().equals(PrivacyItem.Type.jid)) { setBlockedIconToContact(pItem.getValue()); if (pItem.isFilterPresenceOut()) { sendUnavailableTo(pItem.getValue()); } } if (pItem.getType().equals(PrivacyItem.Type.group)) { ContactGroup group = SparkManager.getWorkspace().getContactList().getContactGroup(pItem.getValue()); for (ContactItem citem : group.getContactItems()) { setBlockedIconToContact(citem.getJID()); if (pItem.isFilterPresenceOut()) { sendUnavailableTo(citem.getJID()); } } } } SparkManager.getContactList().updateUI(); }
public void removeIconsForList(SparkPrivacyList list) throws SmackException.NotConnectedException { for (PrivacyItem pItem : list.getPrivacyItems()) { if (pItem.getType().equals(PrivacyItem.Type.jid)) { removeBlockedIconFromContact(pItem.getValue()); if (pItem.isFilterPresenceOut()) { sendRealPresenceTo(pItem.getValue()); } } if (pItem.getType().equals(PrivacyItem.Type.group)) { ContactGroup group = SparkManager.getWorkspace().getContactList().getContactGroup(pItem.getValue()); for (ContactItem citem : group.getContactItems()) { removeBlockedIconFromContact(citem.getJid()); if (pItem.isFilterPresenceOut()) { sendRealPresenceTo(citem.getJid()); } } } } SparkManager.getContactList().updateUI(); }
@Override public void itemAdded(PrivacyItem item, String listname) throws SmackException.NotConnectedException { PrivacyManager pmanager = PrivacyManager.getInstance(); if (pmanager.getPrivacyList(listname).isActive()) { if (item.getType().equals(PrivacyItem.Type.jid)) { setBlockedIconToContact(item.getValue()); if (item.isFilterPresenceOut()) { sendUnavailableTo(item.getValue()); } } if (item.getType().equals(PrivacyItem.Type.group)) { ContactGroup group = SparkManager.getWorkspace().getContactList().getContactGroup(item.getValue()); for (ContactItem citem : group.getContactItems()) { setBlockedIconToContact(citem.getJID()); if (item.isFilterPresenceOut()) { sendUnavailableTo(citem.getJID()); } } } SparkManager.getContactList().updateUI(); } }
@Override public void itemRemoved(PrivacyItem item, String listname) throws SmackException.NotConnectedException { PrivacyManager pmanager = PrivacyManager.getInstance(); if (pmanager.getPrivacyList(listname).isActive()) { if (item.getType().equals(PrivacyItem.Type.jid)) { removeBlockedIconFromContact(item.getValue()); if (item.isFilterPresenceOut()) { sendRealPresenceTo(item.getValue()); } } if (item.getType().equals(PrivacyItem.Type.group)) { ContactGroup group = SparkManager.getWorkspace().getContactList().getContactGroup(item.getValue()); for (ContactItem citem : group.getContactItems()) { removeBlockedIconFromContact(citem.getJID()); if (item.isFilterPresenceOut()) { sendRealPresenceTo(citem.getJID()); } } } SparkManager.getContactList().updateUI(); } }
for (ContactItem contactItem : contactGroup.getContactItems()) { Presence presence = contactItem.getPresence(); if (presence.isAvailable()) {