[ADD/WIP] Start unifying DMs and MUCs

I really need to dispatch XMPP stanza management.
This commit is contained in:
LDA 2024-07-03 14:40:26 +02:00
commit 5f2c3a9cb8
10 changed files with 570 additions and 87 deletions

View file

@ -2,6 +2,7 @@
#include <AS.h>
#include <Cytoplasm/Log.h>
#include <stdlib.h>
CommandHead(CmdSetPL, cmd, argp)
@ -26,3 +27,25 @@ CommandHead(CmdSetPL, cmd, argp)
));
ASSetPL(data->config, room, map);
}
CommandHead(CmdSetMin, cmd, argp)
{
ParseeCmdArg *args = argp;
ParseeData *data = args->data;
char *event = HashMapGet(cmd->arguments, "event");
char *room = HashMapGet(cmd->arguments, "room");
char *pl_str = HashMapGet(cmd->arguments, "pl");
long pl = strtol(pl_str, NULL, 10);
HashMap *map;
if (!event || !pl_str)
{
return;
}
map = ASGetPL(data->config, room);
JsonValueFree(JsonSet(
map, JsonValueInteger(pl),
2, "events", event
));
ASSetPL(data->config, room, map);
}