More functions do not require the user argument.

This commit is contained in:
default 2023-12-10 17:50:03 +01:00
parent 0e6c5f9463
commit 09b926c168
4 changed files with 8 additions and 8 deletions

View file

@ -323,7 +323,7 @@ int send_to_inbox(snac *snac, const xs_str *inbox, const xs_dict *msg,
} }
xs_str *get_actor_inbox(snac *snac, const char *actor) xs_str *get_actor_inbox(const char *actor)
/* gets an actor's inbox */ /* gets an actor's inbox */
{ {
xs *data = NULL; xs *data = NULL;
@ -348,7 +348,7 @@ int send_to_actor(snac *snac, const char *actor, const xs_dict *msg,
/* sends a message to an actor */ /* sends a message to an actor */
{ {
int status = 400; int status = 400;
xs *inbox = get_actor_inbox(snac, actor); xs *inbox = get_actor_inbox(actor);
if (!xs_is_null(inbox)) if (!xs_is_null(inbox))
status = send_to_inbox(snac, inbox, msg, payload, p_size, timeout); status = send_to_inbox(snac, inbox, msg, payload, p_size, timeout);
@ -1518,7 +1518,7 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
/* check the signature */ /* check the signature */
xs *sig_err = NULL; xs *sig_err = NULL;
if (!check_signature(snac, req, &sig_err)) { if (!check_signature(req, &sig_err)) {
srv_log(xs_fmt("bad signature %s (%s)", actor, sig_err)); srv_log(xs_fmt("bad signature %s (%s)", actor, sig_err));
srv_archive_error("check_signature", sig_err, req, msg); srv_archive_error("check_signature", sig_err, req, msg);
@ -1818,7 +1818,7 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
/* iterate the recipients */ /* iterate the recipients */
p = rcpts; p = rcpts;
while (xs_list_iter(&p, &actor)) { while (xs_list_iter(&p, &actor)) {
xs *inbox = get_actor_inbox(snac, actor); xs *inbox = get_actor_inbox(actor);
if (inbox != NULL) { if (inbox != NULL) {
/* add to the set and, if it's not there, send message */ /* add to the set and, if it's not there, send message */

2
data.c
View file

@ -2186,7 +2186,7 @@ void enqueue_output(snac *snac, xs_dict *msg, xs_str *inbox, int retries, int p_
void enqueue_output_by_actor(snac *snac, xs_dict *msg, const xs_str *actor, int retries) void enqueue_output_by_actor(snac *snac, xs_dict *msg, const xs_str *actor, int retries)
/* enqueues an output message for an actor */ /* enqueues an output message for an actor */
{ {
xs *inbox = get_actor_inbox(snac, actor); xs *inbox = get_actor_inbox(actor);
if (!xs_is_null(inbox)) if (!xs_is_null(inbox))
enqueue_output(snac, msg, inbox, retries, 0); enqueue_output(snac, msg, inbox, retries, 0);

2
http.c
View file

@ -120,7 +120,7 @@ xs_dict *http_signed_request(snac *snac, const char *method, const char *url,
} }
int check_signature(snac *user, xs_dict *req, xs_str **err) int check_signature(xs_dict *req, xs_str **err)
/* check the signature */ /* check the signature */
{ {
char *sig_hdr = xs_dict_get(req, "signature"); char *sig_hdr = xs_dict_get(req, "signature");

4
snac.h
View file

@ -212,7 +212,7 @@ xs_dict *http_signed_request(snac *snac, const char *method, const char *url,
const char *body, int b_size, const char *body, int b_size,
int *status, xs_str **payload, int *p_size, int *status, xs_str **payload, int *p_size,
int timeout); int timeout);
int check_signature(snac *snac, xs_dict *req, xs_str **err); int check_signature(xs_dict *req, xs_str **err);
void httpd(void); void httpd(void);
@ -249,7 +249,7 @@ int send_to_inbox_raw(const char *keyid, const char *seckey,
xs_val **payload, int *p_size, int timeout); xs_val **payload, int *p_size, int timeout);
int send_to_inbox(snac *snac, const xs_str *inbox, const xs_dict *msg, int send_to_inbox(snac *snac, const xs_str *inbox, const xs_dict *msg,
xs_val **payload, int *p_size, int timeout); xs_val **payload, int *p_size, int timeout);
xs_str *get_actor_inbox(snac *snac, const char *actor); xs_str *get_actor_inbox(const char *actor);
int send_to_actor(snac *snac, const char *actor, const xs_dict *msg, int send_to_actor(snac *snac, const char *actor, const xs_dict *msg,
xs_val **payload, int *p_size, int timeout); xs_val **payload, int *p_size, int timeout);
int is_msg_public(const xs_dict *msg); int is_msg_public(const xs_dict *msg);