What is correct way to filter broadcasted messages [ActionCable]

Hey guys,

Let’s assume we have mute command in chat application, users are subscribed to all messages. But some users mutes other users, is there any way to not deliver messages from muted user to those who muted him? If we simply do rebroadcast in our ChatChannel?

# app/channels/chat_channel.rb
class ChatChannel < ApplicationCable::Channel
  def subscribed
    stream_from "chat"
  end

  def receive(data)
    ChatChannel.broadcast_to "chat", data
  end
end

``