From 3c495a8a81901bf048d1c08fa404a6b2d43eea48 Mon Sep 17 00:00:00 2001 From: LDA Date: Sun, 21 Jul 2024 21:13:25 +0200 Subject: [PATCH] [MOD] Clean up basic things... --- XEPS-TBD.TXT | 39 ++++++++++++++++---------------- src/XMPPThread/Stanzas/Message.c | 25 ++++++++++++++------ 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/XEPS-TBD.TXT b/XEPS-TBD.TXT index c872dd9..da535ab 100644 --- a/XEPS-TBD.TXT +++ b/XEPS-TBD.TXT @@ -1,4 +1,4 @@ -XEPs current supported are in src/XMPPThread.c, at the IQ disco advertising. +XEPs current supported are in src/XMPPThread, at the IQ disco advertising. Somewhat implemented XEPs: ~ https://xmpp.org/extensions/xep-0085.html @@ -10,32 +10,33 @@ Somewhat implemented XEPs: IM platforms I won't mention), so this doesn't sound too bad to do HALF-IMPLEMENTED: Removing reacts won't work. ~ https://xmpp.org/extensions/xep-0184.html - Only Matrix->XMPP as of now + Only Matrix->XMPP as of now. Requesting data from Matrix ASes without + /sync seems like a non-option as of now, which _sucks_. + ~ https://xmpp.org/extensions/xep-0050.html + Ad-hoc commands that bridge maintainers can deal with XMPP-style are + also a nice to have. + There are commands, but not a lot of them as of now, and localisation + is missing. + ~ https://xmpp.org/extensions/xep-0421.html + Using the occupant ID in semi-anonymous MUCs is a desirable property. + I dont know of a lot of places that don't use the occupant ID anymore + within Parsee. + ~ https://xmpp.org/extensions/xep-0425.html + As mentionned in #2, moderation _needs_ to be done. For future XEPs: - - https://xmpp.org/extensions/xep-0421.html - Using the occupant ID in semi-anonymous MUCs is a desirable property. - - https://xmpp.org/extensions/xep-0118.html - Informations on what a user is listening to. Matrix doesn't have - good support for status, to be frank. Clients (including KappaChat) - should consider having more support for those, rather than it being - stuck as a FluffyChat/Nheko feature for the good of the entire - federation. - As such, if _any_ client devs hear this, please consider adding these, - (especially if you're a smElement employee!) - - https://xmpp.org/extensions/xep-0080.html - Doxxing people over two protocols is great! - https://xmpp.org/extensions/xep-0449.html Stickers are great. Matrix and XMPP somewhat has support for them, so might be a nice-to-have, and also to push over XMPP support. A minor issue with that is pack management. XMPP requires a pack field which is used along PEP, it seems, and meanwhile Matrix has ''support'' for packs too, tracking them is between "annoyance" and "yeah, no.". - - https://xmpp.org/extensions/xep-0050.html - Ad-hoc commands that bridge maintainers can deal with XMPP-style are - also a nice to have. - - https://xmpp.org/extensions/xep-0425.html - As mentionned in #2, moderation _needs_ to be done. + - https://xmpp.org/extensions/xep-0080.html + Doxxing people over two protocols is great! Sadly works over PEP it seems, + so I can't think of a good analogy tbf, also I hate dealing with PEP tbf. + - https://xmpp.org/extensions/xep-0118.html + I feel like polluting Matrix status(which more clients should implement) + sounds like a bad idea. When are we getting _extensible statuses_? ON STANDBY BECAUSE THESE HAVE BEEN TERRIBLE TO DEAL WITH AND WHO KEEPS WRITING THESE I WANT TO SEND THEM A NICE, BRIGHT GIFT: diff --git a/src/XMPPThread/Stanzas/Message.c b/src/XMPPThread/Stanzas/Message.c index cc2e026..f6ef930 100644 --- a/src/XMPPThread/Stanzas/Message.c +++ b/src/XMPPThread/Stanzas/Message.c @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -183,12 +184,9 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr) * ISSUE. * * I HATE THIS. I NEED TO FIND A BETTER WAY. */ - if (!chat) + if (!chat && strncmp(HashMapGet(stanza->attrs, "to"), "parsee@", 7)) { - if (strncmp(HashMapGet(stanza->attrs, "to"), "parsee@", 7)) - { - goto end; - } + goto end; } if (mroom_id && !XMPPIsParseeStanza(stanza)) @@ -199,18 +197,30 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr) { char *parsee = ParseeJID(args); + char *trim = ParseeTrimJID(from); + XMLElement *ps; /* Subscribe to the sender's metadata node. */ - XMLElement *ps = CreatePubsubRequest( + ps = CreatePubsubRequest( parsee, decode_from, "urn:xmpp:avatar:metadata" ); pthread_mutex_lock(&jabber->write_lock); XMLEncode(jabber->stream, ps); StreamFlush(jabber->stream); pthread_mutex_unlock(&jabber->write_lock); - XMLFreeElement(ps); + + ps = CreatePubsubRequest( + parsee, trim, "urn:xmpp:avatar:metadata" + ); + pthread_mutex_lock(&jabber->write_lock); + XMLEncode(jabber->stream, ps); + StreamFlush(jabber->stream); + pthread_mutex_unlock(&jabber->write_lock); + XMLFreeElement(ps); + Free(parsee); + Free(trim); } pthread_mutex_lock(&thr->info->chk_lock); @@ -350,6 +360,7 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr) ParseePushAllStanza(args, stanza, e_d->data); } } + end: Free(mroom_id); mroom_id = NULL;