Load previous message except blocked user

Hi

I have tested block user’s part in the my unity project.

When i have loaded previous messages after add a user to block in the open channel, have recieved messages without blocked user’s messages in the sample project of unity.

So then, i have tried same thing in my sendbird project, but blocked user’s message have gotten when load previous messages.

i wanna make blocked user’s messages are excepted when loading previous messages in the open channel like sample code.

i attached sample code to help understand. Thanks.

void BlockUser(string temp)
{
SendBirdClient.BlockUserWithUserId(temp, (User user, SendBirdException e) =>
{
if (e != null)
{
return;
// Handle error.
}
}
);
}

void LoadOpenChannelChatHistory()
{
    string tempuser = "lost11";
    BlockUser(tempuser);

    PreviousMessageListQuery query = currentChannel.CreatePreviousMessageListQuery();

	ResetOpenChannelContent();
	query.Load(15, false, (List<BaseMessage> queryResult, SendBirdException e) => {
		if (e != null)
		{
			Debug.Log(e.Code + ": " + e.Message);
			return;
		}

Hi, Thompson.

The code you wrote is an API to get already blocked users. So the code has nothing to do with the desired behavior.

The point of your question is to hide messages from blocked users in open channels.

The link below describes ‘block a user’.

“Users will no longer receive messages from anyone they block.”
This is a 1:1 channel, not a description of a public channel or group channel.

“Block a user” is a 1:1 relationship between you and the other person, and does not block messages in chat rooms that other people are participating in.

If you want to hide the message of the blocked user, check the blocked user in OnMessageReceived to prevent the message from appearing.

To hide the message from the previous message, check the userid of the message object and hide it as shown below.

query.Load(100, false, (List queryResult, SendBirdException e) => {
SendBirdException e) => {
if (e != null)
{
return;
}

ChannelMessage msg = null;
foreach (BaseMessage message in queryResult){
if (message is UserMessage){
if( message.UserId

Hope this helps.

Thanks.