コード例 #1
0
 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());
   }
 }
コード例 #2
0
  private void updateJabberUsers(boolean removeUsersNotInRoster) {
    LOG.debug("Roster changed - update user model");
    Set<User> currentUsers = new HashSet<>(Arrays.asList(myUserModel.getAllUsers()));
    for (RosterEntry rosterEntry : getRoster().getEntries()) {
      User user = addJabberUserToUserModelOrUpdateInfo(rosterEntry);
      currentUsers.remove(user);
    }

    if (removeUsersNotInRoster) {
      removeUsers(currentUsers);
    }

    if (LOG.isDebugEnabled()) {
      LOG.debug("Roster synchronized: " + Arrays.asList(myUserModel.getAllUsers()));
    }
  }
コード例 #3
0
  @Override
  public void disconnected(boolean onError) {
    final XMPPConnection connection = myFacade.getConnection();

    LOG.info("Jabber disconnected: " + connection.getUser());
    connection.removePacketListener(mySubscribeListener);
    mySubscribeListener = null;
    connection.removePacketListener(myMessageListener);
    myMessageListener = null;

    final Roster roster = connection.getRoster();
    if (roster != null) {
      roster.removeRosterListener(myRosterListener);
    }
    myRosterListener = null;

    myIDEtalkUsers.clear();
    myUser2Presence.clear();
    myUser2Thread.clear();

    if (onError && reconnectEnabledAndNotStarted()) {
      LOG.warn(getMsg("jabber.server.was.disconnected", myReconnectTimeout / 1000));
      myReconnectProcess = myIdeFacade.runOnPooledThread(new MyReconnectRunnable());
    }
  }
コード例 #4
0
 @Override
 public boolean hasIdeTalkClient(User user) {
   return myIDEtalkUsers.contains(user.getName());
 }