diff options
| author | 2025-05-30 19:34:11 +0200 | |
|---|---|---|
| committer | 2025-05-30 19:34:11 +0200 | |
| commit | f055c8b694a398868d14fd70df61d02429846dae (patch) | |
| tree | ed4cddbe23462d75fe05f7d0dcd3f2d5daf8961f | |
| parent | Updated documentation. (diff) | |
| download | penes-snac2-f055c8b694a398868d14fd70df61d02429846dae.tar.gz penes-snac2-f055c8b694a398868d14fd70df61d02429846dae.tar.xz penes-snac2-f055c8b694a398868d14fd70df61d02429846dae.zip | |
Added a new server knob disable_notify_webhook.
| -rw-r--r-- | activitypub.c | 2 | ||||
| -rw-r--r-- | data.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/activitypub.c b/activitypub.c index fb0c42c..ab63abe 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -2769,7 +2769,7 @@ void process_user_queue_item(snac *user, xs_dict *q_item) | |||
| 2769 | if (strcmp(type, "notify_webhook") == 0) { | 2769 | if (strcmp(type, "notify_webhook") == 0) { |
| 2770 | const char *webhook = xs_dict_get(user->config, "notify_webhook"); | 2770 | const char *webhook = xs_dict_get(user->config, "notify_webhook"); |
| 2771 | 2771 | ||
| 2772 | if (xs_is_string(webhook)) { | 2772 | if (xs_is_string(webhook) && *webhook) { |
| 2773 | const xs_dict *msg = xs_dict_get(q_item, "message"); | 2773 | const xs_dict *msg = xs_dict_get(q_item, "message"); |
| 2774 | int retries = xs_number_get(xs_dict_get(q_item, "retries")); | 2774 | int retries = xs_number_get(xs_dict_get(q_item, "retries")); |
| 2775 | 2775 | ||
| @@ -3167,7 +3167,8 @@ void notify_add(snac *snac, const char *type, const char *utype, | |||
| 3167 | pthread_mutex_unlock(&data_mutex); | 3167 | pthread_mutex_unlock(&data_mutex); |
| 3168 | } | 3168 | } |
| 3169 | 3169 | ||
| 3170 | enqueue_notify_webhook(snac, noti, 0); | 3170 | if (!xs_is_true(xs_dict_get(srv_config, "disable_notify_webhook"))) |
| 3171 | enqueue_notify_webhook(snac, noti, 0); | ||
| 3171 | } | 3172 | } |
| 3172 | 3173 | ||
| 3173 | 3174 | ||
| @@ -3528,7 +3529,7 @@ void enqueue_notify_webhook(snac *user, const xs_dict *noti, int retries) | |||
| 3528 | { | 3529 | { |
| 3529 | const char *webhook = xs_dict_get(user->config, "notify_webhook"); | 3530 | const char *webhook = xs_dict_get(user->config, "notify_webhook"); |
| 3530 | 3531 | ||
| 3531 | if (xs_is_string(webhook)) { | 3532 | if (xs_is_string(webhook) && *webhook) { |
| 3532 | xs *msg = xs_dup(noti); | 3533 | xs *msg = xs_dup(noti); |
| 3533 | 3534 | ||
| 3534 | /* add more data */ | 3535 | /* add more data */ |