updateMessage method
Future<bool>
updateMessage(
- String roomId,
- String msgId,
- Map<
String, dynamic> value, { - Map<
String, dynamic> roomValues = const {}, - ChatSilentNotification? notification,
override
Implementation
@override
Future<bool> updateMessage(
String roomId,
String msgId,
Map<String, dynamic> value, {
Map<String, dynamic> roomValues = const {},
ChatSilentNotification? notification,
}) async {
if (me.isEmpty) return false;
try {
await RetryHelper.run(
operation: () {
return messageDelegate.update(
roomId,
msgId,
n.normalize(value, n.message),
);
},
);
if (roomValues.isNotEmpty) {
await RetryHelper.run(
operation: () {
return roomDelegate.update(roomId, n.normalize(roomValues, n.room));
},
);
}
if (notification != null) {
final msg = managerOrNull(roomId)?.mappedMessages[msgId];
if (msg != null) await sendNotification(msg, notification);
}
return true;
} catch (e, st) {
errorReporter.report(
e,
stackTrace: st,
source: 'MessageMixin.updateMessage',
context: {'roomId': roomId, 'msgId': msgId},
);
return false;
}
}