Renamed enqueue() to enqueue_output().

This commit is contained in:
default 2022-09-22 17:12:46 +02:00
parent b5769aca9b
commit b8436ddfde
2 changed files with 5 additions and 4 deletions

6
data.c
View File

@ -600,8 +600,8 @@ 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)
/* enqueues a message for an actor */ /* enqueues an output message for an actor */
{ {
if (strcmp(actor, snac->actor) == 0) { if (strcmp(actor, snac->actor) == 0) {
snac_debug(snac, 1, xs_str_new("enqueue refused to myself")); 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 *rn = xs_number_new(retries);
xs *j; xs *j;
qmsg = xs_dict_append(qmsg, "type", "output");
qmsg = xs_dict_append(qmsg, "actor", actor); qmsg = xs_dict_append(qmsg, "actor", actor);
qmsg = xs_dict_append(qmsg, "object", msg); qmsg = xs_dict_append(qmsg, "object", msg);
qmsg = xs_dict_append(qmsg, "retries", rn); qmsg = xs_dict_append(qmsg, "retries", rn);
@ -643,7 +644,6 @@ d_char *queue(snac *snac)
glob_t globbuf; glob_t globbuf;
time_t t = time(NULL); time_t t = time(NULL);
/* get the list in reverse order */
if (glob(spec, 0, NULL, &globbuf) == 0) { if (glob(spec, 0, NULL, &globbuf) == 0) {
int n; int n;
char *p; char *p;

3
snac.h
View File

@ -61,7 +61,8 @@ void mute(snac *snac, char *actor);
void unmute(snac *snac, char *actor); void unmute(snac *snac, char *actor);
int is_muted(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 *queue(snac *snac);
d_char *dequeue(snac *snac, char *fn); d_char *dequeue(snac *snac, char *fn);