summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorGravatar default2023-02-20 06:00:54 +0100
committerGravatar default2023-02-20 06:00:54 +0100
commitf1f3e3b11631f0075597ff93f7b4775f3403d48e (patch)
tree2a0056e29117affe8bbe052fb732bb687b936970 /activitypub.c
parentVersion 2.23 RELEASED. (diff)
downloadsnac2-f1f3e3b11631f0075597ff93f7b4775f3403d48e.tar.gz
snac2-f1f3e3b11631f0075597ff93f7b4775f3403d48e.tar.xz
snac2-f1f3e3b11631f0075597ff93f7b4775f3403d48e.zip
Email notifications can be disabled.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/activitypub.c b/activitypub.c
index 02a89d6..4db08ab 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -838,9 +838,19 @@ void notify(snac *snac, xs_str *type, xs_str *utype, xs_str *actor, xs_dict *msg
838 838
839 /* email */ 839 /* email */
840 840
841 char *email = xs_dict_get(snac->config, "email"); 841 const char *email = "[disabled by admin]";
842 842
843 if (!xs_is_null(email) && *email != '\0') { 843 if (xs_type(xs_dict_get(srv_config, "disable_email_notifications")) != XSTYPE_TRUE) {
844 email = xs_dict_get(snac->config_o, "email");
845 if (xs_is_null(email)) {
846 email = xs_dict_get(snac->config, "email");
847
848 if (xs_is_null(email))
849 email = "[empty]";
850 }
851 }
852
853 if (*email != '[') {
844 snac_debug(snac, 1, xs_fmt("email notify %s %s %s", type, utype, actor)); 854 snac_debug(snac, 1, xs_fmt("email notify %s %s %s", type, utype, actor));
845 855
846 xs *subject = xs_fmt("snac notify for @%s@%s", 856 xs *subject = xs_fmt("snac notify for @%s@%s",