// hides the channel until a new message is added there
await channel.hide();
// hides the channel until a new message is added there. This also clears the history for the user
await channel.hide(null, true);
// shows a previously hidden channel
await channel.show();Hiding Channels
Hiding a channel removes it from query channel requests for that user until a new message is added. Only channel members can hide a channel.
Hidden channels may still have unread messages. Consider marking the channel as read before hiding it.
You can optionally clear the message history for that user when hiding. When a new message is received, it will be the only message visible to that user.
Hide a Channel
require 'getstream_ruby'
Models = GetStream::Generated::Models
# Hide the channel until a new message is added
client.chat.hide_channel("messaging", "general", Models::HideChannelRequest.new(
user_id: 'john'
))
# Show a previously hidden channel
client.chat.show_channel("messaging", "general", Models::ShowChannelRequest.new(
user_id: 'john'
))You can still retrieve the list of hidden channels using the { "hidden" : true } query parameter.