sendChat method

Future<VoxeraRoomSendResult> sendChat({
  1. required String cid,
  2. required String text,
  3. String? senderName,
  4. Map<String, dynamic>? userData,
  5. String? chatMessageId,
})

Sends one chat line. cid is the id from newCid; the message id is messageId of the local identity and cid.

Implementation

Future<VoxeraRoomSendResult> sendChat({
  required String cid,
  required String text,
  String? senderName,
  Map<String, dynamic>? userData,
  String? chatMessageId,
}) {
  return _send('room.msg.chat', {
    'cid': cid,
    'text': text,
    if (senderName != null && senderName.isNotEmpty)
      'sender_name': senderName,
    if (userData != null && userData.isNotEmpty) 'user_data': userData,
    if (chatMessageId != null && chatMessageId.isNotEmpty)
      'message_id': chatMessageId,
  });
}