-
public final class ChatClientExtensions
-
-
Method Summary
Modifier and Type Method Description final static Call<List<Member>>requestMembers(ChatClient $self, String cid, Integer offset, Integer limit, FilterObject filter, QuerySort<Member> sort, List<Member> members)Query members of a channel. final static Call<List<Member>>requestMembers(ChatClient $self, String cid, Integer offset, Integer limit, FilterObject filter, QuerySort<Member> sort)Query members of a channel. final static Call<List<Member>>requestMembers(ChatClient $self, String cid, Integer offset, Integer limit, FilterObject filter)Query members of a channel. final static Call<List<Member>>requestMembers(ChatClient $self, String cid, Integer offset, Integer limit)Query members of a channel. final static Call<List<Member>>requestMembers(ChatClient $self, String cid, Integer offset)Query members of a channel. final static Call<List<Member>>requestMembers(ChatClient $self, String cid)Query members of a channel. final static Call<List<User>>searchUsersByName(ChatClient $self, String querySearch, Integer offset, Integer userLimit, Boolean userPresence)Perform api request with a search string as autocomplete if in online state. final static Call<List<ChatEvent>>replayEventsForActiveChannels(ChatClient $self, String cid)Adds the provided channel to the active channels and replays events for all active channels. final static Call<Unit>setMessageForReply(ChatClient $self, String cid, Message message)Set the reply state for the channel. final static Call<Unit>downloadAttachment(ChatClient $self, Attachment attachment)Downloads the selected attachment to the "Download" folder in the public external storage directory. final static Call<Boolean>keystroke(ChatClient $self, String cid, String parentId)Keystroke should be called whenever a user enters text into the message input. final static Call<Boolean>stopTyping(ChatClient $self, String cid, String parentId)StopTyping should be called when the user submits the text and finishes typing. final static Call<Channel>loadOlderMessages(ChatClient $self, String cid, Integer messageLimit)Loads older messages for the channel. final static Call<Boolean>cancelMessage(ChatClient $self, Message message)Cancels the message of "ephemeral" type. final static Call<Channel>createChannel(ChatClient $self, Channel channel)Creates a new channel. final static Call<Message>loadMessageById(ChatClient $self, String cid, String messageId, Integer olderMessagesOffset, Integer newerMessagesOffset)Loads message for a given message id and channel id. -
-
Method Detail
-
requestMembers
final static Call<List<Member>> requestMembers(ChatClient $self, String cid, Integer offset, Integer limit, FilterObject filter, QuerySort<Member> sort, List<Member> members)
Query members of a channel.
- Parameters:
cid- CID of the Channel whose members we are querying.offset- Indicates how many items to exclude from the start of the result.limit- Indicates the maximum allowed number of items in the result.filter- Filter applied to online queries for advanced selection criteria.sort- The sort criteria applied to the result.
-
requestMembers
final static Call<List<Member>> requestMembers(ChatClient $self, String cid, Integer offset, Integer limit, FilterObject filter, QuerySort<Member> sort)
Query members of a channel.
- Parameters:
cid- CID of the Channel whose members we are querying.offset- Indicates how many items to exclude from the start of the result.limit- Indicates the maximum allowed number of items in the result.filter- Filter applied to online queries for advanced selection criteria.sort- The sort criteria applied to the result.
-
requestMembers
final static Call<List<Member>> requestMembers(ChatClient $self, String cid, Integer offset, Integer limit, FilterObject filter)
Query members of a channel.
- Parameters:
cid- CID of the Channel whose members we are querying.offset- Indicates how many items to exclude from the start of the result.limit- Indicates the maximum allowed number of items in the result.filter- Filter applied to online queries for advanced selection criteria.
-
requestMembers
final static Call<List<Member>> requestMembers(ChatClient $self, String cid, Integer offset, Integer limit)
Query members of a channel.
- Parameters:
cid- CID of the Channel whose members we are querying.offset- Indicates how many items to exclude from the start of the result.limit- Indicates the maximum allowed number of items in the result.
-
requestMembers
final static Call<List<Member>> requestMembers(ChatClient $self, String cid, Integer offset)
Query members of a channel.
- Parameters:
cid- CID of the Channel whose members we are querying.offset- Indicates how many items to exclude from the start of the result.
-
requestMembers
final static Call<List<Member>> requestMembers(ChatClient $self, String cid)
Query members of a channel.
- Parameters:
cid- CID of the Channel whose members we are querying.
-
searchUsersByName
final static Call<List<User>> searchUsersByName(ChatClient $self, String querySearch, Integer offset, Integer userLimit, Boolean userPresence)
Perform api request with a search string as autocomplete if in online state. Otherwise performs search by name in local database.
- Parameters:
querySearch- Search string used as autocomplete.offset- Offset for paginated requests.userLimit- The page size in the request.userPresence- Presence flag to obtain additional info such as last active date.
-
replayEventsForActiveChannels
final static Call<List<ChatEvent>> replayEventsForActiveChannels(ChatClient $self, String cid)
Adds the provided channel to the active channels and replays events for all active channels.
-
setMessageForReply
final static Call<Unit> setMessageForReply(ChatClient $self, String cid, Message message)
Set the reply state for the channel.
- Parameters:
cid- CID of the channel where reply state is being set.message- The message we want reply to.
-
downloadAttachment
final static Call<Unit> downloadAttachment(ChatClient $self, Attachment attachment)
Downloads the selected attachment to the "Download" folder in the public external storage directory.
- Parameters:
attachment- The attachment to download.
-
keystroke
final static Call<Boolean> keystroke(ChatClient $self, String cid, String parentId)
Keystroke should be called whenever a user enters text into the message input. It automatically calls stopTyping when the user stops typing after 5 seconds.
- Parameters:
cid- The full channel id i.parentId- Set this field tomessage.idto indicate that typing event is happening in a thread.
-
stopTyping
final static Call<Boolean> stopTyping(ChatClient $self, String cid, String parentId)
StopTyping should be called when the user submits the text and finishes typing.
- Parameters:
cid- The full channel id i.parentId- Set this field tomessage.idto indicate that typing event is happening in a thread.
-
loadOlderMessages
final static Call<Channel> loadOlderMessages(ChatClient $self, String cid, Integer messageLimit)
Loads older messages for the channel.
- Parameters:
cid- The full channel id i.e.messageLimit- How many new messages to load.
-
cancelMessage
final static Call<Boolean> cancelMessage(ChatClient $self, Message message)
Cancels the message of "ephemeral" type. Removes the message from local storage. API call to remove the message is retried according to the retry policy specified on the chatDomain.
- Parameters:
message- Theephemeralmessage to cancel.
-
createChannel
final static Call<Channel> createChannel(ChatClient $self, Channel channel)
Creates a new channel. Will retry according to the retry policy if it fails.
- Parameters:
channel- The channel object.
-
loadMessageById
final static Call<Message> loadMessageById(ChatClient $self, String cid, String messageId, Integer olderMessagesOffset, Integer newerMessagesOffset)
Loads message for a given message id and channel id.
- Parameters:
cid- The full channel id i.messageId- The id of the message.olderMessagesOffset- How many new messages to load before the requested message.newerMessagesOffset- How many new messages to load after the requested message.
-
-
-
-