mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-26 01:03:37 +00:00
More functions do not require the user argument.
This commit is contained in:
parent
0e6c5f9463
commit
09b926c168
4 changed files with 8 additions and 8 deletions
|
@ -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 */
|
||||
{
|
||||
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 */
|
||||
{
|
||||
int status = 400;
|
||||
xs *inbox = get_actor_inbox(snac, actor);
|
||||
xs *inbox = get_actor_inbox(actor);
|
||||
|
||||
if (!xs_is_null(inbox))
|
||||
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 */
|
||||
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_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 */
|
||||
p = rcpts;
|
||||
while (xs_list_iter(&p, &actor)) {
|
||||
xs *inbox = get_actor_inbox(snac, actor);
|
||||
xs *inbox = get_actor_inbox(actor);
|
||||
|
||||
if (inbox != NULL) {
|
||||
/* add to the set and, if it's not there, send message */
|
||||
|
|
2
data.c
2
data.c
|
@ -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)
|
||||
/* 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))
|
||||
enqueue_output(snac, msg, inbox, retries, 0);
|
||||
|
|
2
http.c
2
http.c
|
@ -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 */
|
||||
{
|
||||
char *sig_hdr = xs_dict_get(req, "signature");
|
||||
|
|
4
snac.h
4
snac.h
|
@ -212,7 +212,7 @@ xs_dict *http_signed_request(snac *snac, const char *method, const char *url,
|
|||
const char *body, int b_size,
|
||||
int *status, xs_str **payload, int *p_size,
|
||||
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);
|
||||
|
||||
|
@ -249,7 +249,7 @@ int send_to_inbox_raw(const char *keyid, const char *seckey,
|
|||
xs_val **payload, int *p_size, int timeout);
|
||||
int send_to_inbox(snac *snac, const xs_str *inbox, const xs_dict *msg,
|
||||
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,
|
||||
xs_val **payload, int *p_size, int timeout);
|
||||
int is_msg_public(const xs_dict *msg);
|
||||
|
|
Loading…
Reference in a new issue