mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:05:10 +00:00
[ADD] Respect MIME, start bridging leaves/kicks
Wow, this one _wasn't_ pushed at 3AM, Outstanding.
This commit is contained in:
parent
4d055f3688
commit
43b3f8aaf5
8 changed files with 146 additions and 24 deletions
|
|
@ -176,6 +176,44 @@ XMPPSendMUC(XMPPComponent *comp, char *fr, char *as, char *to, char *msg, char *
|
|||
pthread_mutex_unlock(&comp->write_lock);
|
||||
}
|
||||
void
|
||||
XMPPLeaveMUC(XMPPComponent *comp, char *fr, char *muc, char *reason)
|
||||
{
|
||||
XMLElement *presence;
|
||||
char *from, *id;
|
||||
if (!comp || !fr || !muc)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&comp->write_lock);
|
||||
|
||||
presence = XMLCreateTag("presence");
|
||||
XMLAddAttr(presence, "from", (from = StrConcat(3, fr, "@", comp->host)));
|
||||
XMLAddAttr(presence, "to", muc);
|
||||
XMLAddAttr(presence, "id", (id = StrRandom(8)));
|
||||
XMLAddAttr(presence, "type", "unavailable");
|
||||
|
||||
if (reason)
|
||||
{
|
||||
XMLElement *status = XMLCreateTag("status");
|
||||
XMLElement *string = XMLCreateText(reason);
|
||||
|
||||
XMLAddChild(status, string);
|
||||
XMLAddChild(presence, status);
|
||||
}
|
||||
|
||||
XMPPAnnotatePresence(presence);
|
||||
|
||||
XMLEncode(comp->stream, presence);
|
||||
StreamFlush(comp->stream);
|
||||
|
||||
XMLFreeElement(presence);
|
||||
Free(from);
|
||||
Free(id);
|
||||
|
||||
pthread_mutex_unlock(&comp->write_lock);
|
||||
}
|
||||
void
|
||||
XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc)
|
||||
{
|
||||
XMLElement *presence, *x;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue