| author | Stephen Paul Weber
<singpolyma@singpolyma.net> 2024-11-08 03:10:02 UTC |
| committer | Stephen Paul Weber
<singpolyma@singpolyma.net> 2024-11-08 03:10:02 UTC |
| parent | 5a959328b840d0b76712caf89c10507698da6249 |
| snikket/Chat.hx | +9 | -1 |
diff --git a/snikket/Chat.hx b/snikket/Chat.hx index 68ba702..73e19e7 100644 --- a/snikket/Chat.hx +++ b/snikket/Chat.hx @@ -921,8 +921,16 @@ class Channel extends Chat { } override public function setPresence(resource:String, presence:Presence) { - super.setPresence(resource, presence); final oneTen = presence?.mucUser?.allTags("status").find((status) -> status.attr.get("code") == "110"); + if (presence != null && presence.mucUser != null && oneTen == null) { + final existing = this.presence.get(resource); + if (existing != null && existing?.mucUser?.allTags("status").find((status) -> status.attr.get("code") == "110") != null) { + presence.mucUser.tag("status", { code: "110" }); + setPresence(resource, presence); + return; + } + } + super.setPresence(resource, presence); final tripleThree = presence?.mucUser?.allTags("status").find((status) -> status.attr.get("code") == "333"); if (!inSync && oneTen != null) { persistence.lastId(client.accountId(), chatId, doSync);