mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 18:25:10 +00:00
[MOD] Clean up basic things...
This commit is contained in:
parent
db10a70313
commit
3c495a8a81
2 changed files with 37 additions and 25 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <Cytoplasm/Memory.h>
|
||||
#include <Cytoplasm/Str.h>
|
||||
#include <Cytoplasm/Log.h>
|
||||
|
||||
#include <Matrix.h>
|
||||
#include <AS.h>
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue