mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 23:05:10 +00:00
[FIX/WIP] Plumbing, -Werror, death to hitmen
Suspend killers are now no more. Except the actual killers to be gone eventually. Plumbing is also very basic as of now, but it "works".
This commit is contained in:
parent
1f658ece76
commit
bb836789b2
23 changed files with 310 additions and 165 deletions
|
|
@ -15,6 +15,7 @@ XMPPQueryMUC(XMPPComponent *jabber, char *muc, MUCInfo *out)
|
|||
char *uuid, *from;
|
||||
if (!jabber || !muc)
|
||||
{
|
||||
Log(LOG_WARNING, ":(");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -32,25 +33,19 @@ XMPPQueryMUC(XMPPComponent *jabber, char *muc, MUCInfo *out)
|
|||
|
||||
XMLAddChild(iq_query, query);
|
||||
Free(from);
|
||||
Free(uuid);
|
||||
|
||||
/* Pause the XMPP thread */
|
||||
XMPPKillThread(jabber, "suspend");
|
||||
UtilSleepMillis(500);
|
||||
{
|
||||
XMLElement *identity;
|
||||
/* -- WE ARE ON OUR OWN HERE WITH STANZAS -- */
|
||||
XMLEncode(jabber->stream, iq_query);
|
||||
StreamFlush(jabber->stream);
|
||||
XMLFreeElement(iq_query);
|
||||
|
||||
/* Except an IQ reply */
|
||||
iq_query = XMLDecode(jabber->stream, false);
|
||||
/* TODO: I've spotted presence requests spawning there. */
|
||||
iq_query = ParseeAwaitStanza(uuid);
|
||||
Free(uuid);
|
||||
if (!iq_query || !StrEquals(iq_query->name, "iq"))
|
||||
{
|
||||
XMLFreeElement(iq_query);
|
||||
ParseeWakeupThread();
|
||||
pthread_mutex_unlock(&jabber->write_lock);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -62,7 +57,6 @@ XMPPQueryMUC(XMPPComponent *jabber, char *muc, MUCInfo *out)
|
|||
"conference"))
|
||||
{
|
||||
XMLFreeElement(iq_query);
|
||||
ParseeWakeupThread();
|
||||
pthread_mutex_unlock(&jabber->write_lock);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -79,9 +73,7 @@ XMPPQueryMUC(XMPPComponent *jabber, char *muc, MUCInfo *out)
|
|||
XMLFreeElement(iq_query);
|
||||
}
|
||||
}
|
||||
/* Wake it up once we're done */
|
||||
pthread_mutex_unlock(&jabber->write_lock);
|
||||
ParseeWakeupThread();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue