git » sdk » commit 292bfa5

if syncPoint > sortId, update sortId

author Stephen Paul Weber
2026-06-03 00:33:40 UTC
committer Stephen Paul Weber
2026-06-03 00:33:40 UTC
parent bf5258ba3f188b0e7bb12ffd1a79fa219720b214

if syncPoint > sortId, update sortId

Can happen eg if lastMessage is an edited message so it's sortId is in
history but most recent sortId is newer than that.

borogove/Chat.hx +3 -0

diff --git a/borogove/Chat.hx b/borogove/Chat.hx
index 3446948..a10a1b6 100644
--- a/borogove/Chat.hx
+++ b/borogove/Chat.hx
@@ -1701,6 +1701,9 @@ class Channel extends Chat {
 	}
 
 	private function doSync(syncPoint: Null<ChatMessage>, ?sortA: Null<String>) {
+		if (syncPoint?.sortId != null && (sortId == null || syncPoint.sortId > sortId)) {
+			sortId = syncPoint.sortId;
+		}
 		if (!disco.features.contains("urn:xmpp:mam:2")) {
 			inSync = true;
 			return;