sendMessage method
Implementation
Future<void> sendMessage({
required Participant to,
required String type,
required Map<String, dynamic> message,
Uint8List? attachment,
bool ignoreOffline = false,
}) async {
final resolvedTo = _resolveMessageRecipient(to);
if (resolvedTo == null) {
if (ignoreOffline) {
return;
}
throw RoomServerException("the participant was not found");
}
await room.invoke(
toolkit: "messaging",
tool: "send",
input: ToolContentInput(
JsonContent(
json: _messageInput(toParticipantId: resolvedTo.id, type: type, message: message, attachment: attachment),
),
),
);
}