git » sdk » commit eb73df7

Helper to know if user has ever read the chat

author Stephen Paul Weber
2026-10-05 18:47:37 UTC
committer Stephen Paul Weber
2026-10-05 18:47:37 UTC
parent e350363246f2de85932f22193accc75368eb674b

Helper to know if user has ever read the chat

Even if we don't actually have the readUpToId in the local db yet

borogove/Chat.hx +7 -0

diff --git a/borogove/Chat.hx b/borogove/Chat.hx
index 96f78ef..4ac3178 100644
--- a/borogove/Chat.hx
+++ b/borogove/Chat.hx
@@ -628,6 +628,13 @@ abstract class Chat extends EventEmitter {
 		return Color.defaultPhoto(chatId, getDisplayName().charAt(0).toUpperCase());
 	}
 
+	/**
+		Has the user ever read this chat?
+	**/
+	public function hasEverRead(): Bool {
+		return readUpToId != null;
+	}
+
 	/**
 		An ID of the last message displayed to the user
 	**/