getFriendListOfUser static method

FriendListPubSub getFriendListOfUser(
  1. LocalityUser receivingUser
)

Implementation

static FriendListPubSub getFriendListOfUser(LocalityUser receivingUser)  {
  String topic = getTopicOfFriendListOfUser(receivingUser.id);

  if ( !friendListByTopic.containsKey(topic) ) {
    FriendListPubSub friendListOfReceivingUser = FriendListPubSub(receivingUser);
    friendListByTopic[topic] = friendListOfReceivingUser;
    PubSubSupervisor.registerPubSub(friendListOfReceivingUser);
    return friendListOfReceivingUser;
  } else {
    return friendListByTopic[topic]!;
  }
}