reportMessage method

Future<void> reportMessage(
  1. {required BaseMessage message,
  2. required ReportCategory category,
  3. String? description}
)

Reports a malicious message.

Implementation

Future<void> reportMessage({
  required BaseMessage message,
  required ReportCategory category,
  String? description,
}) async {
  sbLog.i(
      StackTrace.current, 'message: ${message.message}, category: $category');
  checkUnsupportedAction();

  final senderId = message.sender?.userId;
  if (senderId == null || senderId.isEmpty) {
    throw InvalidParameterException();
  }

  await chat.apiClient.send(MessageReportRequest(
    chat,
    messageId: message.messageId,
    senderId: senderId,
    channelType: channelType,
    channelUrl: channelUrl,
    category: category,
    description: description,
  ));
}