commit 944bd60

default  ·  2023-02-07 12:34:26 +0000 UTC
parent 4cca157
Deleted old output message processing in user queue.
1 files changed,  +0, -36
+0, -36
 1@@ -1108,42 +1108,6 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
 2         }
 3     }
 4     else
 5-    if (strcmp(type, "output") == 0) {
 6-        int status;
 7-        xs_str *inbox  = xs_dict_get(q_item, "inbox");
 8-        xs_str *keyid  = xs_dict_get(q_item, "keyid");
 9-        xs_str *seckey = xs_dict_get(q_item, "seckey");
10-        xs_dict *msg   = xs_dict_get(q_item, "message");
11-        int retries    = xs_number_get(xs_dict_get(q_item, "retries"));
12-        xs *payload    = NULL;
13-        int p_size     = 0;
14-
15-        if (xs_is_null(inbox) || xs_is_null(msg) || xs_is_null(keyid) || xs_is_null(seckey)) {
16-            srv_log(xs_fmt("incomplete output message"));
17-            return;
18-        }
19-
20-        /* deliver */
21-        status = send_to_inbox_raw(keyid, seckey, inbox, msg, &payload, &p_size, retries == 0 ? 3 : 8);
22-
23-        snac_log(snac, xs_fmt("output sent to inbox %s %d", inbox, status));
24-
25-        if (!valid_status(status)) {
26-            /* error sending; requeue? */
27-            if (status == 404 || status == 410)
28-                /* explicit error: discard */
29-                snac_log(snac, xs_fmt("output error %s %d", inbox, status));
30-            else
31-            if (retries > queue_retry_max)
32-                snac_log(snac, xs_fmt("output giving up %s %d", inbox, status));
33-            else {
34-                /* requeue */
35-                enqueue_output(snac, msg, inbox, retries + 1);
36-                snac_log(snac, xs_fmt("output requeue %s #%d", inbox, retries + 1));
37-            }
38-        }
39-    }
40-    else
41     if (strcmp(type, "input") == 0) {
42         /* process the message */
43         xs_dict *msg = xs_dict_get(q_item, "message");