1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 08:15:16 +00:00

Handles messages update events

This commit is contained in:
2020-04-19 14:16:35 +02:00
parent 2746623b8d
commit 88ba2d303e
6 changed files with 31 additions and 38 deletions

View File

@ -48,4 +48,10 @@ class ConversationMessagesList extends ListBase<ConversationMessage> {
if (message.id < firstMessageID) firstMessageID = message.id;
return firstMessageID;
}
/// Replace a message by another one (if any)
void replace(ConversationMessage msg) {
final index = this.indexWhere((t) => t.id == msg.id);
if (index >= 0) this[index] = msg;
}
}