From dddf1680a0d6ac8d9a0bd068eb3b704e6596d47f Mon Sep 17 00:00:00 2001 From: LDA Date: Fri, 8 Nov 2024 17:43:41 +0100 Subject: [PATCH 1/3] [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); From 954c588310bf0cd2783b9e212612d65411446a6b Mon Sep 17 00:00:00 2001 From: LDA Date: Mon, 11 Nov 2024 11:00:26 +0100 Subject: [PATCH 2/3] [FIX] Don't check for upgrades on start. --- src/Parsee/Data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Parsee/Data.c b/src/Parsee/Data.c index 46a31ee..2fcee5e 100644 --- a/src/Parsee/Data.c +++ b/src/Parsee/Data.c @@ -58,7 +58,7 @@ ParseeInitData(XMPPComponent *comp) } version = GrabString(DbJson(ref), 1, "version"); - if (!ParseeIsCompatible(VERSION, version)) + if (version && !ParseeIsCompatible(VERSION, version)) { Log(LOG_WARNING, "Version mismatch(curr=%s db=%s).", VERSION, version); Log(LOG_WARNING, "Yeah. You may want to _not_ do that."); From 7f41a85a8a4d60204fec8e031a34aabc0d321007 Mon Sep 17 00:00:00 2001 From: LDA Date: Mon, 11 Nov 2024 11:23:10 +0100 Subject: [PATCH 3/3] [FIX] Oh, and set the version --- src/Parsee/Data.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Parsee/Data.c b/src/Parsee/Data.c index 2fcee5e..cb1b64b 100644 --- a/src/Parsee/Data.c +++ b/src/Parsee/Data.c @@ -54,6 +54,7 @@ ParseeInitData(XMPPComponent *comp) char *id = StrRandom(64); ref = DbCreate(data->db, 1, "info"); HashMapSet(DbJson(ref), "identifier", JsonValueString(id)); + HashMapSet(DbJson(ref), "version", JsonValueString(VERSION)); Free(id); }