commit 09b926c

default  ·  2023-12-10 16:50:03 +0000 UTC
parent 0e6c5f9
More functions do not require the user argument.
4 files changed,  +8, -8
M data.c
M http.c
M snac.h
+4, -4
 1@@ -323,7 +323,7 @@ int send_to_inbox(snac *snac, const xs_str *inbox, const xs_dict *msg,
 2 }
 3 
 4 
 5-xs_str *get_actor_inbox(snac *snac, const char *actor)
 6+xs_str *get_actor_inbox(const char *actor)
 7 /* gets an actor's inbox */
 8 {
 9     xs *data = NULL;
10@@ -348,7 +348,7 @@ int send_to_actor(snac *snac, const char *actor, const xs_dict *msg,
11 /* sends a message to an actor */
12 {
13     int status = 400;
14-    xs *inbox = get_actor_inbox(snac, actor);
15+    xs *inbox = get_actor_inbox(actor);
16 
17     if (!xs_is_null(inbox))
18         status = send_to_inbox(snac, inbox, msg, payload, p_size, timeout);
19@@ -1518,7 +1518,7 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
20     /* check the signature */
21     xs *sig_err = NULL;
22 
23-    if (!check_signature(snac, req, &sig_err)) {
24+    if (!check_signature(req, &sig_err)) {
25         srv_log(xs_fmt("bad signature %s (%s)", actor, sig_err));
26 
27         srv_archive_error("check_signature", sig_err, req, msg);
28@@ -1818,7 +1818,7 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
29         /* iterate the recipients */
30         p = rcpts;
31         while (xs_list_iter(&p, &actor)) {
32-            xs *inbox = get_actor_inbox(snac, actor);
33+            xs *inbox = get_actor_inbox(actor);
34 
35             if (inbox != NULL) {
36                 /* add to the set and, if it's not there, send message */
M data.c
+1, -1
1@@ -2186,7 +2186,7 @@ void enqueue_output(snac *snac, xs_dict *msg, xs_str *inbox, int retries, int p_
2 void enqueue_output_by_actor(snac *snac, xs_dict *msg, const xs_str *actor, int retries)
3 /* enqueues an output message for an actor */
4 {
5-    xs *inbox = get_actor_inbox(snac, actor);
6+    xs *inbox = get_actor_inbox(actor);
7 
8     if (!xs_is_null(inbox))
9         enqueue_output(snac, msg, inbox, retries, 0);
M http.c
+1, -1
1@@ -120,7 +120,7 @@ xs_dict *http_signed_request(snac *snac, const char *method, const char *url,
2 }
3 
4 
5-int check_signature(snac *user, xs_dict *req, xs_str **err)
6+int check_signature(xs_dict *req, xs_str **err)
7 /* check the signature */
8 {
9     char *sig_hdr = xs_dict_get(req, "signature");
M snac.h
+2, -2
 1@@ -212,7 +212,7 @@ xs_dict *http_signed_request(snac *snac, const char *method, const char *url,
 2                             const char *body, int b_size,
 3                             int *status, xs_str **payload, int *p_size,
 4                             int timeout);
 5-int check_signature(snac *snac, xs_dict *req, xs_str **err);
 6+int check_signature(xs_dict *req, xs_str **err);
 7 
 8 void httpd(void);
 9 
10@@ -249,7 +249,7 @@ int send_to_inbox_raw(const char *keyid, const char *seckey,
11                   xs_val **payload, int *p_size, int timeout);
12 int send_to_inbox(snac *snac, const xs_str *inbox, const xs_dict *msg,
13                   xs_val **payload, int *p_size, int timeout);
14-xs_str *get_actor_inbox(snac *snac, const char *actor);
15+xs_str *get_actor_inbox(const char *actor);
16 int send_to_actor(snac *snac, const char *actor, const xs_dict *msg,
17                   xs_val **payload, int *p_size, int timeout);
18 int is_msg_public(const xs_dict *msg);