Example #1
0
  private void mockLeave(MockRoomMember member) {
    synchronized (members) {
      if (!members.remove(member)) {
        throw new RuntimeException("Member is not in the room " + member);
      }

      fireMemberPresenceEvent(member, member, ChatRoomMemberPresenceChangeEvent.MEMBER_LEFT, null);
    }
  }
Example #2
0
  @Override
  public void leave() {
    if (!isJoined) return;

    isJoined = false;

    synchronized (members) {
      members.remove(me);

      fireMemberPresenceEvent(me, me, ChatRoomMemberPresenceChangeEvent.MEMBER_LEFT, null);
    }

    me = null;
  }