// Hides the channel until a new message is added there
channelClient.hide().enqueue { result ->
if (result is Result.Success) {
// Channel is hidden
} else {
// Handle Result.Failure
}
}
// Shows a previously hidden channel
channelClient.show().enqueue { result ->
if (result is Result.Success) {
// Channel is shown
} else {
// Handle Result.Failure
}
}
// Hide the channel and clear the message history
channelClient.hide(clearHistory = true).enqueue { result ->
if (result is Result.Success) {
// Channel is hidden
} else {
// Handle Result.Failure
}
}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
use GetStream\ChatClient;
use GetStream\GeneratedModels as Models;
$client = new ChatClient("{{ api_key }}", "{{ api_secret }}");
// Hide the channel until a new message is added there
$client->hideChannel("messaging", "general", new Models\HideChannelRequest(
userID: "john",
));
// Show a previously hidden channel
$client->showChannel("messaging", "general", new Models\ShowChannelRequest(
userID: "john",
));You can still retrieve the list of hidden channels using the { "hidden" : true } query parameter.