Example #1
0
  public void setUpdate(boolean online) {
    for (Friend friend : friends.values()) {
      if (H4J.getNetwork().getSessionManager().getOnlineStatusById(friend.getId())) { // if online
        Session channel = H4J.getNetwork().getSessionManager().getSessionById(friend.getId());

        channel.respond(UpdateFriendStateMessageComposer.compose(online, this.user));
      }
    }
  }
Example #2
0
  public void refreshRequests() {
    requests = H4J.getDAO().getMessengerDAO().loadRequests(user);

    Session session = H4J.getNetwork().getSessionManager().getSessionById(user.getId());
    session.respond(SendPendingFriendRequestsMessageComposer.compose(requests));
  }
Example #3
0
  public void refreshFriends() {
    friends = H4J.getDAO().getMessengerDAO().loadFriends(user);

    Session session = H4J.getNetwork().getSessionManager().getSessionById(user.getId());
    session.respond(InitializeMessengerMessageComposer.compose(friends));
  }
Example #4
0
 public MessengerManager(User user) {
   friends = H4J.getDAO().getMessengerDAO().loadFriends(user);
   requests = H4J.getDAO().getMessengerDAO().loadRequests(user);
   this.user = user;
 }