decreaseMetaCounters method

Future<Map<String, int>> decreaseMetaCounters(
  1. Map<String, int> metaCounters
)

Decreases meta counters. This decreases atomically the keyed meta counter by the specified value.

Implementation

Future<Map<String, int>> decreaseMetaCounters(
    Map<String, int> metaCounters) async {
  sbLog.i(StackTrace.current, 'metaCounters: $metaCounters');
  checkUnsupportedAction();

  if (metaCounters.isEmpty) {
    throw InvalidParameterException();
  }

  return await chat.apiClient.send(
    ChannelMetaCounterUpdateRequest(
      chat,
      channelType: channelType,
      channelUrl: channelUrl,
      metaCounter: metaCounters,
      mode: UpdateMetaCounterMode.decrease,
    ),
  );
}