Пример #1
0
  public MockRoomMember mockOwnerJoin(String name) {
    MockRoomMember member = new MockRoomMember(name, this);

    member.setRole(ChatRoomMemberRole.OWNER);

    mockJoin(member);

    return member;
  }
Пример #2
0
  @Override
  public void grantModerator(String nickname) {
    MockRoomMember member = findMember(nickname);
    if (member == null) {
      logger.error("Member not found for nickname: " + nickname);
      return;
    }

    if (ChatRoomMemberRole.MODERATOR.compareTo(member.getRole()) >= 0) {
      // No action required
      return;
    }

    ChatRoomMemberRole oldRole = member.getRole();

    member.setRole(ChatRoomMemberRole.MODERATOR);

    fireMemberRoleEvent(member, oldRole);
  }