resendMessage method
- ChatMessage message
Resends a message.
Param message
The message object to be resent: ChatMessage
.
Implementation
Future<ChatMessage> resendMessage(ChatMessage message) async {
message.status = MessageStatus.PROGRESS;
Map result = await ChatChannel.invokeMethod(
ChatMethodKeys.resendMessage, message.toJson());
try {
ChatError.hasErrorFromResult(result);
ChatMessage msg =
ChatMessage.fromJson(result[ChatMethodKeys.resendMessage]);
message.from = msg.from;
message.to = msg.to;
message.status = msg.status;
return message;
} on ChatError catch (e) {
throw e;
}
}