pinConversation static method
Future<Conversation?>
pinConversation(
- String conversationWith,
- String conversationType, {
- dynamic onSuccess(
- Conversation conversation
- dynamic onError(
- CometChatException excep
Pin the logged-in user's conversation with a user or group so it surfaces at the top of the conversations list.
conversationWith is the counterpart uid/guid, conversationType
user/group. Returns the full updated Conversation with
pinnedAt/pinnedBy stamped. Idempotent.
A conversation can also be pinned by an admin surface, in which case
pinnedBy carries the app_system sentinel and the pin cannot be
removed from the client.
Reports through onSuccess only: this device fires no
ConversationListener.onConversationPinned for its own call. The user's
other devices receive it, as they do an admin pin.
Implementation
static Future<Conversation?> pinConversation(
String conversationWith,
String conversationType, {
Function(Conversation conversation)? onSuccess,
Function(CometChatException e)? onError,
}) {
return _conversationPinFacadeCall(
conversationWith,
conversationType,
'conversation_pinned',
(sdk) =>
sdk.conversations.pinConversation(conversationWith, conversationType),
onSuccess,
onError,
);
}