mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 19:55:10 +00:00
[MOD] Die on loopback stanza
Dirty hack to a memory problem.
This commit is contained in:
parent
b408cbf224
commit
14ebef53ce
7 changed files with 77 additions and 16 deletions
|
|
@ -34,16 +34,23 @@ XMPPSendPlain(XMPPComponent *comp, char *fr, char *to, char *msg, char *type)
|
|||
void
|
||||
XMPPSendPresence(XMPPComponent *comp, char *fr, char *to)
|
||||
{
|
||||
XMLElement *presence, *x;
|
||||
char *from;
|
||||
if (!comp || !fr || !to)
|
||||
{
|
||||
return;
|
||||
}
|
||||
StreamPrintf(comp->stream,
|
||||
"<presence from='%s@%s' to='%s'>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc'/>"
|
||||
"</presence>",
|
||||
fr, comp->host,
|
||||
to
|
||||
);
|
||||
|
||||
presence = XMLCreateTag("presence");
|
||||
x = XMLCreateTag("x");
|
||||
XMLAddAttr(presence, "from", (from = StrConcat(3, fr, "@", comp->host)));
|
||||
XMLAddAttr(presence, "to", to);
|
||||
XMLAddAttr(x, "xmlns", "http://jabber.org/protocol/muc");
|
||||
|
||||
XMLAddChild(presence, x);
|
||||
|
||||
XMLEncode(comp->stream, presence);
|
||||
StreamFlush(comp->stream);
|
||||
XMLFreeElement(presence);
|
||||
Free(from);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue