Object BaseChannel.Companion
-
- All Implemented Interfaces:
public class BaseChannel.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static BaseChannel.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final ChannelsQuerycreateChannelsQuery(ChannelsQueryParams params)Creates a paginated query object for the channel list. final UnitgetChannels(List<ChannelIdentifier> identifiers, OperationHandler<List<BaseChannel>> handler)Gets channels by their identifiers. final UnitgetUnreadChannels(List<ChannelType> channelTypes, OperationHandler<List<BaseChannel>> handler)Gets channels that have unread messages. final UnitgetPinnedChannels(List<ChannelType> channelTypes, OperationHandler<List<BaseChannel>> handler)Gets pinned channels of the specified types. final UnreadMentionMeChannelsQuerycreateUnreadMentionMeChannelsQuery(UnreadMentionMeChannelsQueryParams params)Creates a paginated query for channels with unread @me mention messages. final UnitsearchChannels(SearchChannelsParams params, OperationHandler<List<SearchChannelResult>> handler)Searches channels by keyword. final UnitsyncRemoteChannels(ErrorHandler handler)Syncs remote channels to the local database. final UnitdeleteChannels(List<ChannelIdentifier> identifiers, OperationHandler<Boolean> handler)Deletes channels by their identifiers. final UnitsetChannelTypeNoDisturbLevel(ChannelTypeNoDisturbLevelParams params, ErrorHandler handler)Sets the notification level for a specific channel type. final UnitgetChannelTypeNoDisturbLevel(ChannelType channelType, OperationHandler<ChannelNoDisturbLevel> handler)Gets the notification (do-not-disturb) level for a specific channel type. final UnitgetTotalUnreadCount(OperationHandler<Integer> handler)Gets the total unread message count across all channels. final UnitgetChannelsUnreadCountByNoDisturbLevel(ChannelsUnreadCountParams params, OperationHandler<Integer> handler)Gets the unread message count filtered by notification (do-not-disturb) levels. final UnitgetMessageById(GetMessageByIdParams params, OperationHandler<Message> handler)Gets a message by its ID. final UnitgetMediaDownloadInfo(String mediaUrl, OperationHandler<DownloadInfo> handler)Gets media file download information. final MessagesQuerycreateMessagesQuery(MessagesQueryParams params)Creates a paginated query for history messages. final LocalMessagesByTimeQuerycreateLocalMessagesByTimeQuery(LocalMessagesByTimeQueryParams params)Creates a paginated query for local history messages by timestamp. final SearchMessagesByUserQuerycreateSearchMessagesByUserQuery(SearchMessagesByUserQueryParams params)Creates a paginated query to search messages by user. final SearchMessagesByTimeRangeQuerycreateSearchMessagesByTimeRangeQuery(SearchMessagesByTimeRangeQueryParams params)Creates a paginated query to search messages within a time range. final SearchMessagesQuerycreateSearchMessagesQuery(SearchMessagesQueryParams params)Creates a paginated query to search messages with filters. final MessagesReadReceiptUsersQuerycreateMessagesReadReceiptUsersQuery(MessagesReadReceiptUsersQueryParams params)Creates a paginated query for message read receipt users. final UnitgetMessageReadReceiptInfoByIdentifiers(List<MessageIdentifier> identifiers, OperationHandler<List<ReadReceiptInfo>> handler)Gets read receipt info by message identifiers. final UnitrefreshReferenceMessage(RefreshReferenceMessageParams params, RefreshReferenceMessageHandler handler)Refreshes referenced messages by their IDs. -
-
Method Detail
-
createChannelsQuery
final ChannelsQuery createChannelsQuery(ChannelsQueryParams params)
Creates a paginated query object for the channel list.
Returns a ChannelsQuery object. Use ChannelsQuery.loadNextPage to load data page by page.
- Parameters:
params- Query parameters including channel types, page size, etc.- Returns:
A paginated query object
-
getChannels
final Unit getChannels(List<ChannelIdentifier> identifiers, OperationHandler<List<BaseChannel>> handler)
Gets channels by their identifiers.
- Parameters:
identifiers- List of channel identifiers to queryhandler- Callback returning the list of channels on success
-
getUnreadChannels
final Unit getUnreadChannels(List<ChannelType> channelTypes, OperationHandler<List<BaseChannel>> handler)
Gets channels that have unread messages.
Only supports ChannelType.DIRECT, ChannelType.GROUP, and ChannelType.SYSTEM. Open channel and community channel types are not supported.
- Parameters:
channelTypes- List of channel types to queryhandler- Callback returning channels with unread messages on success
-
getPinnedChannels
final Unit getPinnedChannels(List<ChannelType> channelTypes, OperationHandler<List<BaseChannel>> handler)
Gets pinned channels of the specified types.
- Parameters:
channelTypes- List of channel types to queryhandler- Callback returning pinned channels on success
-
createUnreadMentionMeChannelsQuery
final UnreadMentionMeChannelsQuery createUnreadMentionMeChannelsQuery(UnreadMentionMeChannelsQueryParams params)
Creates a paginated query for channels with unread @me mention messages.
- Parameters:
params- Query parameters including channel types, page size, etc.- Returns:
A paginated query object
-
searchChannels
final Unit searchChannels(SearchChannelsParams params, OperationHandler<List<SearchChannelResult>> handler)
Searches channels by keyword.
- Parameters:
params- Search parameters including keyword, channel types, and optional message type filtershandler- Callback returning a list of SearchChannelResult on success
-
syncRemoteChannels
final Unit syncRemoteChannels(ErrorHandler handler)
Syncs remote channels to the local database.
- Parameters:
handler- Error callback;nullerror indicates success
-
deleteChannels
final Unit deleteChannels(List<ChannelIdentifier> identifiers, OperationHandler<Boolean> handler)
Deletes channels by their identifiers.
- Parameters:
identifiers- List of channel identifiers to deletehandler- Callback returning the operation result
-
setChannelTypeNoDisturbLevel
final Unit setChannelTypeNoDisturbLevel(ChannelTypeNoDisturbLevelParams params, ErrorHandler handler)
Sets the notification level for a specific channel type.
- Parameters:
params- Parameters containing the channel type and notification levelhandler- Error callback;nullerror indicates success
-
getChannelTypeNoDisturbLevel
final Unit getChannelTypeNoDisturbLevel(ChannelType channelType, OperationHandler<ChannelNoDisturbLevel> handler)
Gets the notification (do-not-disturb) level for a specific channel type.
- Parameters:
channelType- The channel type to queryhandler- Callback returning the notification level on success
-
getTotalUnreadCount
final Unit getTotalUnreadCount(OperationHandler<Integer> handler)
Gets the total unread message count across all channels.
- Parameters:
handler- Callback returning the total unread count on success
-
getChannelsUnreadCountByNoDisturbLevel
final Unit getChannelsUnreadCountByNoDisturbLevel(ChannelsUnreadCountParams params, OperationHandler<Integer> handler)
Gets the unread message count filtered by notification (do-not-disturb) levels.
- Parameters:
params- Parameters containing channel types and notification levelshandler- Callback returning the unread count on success
-
getMessageById
final Unit getMessageById(GetMessageByIdParams params, OperationHandler<Message> handler)
Gets a message by its ID.
Supports querying by either
messageId(server UID) ormessageClientId(local ID).- Parameters:
params- Parameters containing eithermessageIdormessageClientIdhandler- Callback returning the message on success
-
getMediaDownloadInfo
final Unit getMediaDownloadInfo(String mediaUrl, OperationHandler<DownloadInfo> handler)
Gets media file download information.
- Parameters:
mediaUrl- The file unique identifier (corresponds tofileUniqueIdin download operations)handler- Callback returning the download info on success
-
createMessagesQuery
final MessagesQuery createMessagesQuery(MessagesQueryParams params)
Creates a paginated query for history messages.
Use MessagesQuery.loadNextPage to load messages page by page.
- Parameters:
params- Query parameters including channel, page size, message type, sort order, etc.- Returns:
A paginated message query object
-
createLocalMessagesByTimeQuery
final LocalMessagesByTimeQuery createLocalMessagesByTimeQuery(LocalMessagesByTimeQueryParams params)
Creates a paginated query for local history messages by timestamp.
Queries messages starting from a specific timestamp, optionally filtered by message types. Use LocalMessagesByTimeQuery.loadNextPage to load messages page by page.
- Parameters:
params- Query parameters including channel, timestamp, message types, and page size- Returns:
A paginated local message query object
-
createSearchMessagesByUserQuery
final SearchMessagesByUserQuery createSearchMessagesByUserQuery(SearchMessagesByUserQueryParams params)
Creates a paginated query to search messages by user.
- Parameters:
params- Query parameters including channel, user ID, start time, and optional sub-channel IDs- Returns:
A paginated search query object
-
createSearchMessagesByTimeRangeQuery
final SearchMessagesByTimeRangeQuery createSearchMessagesByTimeRangeQuery(SearchMessagesByTimeRangeQueryParams params)
Creates a paginated query to search messages within a time range.
- Parameters:
params- Query parameters including channel, keyword, start time, and end time- Returns:
A paginated search query object
-
createSearchMessagesQuery
final SearchMessagesQuery createSearchMessagesQuery(SearchMessagesQueryParams params)
Creates a paginated query to search messages with filters.
Supports filtering by keyword, sender IDs, message types, and time range.
- Parameters:
params- Query parameters including channel, keyword, and message filters- Returns:
A paginated search query object
-
createMessagesReadReceiptUsersQuery
final MessagesReadReceiptUsersQuery createMessagesReadReceiptUsersQuery(MessagesReadReceiptUsersQueryParams params)
Creates a paginated query for message read receipt users.
- Parameters:
params- Query parameters including channel, message ID, read receipt status, and sort order- Returns:
A paginated read receipt users query object
-
getMessageReadReceiptInfoByIdentifiers
final Unit getMessageReadReceiptInfoByIdentifiers(List<MessageIdentifier> identifiers, OperationHandler<List<ReadReceiptInfo>> handler)
Gets read receipt info by message identifiers.
- Parameters:
identifiers- List of message identifiers to queryhandler- Callback returning the read receipt info list on success
-
refreshReferenceMessage
final Unit refreshReferenceMessage(RefreshReferenceMessageParams params, RefreshReferenceMessageHandler handler)
Refreshes referenced messages by their IDs.
First queries local messages, then fetches from the server for any not found locally.
- Parameters:
params- Parameters containing the channel and message IDs to refreshhandler- Callback for local results, remote results, and errors
-
-
-
-