favoriteChatContact method

Future<ChatContactEventsVersionedMixin?> favoriteChatContact(
  1. ChatContactId id,
  2. ChatContactFavoritePosition position
)

Marks the specified ChatContact as favorited for the authenticated MyUser and sets its position in the favorites list.

To move the ChatContact to a concrete position in a favorites list, provide the average value of two other ChatContacts positions surrounding it.

Authentication

Mandatory.

Result

Only the following ChatContactEvent may be produced on success:

Idempotent

Succeeds as no-op (and returns no ChatContactEvent) if the specified ChatContact is already favorited at the same position.

Implementation

Future<ChatContactEventsVersionedMixin?> favoriteChatContact(
  ChatContactId id,
  ChatContactFavoritePosition position,
) async {
  throw UnimplementedError();

  // Log.debug('favoriteChatContact($id, $position)', '$runtimeType');

  // final variables = FavoriteChatContactArguments(id: id, pos: position);
  // final QueryResult result = await client.mutate(
  //   MutationOptions(
  //     operationName: 'FavoriteChatContact',
  //     document: FavoriteChatContactMutation(variables: variables).document,
  //     variables: variables.toJson(),
  //   ),
  //   onException: (data) => FavoriteChatContactException(
  //       (FavoriteChatContact$Mutation.fromJson(data).favoriteChatContact
  //               as FavoriteChatContact$Mutation$FavoriteChatContact$FavoriteChatContactError)
  //           .code),
  // );
  // return FavoriteChatContact$Mutation.fromJson(result.data!)
  //     .favoriteChatContact as ChatContactEventsVersionedMixin?;
}