From 5923f50e6daa394495347b7a9b06355c4553cfe2 Mon Sep 17 00:00:00 2001 From: grunfink Date: Wed, 13 May 2026 09:42:45 +0200 Subject: Updated documentation. --- doc/snac.5 | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/snac.5 b/doc/snac.5 index cf6ee0c..948dd82 100644 --- a/doc/snac.5 +++ b/doc/snac.5 @@ -167,6 +167,8 @@ This directory stores hard links to the actor objects in the object storage. This directory stores the users being followed as hard links to the 'Follow' or 'Accept' objects in the object storage. File names are the hashes of each actor Id. +.It Pa pending/ +This directory stores following requests not yet confirmed nor rejected. .It Pa private/ This directory stores hard links to the timeline entries in the object storage. .It Pa private.idx -- cgit From 5182a3384e80462e08713903c14b9cdecf56cdfb Mon Sep 17 00:00:00 2001 From: hanchan Date: Wed, 27 May 2026 17:26:33 +0800 Subject: add keep_replied_posts and keep_replied_me feathers, and auto-mention post author when reply to a post --- data.c | 31 +++++++++++++++++++++++++++++++ doc/snac.8 | 5 +++++ html.c | 21 +++++++++++++++++++++ utils.c | 4 +++- 4 files changed, 60 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/data.c b/data.c index 37c9325..3f7ba29 100644 --- a/data.c +++ b/data.c @@ -1562,6 +1562,37 @@ void timeline_update_indexes(snac *snac, const char *id) else /* also add it to public, it will be discarded later */ object_user_cache_add(snac, id, "public"); + + /* if `keep_replied_posts` is `true` and a local post is a reply to a remote post, add the parent remote post to the public */ + if (xs_is_true(xs_dict_get(srv_config, "keep_replied_posts"))) { + const char *in_reply_to = get_in_reply_to(msg); + + if (xs_is_string(in_reply_to) && *in_reply_to && + !is_msg_mine(snac, in_reply_to)) { + if (object_user_cache_add(snac, in_reply_to, "public") >= 0) { + snac_debug(snac, 1, + xs_fmt("keep_replied_posts: added parent %s to public", in_reply_to)); + } + } + } + } + } + else { + /* if `keep_replied_me` is `true` and a remote post is a reply to one of local posts, add it to public */ + if (xs_is_true(xs_dict_get(srv_config, "keep_replied_me"))) { + xs *msg = NULL; + + if (valid_status(object_get(id, &msg))) { + const char *in_reply_to = get_in_reply_to(msg); + + if (xs_is_string(in_reply_to) && *in_reply_to && + is_msg_mine(snac, in_reply_to)) { + if (object_user_cache_add(snac, id, "public") >= 0) { + snac_debug(snac, 1, + xs_fmt("keep_replied_me: added reply %s to public", id)); + } + } + } } } } diff --git a/doc/snac.8 b/doc/snac.8 index ef93d31..5698ce1 100644 --- a/doc/snac.8 +++ b/doc/snac.8 @@ -327,6 +327,11 @@ Overrides the default "mogrify" command name or path. Use this if the tool is no Overrides the default "ffmpeg" command name or path. Use this if the tool is not in the system PATH or has a different name. .It Ic purge_static If set to true, user static directories are purged; any file stored in these subdirectories (usually images or other media) that is not attached to any post, not used as avatar, header or favicon, and not served as an emoji, is deleted from the filesystem. Don't enable this option if any of your users are serving other files (like, e.g., CSS assets) this way. +.It Ic keep_replied_posts +If set to true, when you reply to a remote post, the parent remote post will be added to local public timeline. +.It Ic keep_replied_me +If set to true, when a remote user replies to one of local posts, the +remote reply will be added to local public timeline. .El .Pp You must restart the server to make effective these changes. diff --git a/html.c b/html.c index ecd7fd7..a553d8c 100644 --- a/html.c +++ b/html.c @@ -2035,6 +2035,27 @@ xs_str *build_mentions(snac *user, const xs_dict *msg) } } + /* also add the author of this post as a mention */ + const char *atto = get_atto(msg); + + if (xs_is_string(atto) && *atto && strcmp(atto, user->actor) != 0) { + /* check if this author is already in the mentions string */ + xs *l = xs_split(atto, "/"); + + if (xs_list_len(l) > 3) { + xs *actor_o = NULL; + if (valid_status(object_get(atto, &actor_o))) { + const char *uname = xs_dict_get(actor_o, "preferredUsername"); + if (!xs_is_null(uname) && *uname) { + xs *handle = xs_fmt("@%s@%s ", uname, xs_list_get(l, 2)); + if (xs_str_in(s, handle) == -1) { + s = xs_str_cat(s, handle); + } + } + } + } + } + if (*s) { xs *s1 = s; s = xs_fmt("\n\n\nCC: %s", s1); diff --git a/utils.c b/utils.c index c36587a..9475bd7 100644 --- a/utils.c +++ b/utils.c @@ -44,7 +44,9 @@ static const char * const default_srv_config = "{" "\"protocol\": \"https\"," "\"fastcgi\": false," "\"disable_inbox_collection\": true," - "\"disable_history\": true" + "\"disable_history\": true," + "\"keep_replied_posts\": false," + "\"keep_replied_me\": false" "}"; static const char * const default_css = -- cgit From 99b2ba2552c53edef56f4e96b95864446dd2bab5 Mon Sep 17 00:00:00 2001 From: grunfink Date: Tue, 2 Jun 2026 10:06:21 +0200 Subject: Updated documentation. --- doc/snac.1 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc') diff --git a/doc/snac.1 b/doc/snac.1 index 87f1760..eddab8d 100644 --- a/doc/snac.1 +++ b/doc/snac.1 @@ -204,6 +204,9 @@ used for scheduled posts. .It Languages you usually post in Fill this string with the ISO 639 Language Codes you expect to write your posts in, space-separated (example: en fr pt_BR). +.It Don't show posts written in these languages +A space-separated string of ISO 639 Language Codes +(example: en fr de). .It Password Write the same string in these two fields to change your password. Don't write anything if you don't want to do this. -- cgit