git » sdk » commit b6b0460

Self ping if kicked for technical reasons

author Stephen Paul Weber
2024-07-09 16:46:10 UTC
committer Stephen Paul Weber
2024-07-09 16:46:10 UTC
parent a74f415a84739162606092687fd19da6ade7254c

Self ping if kicked for technical reasons

snikket/Chat.hx +6 -1

diff --git a/snikket/Chat.hx b/snikket/Chat.hx
index 4dcecfe..38eb0de 100644
--- a/snikket/Chat.hx
+++ b/snikket/Chat.hx
@@ -709,9 +709,14 @@ class Channel extends Chat {
 
 	override public function setPresence(resource:String, presence:Presence) {
 		super.setPresence(resource, presence);
-		if (!inSync && presence?.mucUser?.allTags("status").find((status) -> status.attr.get("code") == "110") != null) {
+		final oneTen = presence?.mucUser?.allTags("status").find((status) -> status.attr.get("code") == "110");
+		final tripleThree = presence?.mucUser?.allTags("status").find((status) -> status.attr.get("code") == "333");
+		if (!inSync && oneTen != null) {
 			persistence.lastId(client.accountId(), chatId, doSync);
 		}
+		if (oneTen != null && tripleThree != null) {
+			selfPing();
+		}
 	}
 
 	private function doSync(lastId: Null<String>) {