コード例 #1
0
 private String getCurrentJabberID(User user, RosterEntry rosterEntry) {
   Presence presence = _getPresence(user);
   String jabberId = null;
   if (presence != null) {
     jabberId = presence.getFrom();
   }
   if (jabberId == null) jabberId = rosterEntry.getUser();
   if (jabberId == null) jabberId = rosterEntry.getName();
   return jabberId;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 @Nullable
 private static String getUserGroup(RosterEntry rosterEntry) {
   String group = null;
   for (RosterGroup rosterGroup : rosterEntry.getGroups()) {
     group = rosterGroup.getName();
   }
   return group;
 }