User

This guide will explain the various actions which can be taken by currently logged in user of the application.

Fetching Users of the Application

UserListQuery userListQuery = ChatCamp.createUserListQuery();

userListQuery.load(LIMIT, new UserListQuery.ResultHandler() {
  @Override
  public void onResult(List<User> userList, ChatCampException e) {
    if(e == null) {
    	// List of messages received successfully.
    }
  }
});
  • LIMIT - The number of users to be fetched in one call. The maximum limit is 100.

Block a user

ChatCamp.blockUser(participantId, new ChatCamp.OnUserBlockListener() {
  @Override
  public void onUserBlocked(Participant participant, ChatCampException e) {
    if(e == null) {
    	// User blocked successfully.
    }
  }
});

Unblock a user

ChatCamp.UnblockUser(participantId, new ChatCamp.OnUserBlockListener() {
  @Override
  public void onUserUnblocked(Participant participant, ChatCampException e) {
    if(e == null) {
    	// User blocked successfully.
    }
  }
});

Fetching blocked users

UserListQuery blockedUserListQuery = ChatCamp.createBlockedUserListQuery();

blockedUserListQuery.load(LIMIT, new UserListQuery.ResultHandler() {
  @Override
  public void onResult(List<User> userList, ChatCampException e) {
    if(e == null) {
    	// List of messages received successfully.
    }
  }
});