diff options
| -rw-r--r-- | activitypub.c | 14 | ||||
| -rw-r--r-- | html.c | 14 |
2 files changed, 23 insertions, 5 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", |
| @@ -327,9 +327,17 @@ d_char *html_top_controls(snac *snac, d_char *s) | |||
| 327 | "</div>\n" | 327 | "</div>\n" |
| 328 | "</div>\n"; | 328 | "</div>\n"; |
| 329 | 329 | ||
| 330 | char *email = xs_dict_get(snac->config, "email"); | 330 | const char *email = "[disabled by admin]"; |
| 331 | if (xs_is_null(email)) | 331 | |
| 332 | email = ""; | 332 | if (xs_type(xs_dict_get(srv_config, "disable_email_notifications")) != XSTYPE_TRUE) { |
| 333 | email = xs_dict_get(snac->config_o, "email"); | ||
| 334 | if (xs_is_null(email)) { | ||
| 335 | email = xs_dict_get(snac->config, "email"); | ||
| 336 | |||
| 337 | if (xs_is_null(email)) | ||
| 338 | email = ""; | ||
| 339 | } | ||
| 340 | } | ||
| 333 | 341 | ||
| 334 | char *cw = xs_dict_get(snac->config, "cw"); | 342 | char *cw = xs_dict_get(snac->config, "cw"); |
| 335 | if (xs_is_null(cw)) | 343 | if (xs_is_null(cw)) |