diff --git a/data.c b/data.c index 66dcda3..c5f68de 100644 --- a/data.c +++ b/data.c @@ -600,8 +600,8 @@ int is_muted(snac *snac, char *actor) } -void enqueue(snac *snac, char *actor, char *msg, int retries) -/* enqueues a message for an actor */ +void enqueue_output(snac *snac, char *actor, char *msg, int retries) +/* enqueues an output message for an actor */ { if (strcmp(actor, snac->actor) == 0) { snac_debug(snac, 1, xs_str_new("enqueue refused to myself")); @@ -619,6 +619,7 @@ void enqueue(snac *snac, char *actor, char *msg, int retries) xs *rn = xs_number_new(retries); xs *j; + qmsg = xs_dict_append(qmsg, "type", "output"); qmsg = xs_dict_append(qmsg, "actor", actor); qmsg = xs_dict_append(qmsg, "object", msg); qmsg = xs_dict_append(qmsg, "retries", rn); @@ -643,7 +644,6 @@ d_char *queue(snac *snac) glob_t globbuf; time_t t = time(NULL); - /* get the list in reverse order */ if (glob(spec, 0, NULL, &globbuf) == 0) { int n; char *p; diff --git a/snac.h b/snac.h index d2cb9c3..ac22842 100644 --- a/snac.h +++ b/snac.h @@ -61,7 +61,8 @@ void mute(snac *snac, char *actor); void unmute(snac *snac, char *actor); int is_muted(snac *snac, char *actor); -void enqueue(snac *snac, char *actor, char *msg, int retries); +void enqueue_output(snac *snac, char *actor, char *msg, int retries); + d_char *queue(snac *snac); d_char *dequeue(snac *snac, char *fn);