/ SDKs / Unreal
SDKs
Chat SDKs Unreal v3
Chat SDKs Unreal
Chat SDKs
Unreal
Version 3

Block and unblock other users

Copy link

A user can register other users within an application. Users can instantly start 1-to-1 group chat and invite other users to existing group channels. On the other hand, a user can block specific users to stop receiving further messages from them in 1-to-1 or 1-to-N group channels. You can choose whether users can view which users they have blocked in the channel UI.

For blocking a user, you can set an option to include or exclude blocked users when sending invitations.It determines whether to automatically exclude blocked users when inviting users to a new group channel. The value of this option can only be changed from the Sendbird side before integrating your Sendbird application to the client app. If you want to change the value, contact our sales team for further assistance. (Default: including)

1-to-1 group channel

Copy link
Channel listMessages

A user's channel list will not be updated or rearranged from the blocked user's messages.

New messages sent from the blocked user will not be delivered to the channel, but are saved in the database and displayed in the blocked user's channel view. The blocked user is not aware of their blocked status. A user can only see the messages that the blocked user has sent before being blocked.

* If the blocked user is unblocked, a user can see all the messages except those that were sent during the blocking period.

1-to-N group channel

Copy link
Channel listMessages

For a blocked user's message, a user's channel list will be updated and rearranged.

All the messages from blocked users are delivered to the channel. You can choose whether a user can view which users they have blocked in the UI of the channel.

You can allow users to block and unblock other users by implementing the following code to your client app.

SBDMain::BlockUser(USER, [](SBDUser* blocked_user, SBDError* error) {
    if (error != nullptr) {
        // Handle error.
        return;
    }

    // The blocked user can be retrieved through the blocked_user parameter of the handler callback function.
});

SBDMain::UnblockUser(USER, [](SBDError* error) {
    if (error != nullptr) {
        // Handle error.
        return;
    }

    // The user is successfully unblocked.
});