snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 44d126e0f96748f7f5e0c8a95ed8b3f5f69cd0f0
parent 2e31253ba8de74e073fd104785bde78510c843c1
Author: default <nobody@localhost>
Date:   Wed, 17 Apr 2024 08:09:05 +0200

Improved non-public reply check.

Diffstat:
Mhtml.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/html.c b/html.c @@ -2054,11 +2054,13 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only, if (user != NULL && !is_msg_public(msg)) { char *irt = xs_dict_get(msg, "inReplyTo"); + /* is it a reply to something not in the storage? */ if (!xs_is_null(irt) && !object_here(irt)) { /* is it for me? */ - xs_list *to = xs_dict_get(msg, "to"); + xs_list *to = xs_dict_get_def(msg, "to", xs_stock(XSTYPE_LIST)); + xs_list *cc = xs_dict_get_def(msg, "cc", xs_stock(XSTYPE_LIST)); - if (xs_type(to) == XSTYPE_LIST && xs_list_in(to, user->actor) == -1) { + if (xs_list_in(to, user->actor) == -1 && xs_list_in(cc, user->actor) == -1) { snac_debug(user, 1, xs_fmt("skipping non-public reply to an unknown post %s", v)); continue; }