markAsRead method

Future<void> markAsRead()

Sends mark as read to this channel. @since 4.0.1

Implementation

Future<void> markAsRead() async {
  sbLog.i(StackTrace.current);

  final now = DateTime.now().millisecondsSinceEpoch;
  if (now - _lastMarkAsReadTimestamp <= 1000) {
    throw MarkAsReadRateLimitExceededException();
  }

  _lastMarkAsReadTimestamp = now;
  final cmd = Command.buildRead(channelUrl);
  await chat.commandManager.sendCommand(cmd);
}