summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2024-04-03 08:58:44 +0200
committerGravatar default2024-04-03 08:58:44 +0200
commit0f9a859f734e55ec2f853cf910c0a429ef4c77dd (patch)
tree2e4542e55b1da8513f131db27c6cc1c898ec5ac7
parentUpdated RELEASE_NOTES. (diff)
downloadpenes-snac2-0f9a859f734e55ec2f853cf910c0a429ef4c77dd.tar.gz
penes-snac2-0f9a859f734e55ec2f853cf910c0a429ef4c77dd.tar.xz
penes-snac2-0f9a859f734e55ec2f853cf910c0a429ef4c77dd.zip
Added some error logging regarding the emojis.json file.
-rw-r--r--doc/snac.84
-rw-r--r--format.c7
2 files changed, 9 insertions, 2 deletions
diff --git a/doc/snac.8 b/doc/snac.8
index b96899e..73b041a 100644
--- a/doc/snac.8
+++ b/doc/snac.8
@@ -249,8 +249,8 @@ e.g. :happydoggo:). These images can be served from an external source or from t
249.Pa static 249.Pa static
250directory of the instance admin. 250directory of the instance admin.
251.Pp 251.Pp
252If you want to disable any Emoji substitution, leave it as a 0 byte file 252If you want to disable any Emoji substitution, change the file to contain
253or with an empty JSON object ({}). 253just an empty JSON object ({}).
254.Ss SPAM Mitigation 254.Ss SPAM Mitigation
255There have been some SPAM attacks on the Fediverse and, as too many 255There have been some SPAM attacks on the Fediverse and, as too many
256instances and server implementations out there still allow automatic 256instances and server implementations out there still allow automatic
diff --git a/format.c b/format.c
index f89fe21..92901bb 100644
--- a/format.c
+++ b/format.c
@@ -58,6 +58,8 @@ xs_dict *emojis(void)
58 xs_json_dump(d, 4, f); 58 xs_json_dump(d, 4, f);
59 fclose(f); 59 fclose(f);
60 } 60 }
61 else
62 srv_log(xs_fmt("Error creating '%s'", fn));
61 } 63 }
62 64
63 xs_dict *d = NULL; 65 xs_dict *d = NULL;
@@ -65,7 +67,12 @@ xs_dict *emojis(void)
65 if ((f = fopen(fn, "r")) != NULL) { 67 if ((f = fopen(fn, "r")) != NULL) {
66 d = xs_json_load(f); 68 d = xs_json_load(f);
67 fclose(f); 69 fclose(f);
70
71 if (d == NULL)
72 srv_log(xs_fmt("JSON parse error in '%s'", fn));
68 } 73 }
74 else
75 srv_log(xs_fmt("Error opening '%s'", fn));
69 76
70 return d; 77 return d;
71} 78}