reportMessage method
- {required BaseMessage message,
- required ReportCategory category,
- 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,
));
}