summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'data.c')
-rw-r--r--data.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/data.c b/data.c
index 3b22114..cf4d39b 100644
--- a/data.c
+++ b/data.c
@@ -2041,13 +2041,16 @@ void enqueue_input(snac *snac, const xs_dict *msg, const xs_dict *req, int retri
2041 2041
2042 2042
2043void enqueue_output_raw(const char *keyid, const char *seckey, 2043void enqueue_output_raw(const char *keyid, const char *seckey,
2044 xs_dict *msg, xs_str *inbox, int retries) 2044 xs_dict *msg, xs_str *inbox, int retries, int p_status)
2045/* enqueues an output message to an inbox */ 2045/* enqueues an output message to an inbox */
2046{ 2046{
2047 xs *qmsg = _new_qmsg("output", msg, retries); 2047 xs *qmsg = _new_qmsg("output", msg, retries);
2048 char *ntid = xs_dict_get(qmsg, "ntid"); 2048 char *ntid = xs_dict_get(qmsg, "ntid");
2049 xs *fn = xs_fmt("%s/queue/%s.json", srv_basedir, ntid); 2049 xs *fn = xs_fmt("%s/queue/%s.json", srv_basedir, ntid);
2050 2050
2051 xs *ns = xs_number_new(p_status);
2052 qmsg = xs_dict_append(qmsg, "p_status", ns);
2053
2051 qmsg = xs_dict_append(qmsg, "inbox", inbox); 2054 qmsg = xs_dict_append(qmsg, "inbox", inbox);
2052 qmsg = xs_dict_append(qmsg, "keyid", keyid); 2055 qmsg = xs_dict_append(qmsg, "keyid", keyid);
2053 qmsg = xs_dict_append(qmsg, "seckey", seckey); 2056 qmsg = xs_dict_append(qmsg, "seckey", seckey);
@@ -2062,7 +2065,7 @@ void enqueue_output_raw(const char *keyid, const char *seckey,
2062} 2065}
2063 2066
2064 2067
2065void enqueue_output(snac *snac, xs_dict *msg, xs_str *inbox, int retries) 2068void enqueue_output(snac *snac, xs_dict *msg, xs_str *inbox, int retries, int p_status)
2066/* enqueues an output message to an inbox */ 2069/* enqueues an output message to an inbox */
2067{ 2070{
2068 if (xs_startswith(inbox, snac->actor)) { 2071 if (xs_startswith(inbox, snac->actor)) {
@@ -2072,7 +2075,7 @@ void enqueue_output(snac *snac, xs_dict *msg, xs_str *inbox, int retries)
2072 2075
2073 char *seckey = xs_dict_get(snac->key, "secret"); 2076 char *seckey = xs_dict_get(snac->key, "secret");
2074 2077
2075 enqueue_output_raw(snac->actor, seckey, msg, inbox, retries); 2078 enqueue_output_raw(snac->actor, seckey, msg, inbox, retries, p_status);
2076} 2079}
2077 2080
2078 2081
@@ -2082,7 +2085,7 @@ void enqueue_output_by_actor(snac *snac, xs_dict *msg, const xs_str *actor, int
2082 xs *inbox = get_actor_inbox(snac, actor); 2085 xs *inbox = get_actor_inbox(snac, actor);
2083 2086
2084 if (!xs_is_null(inbox)) 2087 if (!xs_is_null(inbox))
2085 enqueue_output(snac, msg, inbox, retries); 2088 enqueue_output(snac, msg, inbox, retries, 0);
2086 else 2089 else
2087 snac_log(snac, xs_fmt("enqueue_output_by_actor cannot get inbox %s", actor)); 2090 snac_log(snac, xs_fmt("enqueue_output_by_actor cannot get inbox %s", actor));
2088} 2091}