addMessageMetaArrayValues method
- BaseMessage message,
- List<
MessageMetaArray> metaArrays
Adds message meta array values.
Implementation
Future<BaseMessage> addMessageMetaArrayValues(
BaseMessage message,
List<MessageMetaArray> metaArrays,
) async {
sbLog.i(StackTrace.current, 'metaArrays: $metaArrays');
checkUnsupportedAction();
if (message.channelUrl != channelUrl) {
throw InvalidParameterException();
}
if (metaArrays.isEmpty) {
throw InvalidParameterException();
}
final cmd = Command.buildUpdateMessageMetaArray(
message, metaArrays, MetaArrayUpdateMode.add, true);
var result = await chat.commandManager.sendCommand(cmd);
if (result != null) {
return BaseMessage.getMessageFromJsonWithChat(chat, result.payload,
commandType: result.cmd);
} else {
throw WebSocketFailedException();
}
}