mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-10 03:50:38 +03:00
Email notifications can be disabled.
This commit is contained in:
parent
a3804c2c89
commit
f1f3e3b116
@ -838,9 +838,19 @@ void notify(snac *snac, xs_str *type, xs_str *utype, xs_str *actor, xs_dict *msg
|
|||||||
|
|
||||||
/* email */
|
/* email */
|
||||||
|
|
||||||
char *email = xs_dict_get(snac->config, "email");
|
const char *email = "[disabled by admin]";
|
||||||
|
|
||||||
if (!xs_is_null(email) && *email != '\0') {
|
if (xs_type(xs_dict_get(srv_config, "disable_email_notifications")) != XSTYPE_TRUE) {
|
||||||
|
email = xs_dict_get(snac->config_o, "email");
|
||||||
|
if (xs_is_null(email)) {
|
||||||
|
email = xs_dict_get(snac->config, "email");
|
||||||
|
|
||||||
|
if (xs_is_null(email))
|
||||||
|
email = "[empty]";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*email != '[') {
|
||||||
snac_debug(snac, 1, xs_fmt("email notify %s %s %s", type, utype, actor));
|
snac_debug(snac, 1, xs_fmt("email notify %s %s %s", type, utype, actor));
|
||||||
|
|
||||||
xs *subject = xs_fmt("snac notify for @%s@%s",
|
xs *subject = xs_fmt("snac notify for @%s@%s",
|
||||||
|
10
html.c
10
html.c
@ -327,9 +327,17 @@ d_char *html_top_controls(snac *snac, d_char *s)
|
|||||||
"</div>\n"
|
"</div>\n"
|
||||||
"</div>\n";
|
"</div>\n";
|
||||||
|
|
||||||
char *email = xs_dict_get(snac->config, "email");
|
const char *email = "[disabled by admin]";
|
||||||
|
|
||||||
|
if (xs_type(xs_dict_get(srv_config, "disable_email_notifications")) != XSTYPE_TRUE) {
|
||||||
|
email = xs_dict_get(snac->config_o, "email");
|
||||||
|
if (xs_is_null(email)) {
|
||||||
|
email = xs_dict_get(snac->config, "email");
|
||||||
|
|
||||||
if (xs_is_null(email))
|
if (xs_is_null(email))
|
||||||
email = "";
|
email = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char *cw = xs_dict_get(snac->config, "cw");
|
char *cw = xs_dict_get(snac->config, "cw");
|
||||||
if (xs_is_null(cw))
|
if (xs_is_null(cw))
|
||||||
|
Loading…
Reference in New Issue
Block a user