pinConversation static method

Future<Conversation?> pinConversation(
  1. String conversationWith,
  2. String conversationType, {
  3. dynamic onSuccess(
    1. Conversation conversation
    )?,
  4. dynamic onError(
    1. 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.

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,
  );
}