[ADD/MOD] Cleanup cmd, change Matrix user format

This commit is contained in:
LDA 2024-07-14 20:00:41 +02:00
commit 91d373addb
13 changed files with 217 additions and 77 deletions

View file

@ -252,7 +252,7 @@ XMPPManageCommand(XMPPCommandManager *m, XMLElement *stanza, ParseeData *data)
{
XMLElement *actions = XMLCreateTag("actions");
XMLElement *completed = XMLCreateTag("complete");
XMLElement *x = XMLCreateTag("x");
XMLElement *x;
XMLAddChild(actions, completed);
session_id = XMPPRegisterSession(m, to, from, node);
@ -271,9 +271,7 @@ XMPPManageCommand(XMPPCommandManager *m, XMLElement *stanza, ParseeData *data)
XMLAddChild(command_xml, actions);
XMLAddChild(iq, command_xml);
XMLAddAttr(x, "xmlns", "jabber:x:data");
XMLAddAttr(x, "type", "form");
XMPPShoveOptions(cmd, x);
x = XMPPFormifyCommand(cmd);
XMLAddChild(command_xml, x);
pthread_mutex_lock(&jabber->write_lock);
@ -286,6 +284,11 @@ XMPPManageCommand(XMPPCommandManager *m, XMLElement *stanza, ParseeData *data)
}
/* Doesn't need to be freed, as it lives with m. */
/* TODO: I've noticed memory leakages around here with a
* StrDuplicate'd session ID. I think StrDuplicate should
* just "rat out" the original source in cases of leaks
* like this, maybe with extra data beyond the NULL-terminator */
session_id = XMPPRegisterSession(m, to, from, node);
/* No forms, we good. */