OpenChannel

public final class OpenChannel extends BaseChannel

Open channel.

A large-scale public channel similar to a chatroom, supporting a large number of concurrent participants. Users can create, enter, and leave open channels freely.

Inherits from BaseChannel and supports message querying and unread count management.

Constructors

Link copied to clipboard
public OpenChannel OpenChannel(String channelId)

Types

Link copied to clipboard
public class Companion

Properties

Link copied to clipboard
public final static OpenChannel.Companion Companion
Link copied to clipboard
private Integer participantCount

Current participant count.

Inherited properties

Link copied to clipboard
private final String channelId

Channel unique identifier

Link copied to clipboard
private final ChannelType channelType

Channel type

Link copied to clipboard
private final String draft

Text message draft content for this channel.

Link copied to clipboard

Draft info for an edited message.

Link copied to clipboard
private final Boolean includeRobot

Whether this channel contains a robot/bot user.

Link copied to clipboard
private final Boolean isPinned

Whether this channel is pinned to the top.

Link copied to clipboard
private final Message latestMessage

The latest message in this channel.

Link copied to clipboard
private final Integer mentionedCount

Unread count of mentioned messages (including @all).

Link copied to clipboard
private final Integer mentionedMeCount

Unread count of messages that specifically mention the current user.

Link copied to clipboard

Channel message push notification level.

Link copied to clipboard
private final Long operationTime

Channel operation timestamp in milliseconds.

Link copied to clipboard

Channel translation strategy.

Link copied to clipboard
private final Integer unreadCount

Unread message count.

Functions

Link copied to clipboard

Batch deletes metadata for this open channel.

Link copied to clipboard
public final Unit enterChannel(EnterOpenChannelParams params, ErrorHandler handler)

Enters (joins) this open channel.

Link copied to clipboard
public final Unit exitChannel(String extra, ErrorHandler handler)

Exits (leaves) this open channel.

Link copied to clipboard
public final Unit getMetadata(String key, OperationHandler<Map<String, String>> handler)

Gets metadata for this open channel by key.

Link copied to clipboard
public final Integer getParticipantCount()

Current participant count.

Link copied to clipboard

Sets metadata for this open channel.

Link copied to clipboard
public final Unit setParticipantCount(Integer participantCount)

Current participant count.

Inherited functions

Link copied to clipboard
public final Unit clearDraft(OperationHandler<Boolean> handler)

Clears the text message draft for this channel.

Link copied to clipboard
public Unit clearUnreadCount(OperationHandler<Boolean> handler)

Clears the unread message count for this channel.

Link copied to clipboard
public final Unit delete(OperationHandler<Boolean> handler)

Deletes this channel locally.

Link copied to clipboard
public final Unit deleteLocalMessages(List<String> messageClientIds, OperationHandler<Boolean> handler)

Deletes local messages by their client IDs.

Link copied to clipboard
public final Unit deleteMessageForAll(Message message, OperationHandler<Message> handler)

Deletes a message for all users (recall).

Link copied to clipboard
public final Unit deleteMessagesForMe(List<Message> messages, ErrorHandler handler)

Deletes messages locally (for the current user only).

Link copied to clipboard

Deletes messages before the specified timestamp (for the current user).

Link copied to clipboard
public final Unit deleteTags(List<String> tagIds, ErrorHandler handler)

Removes tags from this channel.

Link copied to clipboard
public Boolean equals(Object other)
Link copied to clipboard
public final String getChannelId()

Channel unique identifier

Link copied to clipboard
public final ChannelType getChannelType()

Channel type

Link copied to clipboard
public final String getDraft()

Text message draft content for this channel.

Link copied to clipboard

Draft info for an edited message.

Link copied to clipboard

Gets the first unread message in this channel.

Link copied to clipboard
public final Boolean getIncludeRobot()

Whether this channel contains a robot/bot user.

Link copied to clipboard
public final Message getLatestMessage()

The latest message in this channel.

Link copied to clipboard
public final Integer getMentionedCount()

Unread count of mentioned messages (including @all).

Link copied to clipboard
public final Integer getMentionedMeCount()

Unread count of messages that specifically mention the current user.

Link copied to clipboard
public final Unit getMessageReadReceiptInfo(List<String> messageIds, OperationHandler<List<ReadReceiptInfo>> handler)

Gets read receipt info for the specified messages.

Link copied to clipboard

Gets read receipt info by message identifiers.

Link copied to clipboard

Gets messages around a given sent timestamp.

Link copied to clipboard

Gets read receipt details grouped by users.

Link copied to clipboard

Channel message push notification level.

Link copied to clipboard
public final Long getOperationTime()

Channel operation timestamp in milliseconds.

Link copied to clipboard
public final Unit getTags(OperationHandler<List<ChannelTagInfo>> handler)

Gets all tags associated with this channel.

Link copied to clipboard

Channel translation strategy.

Link copied to clipboard
public final Integer getUnreadCount()

Unread message count.

Link copied to clipboard

Gets unread mentioned messages in this channel.

Link copied to clipboard
public Integer hashCode()
Link copied to clipboard
public final Unit insertMessages(List<InsertMessageItem> params, OperationHandler<Boolean> handler)

Batch inserts messages into the local database.

Link copied to clipboard
public final Boolean isPinned()

Whether this channel is pinned to the top.

Link copied to clipboard

Modifies a sent message.

Link copied to clipboard
public Unit pin(PinParams params, OperationHandler<Boolean> handler)

Pins this channel to the top of the channel list.

Link copied to clipboard
public final Unit reload(OperationHandler<BaseChannel> handler)

Reloads channel data from the local database.

Link copied to clipboard
public final Unit saveDraft(String draft, OperationHandler<Boolean> handler)

Saves a text message draft for this channel.

Link copied to clipboard

Sends a media message in this channel (e.g., image, video, file).

Link copied to clipboard
public final Unit sendMessage(SendMessageParams params, SendMessageHandler handler)

Sends a non-media message in this channel (e.g., text, location).

Link copied to clipboard
public final Unit sendReadReceiptResponse(List<String> messageIds, ErrorHandler handler)

Sends a read receipt response for the specified messages.

Link copied to clipboard

Sets the notification (do-not-disturb) level for this channel.

Link copied to clipboard
public String toString()
Link copied to clipboard
public Unit unpin(OperationHandler<Boolean> handler)

Unpins this channel from the top of the channel list.