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)); } } }
public void refreshRequests() { requests = H4J.getDAO().getMessengerDAO().loadRequests(user); Session session = H4J.getNetwork().getSessionManager().getSessionById(user.getId()); session.respond(SendPendingFriendRequestsMessageComposer.compose(requests)); }
public void refreshFriends() { friends = H4J.getDAO().getMessengerDAO().loadFriends(user); Session session = H4J.getNetwork().getSessionManager().getSessionById(user.getId()); session.respond(InitializeMessengerMessageComposer.compose(friends)); }
public MessengerManager(User user) { friends = H4J.getDAO().getMessengerDAO().loadFriends(user); requests = H4J.getDAO().getMessengerDAO().loadRequests(user); this.user = user; }