commit 0f9a859

default  ·  2024-04-03 06:58:44 +0000 UTC
parent a0429d4
Added some error logging regarding the emojis.json file.
2 files changed,  +9, -2
+2, -2
 1@@ -249,8 +249,8 @@ e.g. :happydoggo:). These images can be served from an external source or from t
 2 .Pa static
 3 directory of the instance admin.
 4 .Pp
 5-If you want to disable any Emoji substitution, leave it as a 0 byte file
 6-or with an empty JSON object ({}).
 7+If you want to disable any Emoji substitution, change the file to contain
 8+just an empty JSON object ({}).
 9 .Ss SPAM Mitigation
10 There have been some SPAM attacks on the Fediverse and, as too many
11 instances and server implementations out there still allow automatic
+7, -0
 1@@ -58,6 +58,8 @@ xs_dict *emojis(void)
 2             xs_json_dump(d, 4, f);
 3             fclose(f);
 4         }
 5+        else
 6+            srv_log(xs_fmt("Error creating '%s'", fn));
 7     }
 8 
 9     xs_dict *d = NULL;
10@@ -65,7 +67,12 @@ xs_dict *emojis(void)
11     if ((f = fopen(fn, "r")) != NULL) {
12         d = xs_json_load(f);
13         fclose(f);
14+
15+        if (d == NULL)
16+            srv_log(xs_fmt("JSON parse error in '%s'", fn));
17     }
18+    else
19+        srv_log(xs_fmt("Error opening '%s'", fn));
20 
21     return d;
22 }