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); } }
for (ContactItem item : group.getContactItems()) if(item.isAvailable() && !onlineJIDs.contains(item.getJID()))
private void startConference(Collection<ContactItem> items) { final ContactList contactList = SparkManager.getWorkspace().getContactList(); List<Jid> jids = new ArrayList<>(); for (ContactItem item : items) { ContactGroup contactGroup = contactList.getContactGroup(item.getGroupName()); contactGroup.clearSelection(); if (item.isAvailable()) { jids.add(item.getJid()); } } Localpart userName = SparkManager.getSessionManager().getJID().getLocalpart(); final EntityBareJid roomName = JidCreate.entityBareFromOrThrowUnchecked(userName + "_" + StringUtils.randomString(3)); DomainBareJid serviceName = getDefaultServiceName(); if (serviceName != null) { ConferenceUtils.inviteUsersToRoom(serviceName, roomName, jids, true); } }