Block / Unblock

1. Get Blocked Users

You can view blocked users.

The list is paginated, so to get to the next page, you can pass the last TPUser from the previous list to get to the next page.

TalkPlus.getBlockedUserList(lastUser, 
    new TalkPlus.CallbackListener<List<TPUser>>() {
        @Override
        public void onSuccess(List<TPUser> tpUsers) {
            for (TPUser tpUser : tpUsers) {
                // datetime when user was blocked
                long blockedAt = tpUser.get("blockedAt").getAsLong();
            }
        }
        @Override
        public void onFailure(int i, Exception e) {
        }
    }
);

2. Block / Unblock Users

You can block or unblock users.

// block
TalkPlus.blockUser(userId, new TalkPlus.CallbackListener<Void>() {
    @Override
    public void onSuccess(Void aVoid) {        
    }

    @Override
    public void onFailure(int i, Exception e) {
    }
});

// unblock
TalkPlus.unblockUser(userId, new TalkPlus.CallbackListener<Void>() {
    @Override
    public void onSuccess(Void aVoid) {
    }

    @Override
    public void onFailure(int i, Exception e) {
    }
});

Please refer to the following limitations:

Whether I can add someone whom I’ve blocked to a channel that I own

X

Whether someone whom I’ve blocked can join a channel that I own

X

Whether someone whom I’ve blocked can be added as a member to a channel that I am a member of

O

Whether someone whom I’ve blocked can join a channel that I am a member of

O

Whether I can be added as a member to a channel that is owned by someone I’ve blocked

X

Whether I can join a channel that is owned by someone I’ve blocked

X

Whether I can be added as a member to a channel where someone I’ve blocked is a member of

O

Whether I can join a channel where someone I’ve blocked is a member of

O

Last updated