updateUserMessage method
Updates a UserMessage
that was previously sent in the channel.
Implementation
Future<UserMessage> updateUserMessage(
int messageId, UserMessageUpdateParams params) async {
sbLog.i(StackTrace.current, 'message: ${params.message}');
checkUnsupportedAction();
if (messageId <= 0) {
throw InvalidParameterException();
}
final cmd = Command.buildUpdateUserMessage(
channelUrl,
messageId,
params,
);
final result = await chat.commandManager.sendCommand(cmd);
if (result != null) {
final message = RootMessage.getMessageFromJsonWithChat<UserMessage>(
chat,
result.payload,
commandType: cmd.cmd,
) as UserMessage;
return message;
} else {
throw WebSocketFailedException();
}
}