[FIX] Saner way to filter stanzas

This commit is contained in:
LDA 2024-07-20 16:24:10 +02:00
commit f743a33643

View file

@ -24,6 +24,7 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
char *retracted = XMPPGetRetractedID(stanza);
char *reply_to = XMPPGetReply(stanza);
char *moderated = XMPPGetModeration(stanza);
bool chat = StrEquals(HashMapGet(stanza->attrs, "type"), "chat");
size_t i;
to = NULL;
@ -182,7 +183,7 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
* ISSUE.
*
* I HATE THIS. I NEED TO FIND A BETTER WAY. */
if (mroom_id)
if (!chat)
{
if (strncmp(HashMapGet(stanza->attrs, "to"), "parsee@", 7))
{
@ -195,7 +196,6 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
char *res = ParseeGetResource(from);
char *encoded = ParseeGetBridgedUser(args, stanza);
char *event_id = NULL;
bool chat = StrEquals(HashMapGet(stanza->attrs, "type"), "chat");
{
char *parsee = ParseeJID(args);