[MOD/WIP] Externalise and add errors to commands

Still need forms...
This commit is contained in:
LDA 2024-07-13 22:34:51 +02:00
commit a880769c48
9 changed files with 311 additions and 89 deletions

View file

@ -108,13 +108,13 @@ XMPPCommandRequiresForm(XMPPCommand *cmd)
return cmd ? !!cmd->options : false;
}
void
XMPPExecuteCommand(XMPPCommandManager *m, XMPPCommand *cmd, XMLElement *to, HashMap *arg_table)
XMPPExecuteCommand(XMPPCommandManager *m, XMPPCommand *cmd, char *from, XMLElement *to, HashMap *arg_table)
{
if (!m || !cmd || !to)
if (!m || !cmd || !from || !to)
{
return;
}
cmd->callback(m, arg_table, to);
cmd->callback(m, from, arg_table, to);
/* TODO Free arg_table's strings */
HashMapFree(arg_table);