send static method

Future send(
  1. String conversationId,
  2. dynamic message, {
  3. Uint8List? image,
})

Send message message to conversation with id conversationId.

Implementation

static Future<Message> send(
  String conversationId,
  Message message, {
  Uint8List? image,
}) async {
  MercuryRequest req = await _req();
  req.message = Message(text: message.text, conversationId: conversationId);
  if (message.replyTo.hasId())
    req.message.replyTo = Message(id: message.replyTo.id);
  if (image != null) {
    MercuryResponse res = await _client.uploadImage(_imageStream(image));
    //TODO: req.message.images = [image];
  }

  MercuryResponse res = await _client.send(req);
  return res.message;
}