Skip to content

Commit

Permalink
If there was no last message, use the one from MAM
Browse files Browse the repository at this point in the history
  • Loading branch information
singpolyma committed Jun 27, 2024
1 parent 032aaf0 commit 16ce799
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snikket/Chat.hx
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ class Channel extends Chat {
} else {
inSync = true;
final lastFromSync = chatMessages[chatMessages.length - 1];
if (lastFromSync != null && Reflect.compare(lastFromSync.timestamp, lastMessageTimestamp()) > 0) {
if (lastFromSync != null && (lastMessageTimestamp() == null || Reflect.compare(lastFromSync.timestamp, lastMessageTimestamp()) > 0)) {
setLastMessage(lastFromSync);
client.trigger("chats/update", [this]);
}
Expand Down

0 comments on commit 16ce799

Please sign in to comment.