mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:15:11 +00:00
[MOD] Do not quit on corpseless stanzas.
Reactions seems to suffer from that problem...
This commit is contained in:
parent
8d1dc09c54
commit
253731268d
1 changed files with 7 additions and 11 deletions
|
|
@ -126,17 +126,12 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
|
||||
}
|
||||
#undef CHAT_STATES
|
||||
if (!body)
|
||||
{
|
||||
XMLFreeElement(stanza);
|
||||
return false;
|
||||
}
|
||||
|
||||
to = ParseeDecodeMXID(HashMapGet(stanza->attrs, "to"));
|
||||
decode_from = ParseeLookupJID(from);
|
||||
from_matrix = ParseeEncodeJID(args->config, decode_from, true);
|
||||
room = ParseeFindDMRoom(args, to, from);
|
||||
data = ArrayGet(body->children, 0);
|
||||
data = body ? ArrayGet(body->children, 0) : NULL;
|
||||
|
||||
/* TODO: CLEAN THAT UP */
|
||||
mroom_id = ParseeGetBridgedRoom(args, stanza);
|
||||
|
|
@ -219,12 +214,13 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
ASInvite(args->config, mroom_id, encoded);
|
||||
Free(ASJoin(args->config, mroom_id, encoded));
|
||||
|
||||
/* Check if it is a media link */
|
||||
oob = XMLookForTKV(stanza, "x", "xmlns", "jabber:x:oob");
|
||||
reactions = XMLookForTKV(stanza,
|
||||
"reactions", "xmlns", "urn:xmpp:reactions:0"
|
||||
);
|
||||
if (oob)
|
||||
|
||||
/* Check if it is a media link */
|
||||
oob = XMLookForTKV(stanza, "x", "xmlns", "jabber:x:oob");
|
||||
if (oob && data)
|
||||
{
|
||||
char *mxc, *mime = NULL;
|
||||
HashMap *content = NULL;
|
||||
|
|
@ -286,7 +282,7 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
Free(event_id);
|
||||
event_id = NULL;
|
||||
}
|
||||
else
|
||||
else if (data)
|
||||
{
|
||||
/* TODO: Use HTML-formatted bodies, and respect the fallback
|
||||
* trims the stanza provides us if possible. Element does not
|
||||
|
|
@ -311,7 +307,7 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
Free(event_id);
|
||||
pthread_mutex_unlock(&thr->info->chk_lock);
|
||||
}
|
||||
else if (replaced)
|
||||
else if (replaced && data)
|
||||
{
|
||||
event_id = ParseeGetEventFromID(args, stanza, replaced);
|
||||
Free(ASSend(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue