Manage Channel Members

1. Invite Users

You can invite members to the channel even if you are not the owner.

Any member can add another member to channel.

TalkPlus.addMemberToChannel(channel, 
    targetIds, 
    new TalkPlus.CallbackListener<TPChannel>() {
        @Override
        public void onSuccess(TPChannel tpChannel) {
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
);

2. Remove Members

Only the channel owner can remove members.

TalkPlus.removeMemberToChannel(channel, 
    targetIds, 
    new TalkPlus.CallbackListener<TPChannel>() {
        @Override
        public void onSuccess(TPChannel tpChannel) {
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
);

3. Ban Users

  • Only the channel owner can ban users.

  • Banned users are immediately removed from the channel and cannot join the channel until unbanned by the channel owner.

TalkPlus.banMemberToChannel(channel, 
    targetIds, 
    new TalkPlus.CallbackListener<TPChannel>() {
        @Override
        public void onSuccess(TPChannel tpChannel) {
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
);

4. Unban Users

Only the channel owner can unban users.

TalkPlus.unBanMemberToChannel(channel, 
    targetIds, 
    new TalkPlus.CallbackListener<TPChannel>() {
        @Override
        public void onSuccess(TPChannel tpChannel) {
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
);

5. Mute Members

Mute feature allows the channel owner to mute specific members in the channel. Muted members are not allowed to send messages.

  • Only the channel owner can mute other members.

  • expireInMinutes specifies when mute status is expired. Default value for expireInMinutes is 0 (no expiry).

TalkPlus.muteMemberToChannel(channel, 
    targetIds, 
    expireInMinutes,
    new TalkPlus.CallbackListener<TPChannel>() {
        @Override
        public void onSuccess(TPChannel tpChannel) {
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
);

6. Unmute Members

Only the channel owner can unmute other members.

TalkPlus.unMuteMemberToChannel(channel, 
    targetIds, 
    new TalkPlus.CallbackListener<TPChannel>() {
        @Override
        public void onSuccess(TPChannel tpChannel) {
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
);

7. Get Channel Member List

For super channel, this is the only way to get channel members.

TalkPlus.getChannelMembers(tpChannel, 
    lastMember, 
    new TPCallbackListener<List<TPMember>, Boolean>() {
    @Override
    public void onSuccess(List<TPMember> tpMembers, Boolean hasNext) {

    }
    @Override
    public void onFailure(int errorCode, Exception exception) {

    }
});

8. Peer Mute

You can mute another member in the channel.

  • Any user can 'peer mute' another member in the channel.

  • If you 'peer mute' another member, you will stop seeing messages from that particular member in the channel but other users will continue to see messages from that member in the channel.

  • There is no push notification or event handler for this event.

  • expireInMinutes allows you to control when 'peer mute' status expires. Default value for expireInMinutes is 0 (no expiry).

TalkPlus.mutePeerToChannel(tpChannel, 
    targetIds, 
    expireInMinutes, 
    new TPCallbackListener<List<TPMember>, Boolean>() {
    @Override
    public void onSuccess(TPChannel tpChannel, List<TPMember> mutedPeers) {

    }
    @Override
    public void onFailure(int errorCode, Exception exception) {

    }
});

9. Peer Unmute

There is no push notification or event handler for this event.

TalkPlus.unMutePeerToChannel(tpChannel, 
    targetIds, 
    new TPCallbackListener<List<TPMember>, Boolean>() {
    @Override
    public void onSuccess(TPChannel tpChannel, List<TPMember> unMutedPeers) {

    }
    @Override
    public void onFailure(int errorCode, Exception exception) {

    }
});

10. Get Peer Muted List

TalkPlus.getMutedPeers(tpChannel, 
    lastUser, 
    new TPCallbackListener<List<TPMember>, Boolean>() {
    @Override
    public void onSuccess(List<TPMember> mutedPeers, Boolean hasNext) {
        
    }
    @Override
    public void onFailure(int errorCode, Exception exception) {

    }
});

Last updated