String getThreadId(User user) { String id = myUser2Thread.get(user.getName()); if (id == null) { id = myThreadIdPrefix + myCurrentThreadId++; myUser2Thread.put(user.getName(), id); } return id; }
@Override public UserPresence getUserPresence(User user) { UserPresence presence = myUser2Presence.get(user); if (presence == null) { presence = new UserPresence(false); myUser2Presence.put(user, presence); } return presence; }
private void updateUserPresence(String jabberId) { LOG.debug("Presence changed for " + jabberId); final User user = myUserModel.findUser(getSimpleId(jabberId), getName()); if (user != null) { updateIsIDEtalkClient(jabberId, user); final UserPresence presence = _getUserPresence(user); IDEtalkEvent event = createPresenceChangeEvent(user, presence); if (event != null) { getBroadcaster().doChange(event, () -> myUser2Presence.put(user, presence)); } } }