private boolean hasJabberContacts() { User[] users = myUserModel.getAllUsers(); for (User user : users) { if (user.getTransportCode().equals(getName())) return true; } return false; }
String getThreadId(User user) { String id = myUser2Thread.get(user.getName()); if (id == null) { id = myThreadIdPrefix + myCurrentThreadId++; myUser2Thread.put(user.getName(), id); } return id; }
private void updateIsIDEtalkClient(String jabberId, User user) { if (getResource(jabberId) .toLowerCase() .startsWith(JabberFacade.IDETALK_RESOURCE.toLowerCase())) { myIDEtalkUsers.add(user.getName()); } else { myIDEtalkUsers.remove(user.getName()); } }
private User addJabberUserToUserModelOrUpdateInfo(RosterEntry rosterEntry) { // System.out.println("rosterEntry.getName() = " + rosterEntry.getName()); // System.out.println("rosterEntry.getUser() = " + rosterEntry.getUser()); User user = myUserModel.createUser(getSimpleId(rosterEntry.getUser()), getName()); String newGroup = getUserGroup(rosterEntry); if (newGroup != null) { user.setGroup(newGroup, myUserModel); } user.setDisplayName(rosterEntry.getName(), myUserModel); myUserModel.addUser(user); String jabberId = getCurrentJabberID(user, rosterEntry); updateIsIDEtalkClient(jabberId, user); return user; }
@Nullable private Presence _getPresence(User user) { if (!isOnline()) return null; return getRoster().getPresence(user.getName()); }
boolean isUserInMyContactListAndActive(String userName) { User user = myUserModel.findUser(getSimpleId(userName), getName()); return user != null && user.isOnline(); }
static Message createBaseMessage(User user, String message) { Message msg = new Message(user.getName(), Message.Type.CHAT); msg.setBody(message); return msg; }
@Override public boolean hasIdeTalkClient(User user) { return myIDEtalkUsers.contains(user.getName()); }
@Override public boolean isSelf(User user) { return myFacade.isConnectedAndAuthenticated() && getSimpleId(myFacade.getConnection().getUser()).equals(user.getName()); }