From 85ed0eb0d535700a5df837c37f51848811e461a0 Mon Sep 17 00:00:00 2001 From: violette Date: Thu, 18 Dec 2025 07:58:24 +0100 Subject: Added emoji reactions (contributed by violette). --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 6915bd0..4b0463e 100644 --- a/main.c +++ b/main.c @@ -498,7 +498,7 @@ int main(int argc, char *argv[]) if (msg != NULL) { enqueue_message(&snac, msg); - timeline_admire(&snac, xs_dict_get(msg, "object"), snac.actor, 0); + timeline_admire(&snac, xs_dict_get(msg, "object"), snac.actor, 0, ""); if (dbglevel) { xs_json_dump(msg, 4, stdout); -- cgit v1.2.3 From 11af00194e3e0ec15e17a23556dc2929f92e0210 Mon Sep 17 00:00:00 2001 From: grunfink Date: Thu, 1 Jan 2026 17:01:03 +0100 Subject: Bumped copyright year. --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 4b0463e..29a8a51 100644 --- a/main.c +++ b/main.c @@ -1,5 +1,5 @@ /* snac - A simple, minimalistic ActivityPub instance */ -/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ +/* copyright (c) 2022 - 2026 grunfink et al. / MIT license */ #include "xs.h" #include "xs_io.h" @@ -18,7 +18,7 @@ int usage(const char *cmd) { printf("snac " VERSION " - A simple, minimalistic ActivityPub instance\n"); - printf("Copyright (c) 2022 - 2025 grunfink et al. / MIT license\n"); + printf("Copyright (c) 2022 - 2026 grunfink et al. / MIT license\n"); printf("\n"); if (cmd == NULL) { -- cgit v1.2.3 From 99375a7b664750c1288558f1d5c02b833a2e083c Mon Sep 17 00:00:00 2001 From: grunfink Date: Sat, 10 Jan 2026 21:29:32 +0100 Subject: New command-line option top_ten. --- main.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 29a8a51..4ba9796 100644 --- a/main.c +++ b/main.c @@ -76,7 +76,8 @@ int usage(const char *cmd) "list_create {basedir} {uid} {name} Creates a new list\n" "list_remove {basedir} {uid} {name} Removes an existing list\n" "list_add {basedir} {uid} {name} {acct} Adds an account (@user@host or actor url) to a list\n" - "list_del {basedir} {uid} {name} {actor} Deletes an actor URL from a list\n"; + "list_del {basedir} {uid} {name} {actor} Deletes an actor URL from a list\n" + "top_ten {basedir} {uid} [{N}] Prints the most popular posts\n"; if (cmd == NULL) printf("%s", cmds); @@ -350,6 +351,24 @@ int main(int argc, char *argv[]) return 0; } + if (strcmp(cmd, "top_ten") == 0) { /** **/ + int count = 10; + const char *n = GET_ARGV(); + if (xs_is_string(n)) + count = atoi(n); + + xs *l = user_top_ten(&snac, count); + const xs_list *i; + + xs_list_foreach(l, i) { + printf("%s %ld★ %ld↺\n", xs_list_get(i, 0), + xs_number_get_l(xs_list_get(i, 1)), + xs_number_get_l(xs_list_get(i, 2))); + } + + return 0; + } + if ((url = GET_ARGV()) == NULL) return usage(cmd); -- cgit v1.2.3 From d8d40acfd17dfe28654f7acfac648a896033b63b Mon Sep 17 00:00:00 2001 From: grunfink Date: Mon, 19 Jan 2026 15:53:19 +0100 Subject: New command-line option 'refresh'. --- main.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 4ba9796..e7d5b0d 100644 --- a/main.c +++ b/main.c @@ -77,7 +77,8 @@ int usage(const char *cmd) "list_remove {basedir} {uid} {name} Removes an existing list\n" "list_add {basedir} {uid} {name} {acct} Adds an account (@user@host or actor url) to a list\n" "list_del {basedir} {uid} {name} {actor} Deletes an actor URL from a list\n" - "top_ten {basedir} {uid} [{N}] Prints the most popular posts\n"; + "top_ten {basedir} {uid} [{N}] Prints the most popular posts\n" + "refresh {basedir} {uid} Refreshes all actors\n"; if (cmd == NULL) printf("%s", cmds); @@ -369,6 +370,20 @@ int main(int argc, char *argv[]) return 0; } + if (strcmp(cmd, "refresh") == 0) { /** **/ + xs *fwers = follower_list(&snac); + xs *fwing = following_list(&snac); + const char *id; + + xs_list_foreach(fwers, id) + enqueue_actor_refresh(&snac, id, 0); + + xs_list_foreach(fwing, id) + enqueue_actor_refresh(&snac, id, 0); + + return 0; + } + if ((url = GET_ARGV()) == NULL) return usage(cmd); -- cgit v1.2.3