From dddf1680a0d6ac8d9a0bd068eb3b704e6596d47f Mon Sep 17 00:00:00 2001 From: LDA Date: Fri, 8 Nov 2024 17:43:41 +0100 Subject: [PATCH] [RELEASE/FIX] Fix ban-unlinks, actually get 0.2. --- CHANGELOG.md | 8 +++++--- src/XMPPThread/Stanzas/Presence.c | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c9f368..5999d7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,10 +13,10 @@ commit done between releases. *There is currently no beta releases of Parsee* ## Alpha -### v0.2.0[star-of-hope] <8/11/2024?> +### v0.2.0[star-of-hope] <8/11/2024> Fixes some media metadata things, replaces the build system, -tries out avatar support some more and speeds up Parsee a tad -bit. +tries out avatar support some more, MUC contexts, and speeds +up Parsee just a bit. MbedTLS support is still highly unstable. #### New things - Start dealing with some basic PEP and vCard-based avatar support from both sides. @@ -50,6 +50,8 @@ size on the fly, or having extensions being able to postprocess the stanza). - Parsee now stops when a stream error is received, instead of being in a limbo state. +- The format for links has been changed to be slighlty *less* +annoying. #### Deprecated features - The old `build.c` and `Makefile`s used for building are removed, diff --git a/src/XMPPThread/Stanzas/Presence.c b/src/XMPPThread/Stanzas/Presence.c index fb6011b..65c2082 100644 --- a/src/XMPPThread/Stanzas/Presence.c +++ b/src/XMPPThread/Stanzas/Presence.c @@ -163,6 +163,8 @@ PresenceStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr) int power_level = 0; char *parsee = ParseeMXID(args); char *parsee_j = ParseeJID(args); + char *muc = ParseeTrimJID(HashMapGet(stanza->attrs, "from")); + char *parsee_muc = StrConcat(3, muc, "/", "parsee"); Free(trim); if (!item) @@ -206,15 +208,12 @@ PresenceStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr) if (!StrEquals(HashMapGet(stanza->attrs, "to"), parsee_j) && IsStatus(110)) { - char *muc = ParseeTrimJID(HashMapGet(stanza->attrs, "from")); char *usr = HashMapGet(stanza->attrs, "to"); /* Ask for voice in a visitor self-presence. We do not notify * the user, as an error MUST occur, which is handled and * logged out. */ XMPPRequestVoice(args->jabber, usr, muc); - - Free(muc); } } @@ -270,7 +269,8 @@ PresenceStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr) } } if (StrEquals(type, "unavailable") && - StrEquals(dst, parsee_j) && IsStatus(301)) + (StrEquals(jid, parsee_muc) || StrEquals(jid, parsee_j)) + && IsStatus(301)) { char *chat_id = ParseeGetFromRoomID(args, room); @@ -287,7 +287,9 @@ PresenceStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr) } end_item: + Free(muc); Free(from); + Free(parsee_muc); Free(decode_from); Free(real_matrix); Free(matrix_user_pl);