git » sdk » commit 8c66813

Use setter, and always set on mark read

author Stephen Paul Weber
2024-11-12 21:43:32 UTC
committer Stephen Paul Weber
2024-11-12 21:43:32 UTC
parent aee54c54b163f738edecb648d68486b5ebfe30ee

Use setter, and always set on mark read

Setting to 0 is safe why wouldn't we?

snikket/Chat.hx +1 -1

diff --git a/snikket/Chat.hx b/snikket/Chat.hx
index a82ec98..d668544 100644
--- a/snikket/Chat.hx
+++ b/snikket/Chat.hx
@@ -577,7 +577,7 @@ abstract class Chat {
 			while (--i >= 0) {
 				if (messages[i].serverId == readUpToId) break;
 			}
-			if (i > 0) _unreadCount = messages.length - (i + 1);
+			setUnreadCount(messages.length - (i + 1));
 			if (callback != null) callback();
 		});
 	}