mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 16:55:10 +00:00
[MOD/WIP] Try doing fallbacks
This commit is contained in:
parent
fe77906cde
commit
cc85859cca
5 changed files with 56 additions and 2 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <Cytoplasm/Str.h>
|
||||
#include <Cytoplasm/Log.h>
|
||||
|
||||
#include <Parsee.h>
|
||||
#include <XML.h>
|
||||
|
||||
void
|
||||
|
|
@ -52,11 +53,27 @@ XMPPSendPlain(XMPPComponent *comp, char *fr, char *to, char *msg, char *type, ch
|
|||
|
||||
if (rst && rse)
|
||||
{
|
||||
int off = ParseeFindDatastart(msg);
|
||||
char *ostr = StrInt(off);
|
||||
XMLElement *reply = XMLCreateTag("reply");
|
||||
XMLElement *fallback = XMLCreateTag("fallback");
|
||||
XMLElement *fall_body = XMLCreateTag("body");
|
||||
|
||||
XMLAddAttr(reply, "to", rse);
|
||||
XMLAddAttr(reply, "id", rst);
|
||||
XMLAddAttr(reply, "xmlns", "urn:xmpp:reply:0");
|
||||
|
||||
XMLAddAttr(fallback, "xmlns", "urn:xmpp:feature-fallback:0");
|
||||
XMLAddAttr(fallback, "for", "urn:xmpp:reply:0");
|
||||
|
||||
XMLAddAttr(fall_body, "start", "0");
|
||||
XMLAddAttr(fall_body, "end", ostr);
|
||||
XMLAddChild(fallback, fall_body);
|
||||
|
||||
XMLAddChild(message, reply);
|
||||
XMLAddChild(message, fallback);
|
||||
|
||||
Free(ostr);
|
||||
}
|
||||
|
||||
XMLAddChild(message, body);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue