mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-14 17:45:04 +00:00
Reworked enqueue_message().
This commit is contained in:
parent
274ae3d142
commit
f0ef1d4115
1 changed files with 5 additions and 9 deletions
12
data.c
12
data.c
|
@ -1396,20 +1396,16 @@ void enqueue_email(snac *snac, xs_str *msg, int retries)
|
|||
}
|
||||
|
||||
|
||||
void enqueue_message(snac *snac, char *msg)
|
||||
void enqueue_message(snac *snac, xs_dict *msg)
|
||||
/* enqueues an output message */
|
||||
{
|
||||
char *id = xs_dict_get(msg, "id");
|
||||
xs *ntid = tid(0);
|
||||
xs *qmsg = _new_qmsg("message", msg, 0);
|
||||
char *ntid = xs_dict_get(qmsg, "ntid");
|
||||
xs *fn = xs_fmt("%s/queue/%s.json", snac->basedir, ntid);
|
||||
xs *qmsg = xs_dict_new();
|
||||
|
||||
qmsg = xs_dict_append(qmsg, "type", "message");
|
||||
qmsg = xs_dict_append(qmsg, "message", msg);
|
||||
|
||||
qmsg = _enqueue_put(fn, qmsg);
|
||||
|
||||
snac_debug(snac, 0, xs_fmt("enqueue_message %s", id));
|
||||
snac_debug(snac, 0, xs_fmt("enqueue_message %s", xs_dict_get(msg, "id")));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue