mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
Reworked enqueue_message().
This commit is contained in:
parent
274ae3d142
commit
f0ef1d4115
14
data.c
14
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 *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);
|
||||
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);
|
||||
|
||||
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 New Issue
Block a user