commit 44d126e

default  ·  2024-04-17 06:09:05 +0000 UTC
parent 2e31253
Improved non-public reply check.
1 files changed,  +4, -2
M html.c
M html.c
+4, -2
 1@@ -2054,11 +2054,13 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
 2         if (user != NULL && !is_msg_public(msg)) {
 3             char *irt = xs_dict_get(msg, "inReplyTo");
 4 
 5+            /* is it a reply to something not in the storage? */
 6             if (!xs_is_null(irt) && !object_here(irt)) {
 7                 /* is it for me? */
 8-                xs_list *to = xs_dict_get(msg, "to");
 9+                xs_list *to = xs_dict_get_def(msg, "to", xs_stock(XSTYPE_LIST));
10+                xs_list *cc = xs_dict_get_def(msg, "cc", xs_stock(XSTYPE_LIST));
11 
12-                if (xs_type(to) == XSTYPE_LIST && xs_list_in(to, user->actor) == -1) {
13+                if (xs_list_in(to, user->actor) == -1 && xs_list_in(cc, user->actor) == -1) {
14                     snac_debug(user, 1, xs_fmt("skipping non-public reply to an unknown post %s", v));
15                     continue;
16                 }