ContactsApi class
REST implementation of ChatContactsApi (contacts list + DMs + block list).
- Implemented types
Constructors
- ContactsApi({required RestClient rest, ChatLocalDatasource? cache, CacheManager? cacheManager, OfflineQueue? offlineQueue})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
String contactUserId) → Future< ChatResult< void> > -
Adds a user to the contact list.
override
-
block(
String userId) → Future< ChatResult< void> > -
Blocks a user, hiding their messages and preventing contact.
override
-
getConversationMessages(
String conversationId, {ChatCursorPaginationParams? pagination}) → Future< ChatResult< ChatPaginatedResponse< >ChatMessage> > -
Fetches messages of a resolved 1:1 conversation by its
conversationId— the backend-assigned DM room id.override -
getDirectMessages(
String contactUserId, {ChatCursorPaginationParams? pagination}) → Future< ChatResult< ChatPaginatedResponse< >ChatMessage> > -
Fetches direct message history with a contact.
override
-
getPresence(
String contactUserId) → Future< ChatResult< ChatPresence> > -
Gets the online presence of a contact.
override
-
list(
{ChatPaginationParams? pagination, CachePolicy? cachePolicy}) → Future< ChatResult< ChatPaginatedResponse< >ChatContact> > -
Lists the current user's contacts.
override
-
listBlocked(
{ChatPaginationParams? pagination}) → Future< ChatResult< ChatPaginatedResponse< >String> > -
Lists all blocked user IDs.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String contactUserId) → Future< ChatResult< void> > -
Removes a user from the contact list.
override
-
sendDirectMessage(
String contactUserId, {String? text, MessageType messageType = MessageType.regular, String? referencedMessageId, String? reaction, String? attachmentUrl, Map< String, dynamic> ? metadata, String? clientMessageId, bool enqueueOnFailure = true}) → Future<ChatResult< ChatMessage> > -
Sends a direct message to a contact (creates a 1:1 room if needed).
override
-
sendTyping(
String contactUserId, {ChatActivity activity = ChatActivity.startsTyping}) → Future< ChatResult< void> > -
Sends a typing activity to a DM contact.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
unblock(
String userId) → Future< ChatResult< void> > -
Unblocks a previously blocked user.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited