mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Added some error logging regarding the emojis.json file.
This commit is contained in:
parent
a0429d4699
commit
0f9a859f73
2 changed files with 9 additions and 2 deletions
|
@ -249,8 +249,8 @@ e.g. :happydoggo:). These images can be served from an external source or from t
|
||||||
.Pa static
|
.Pa static
|
||||||
directory of the instance admin.
|
directory of the instance admin.
|
||||||
.Pp
|
.Pp
|
||||||
If you want to disable any Emoji substitution, leave it as a 0 byte file
|
If you want to disable any Emoji substitution, change the file to contain
|
||||||
or with an empty JSON object ({}).
|
just an empty JSON object ({}).
|
||||||
.Ss SPAM Mitigation
|
.Ss SPAM Mitigation
|
||||||
There have been some SPAM attacks on the Fediverse and, as too many
|
There have been some SPAM attacks on the Fediverse and, as too many
|
||||||
instances and server implementations out there still allow automatic
|
instances and server implementations out there still allow automatic
|
||||||
|
|
7
format.c
7
format.c
|
@ -58,6 +58,8 @@ xs_dict *emojis(void)
|
||||||
xs_json_dump(d, 4, f);
|
xs_json_dump(d, 4, f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
srv_log(xs_fmt("Error creating '%s'", fn));
|
||||||
}
|
}
|
||||||
|
|
||||||
xs_dict *d = NULL;
|
xs_dict *d = NULL;
|
||||||
|
@ -65,7 +67,12 @@ xs_dict *emojis(void)
|
||||||
if ((f = fopen(fn, "r")) != NULL) {
|
if ((f = fopen(fn, "r")) != NULL) {
|
||||||
d = xs_json_load(f);
|
d = xs_json_load(f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
|
if (d == NULL)
|
||||||
|
srv_log(xs_fmt("JSON parse error in '%s'", fn));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
srv_log(xs_fmt("Error opening '%s'", fn));
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue