summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RELEASE_NOTES.md10
-rw-r--r--TODO.md16
-rw-r--r--data.c7
-rw-r--r--html.c9
-rw-r--r--mastoapi.c19
5 files changed, 48 insertions, 13 deletions
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index a8f04e8..3463b38 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,6 +1,12 @@
1# Release Notes 1# Release Notes
2 2
3## 2.74 3## UNRELEASED
4
5Mastodon API: added support for `/api/v1/instance/peers`.
6
7Some Czech and Russian translation fixes.
8
9## 2.74 "The Days of Nicole, the Fediverse Chick"
4 10
5Added Spanish (default, Argentina and Uruguay) translation (contributed by gnemmi). 11Added Spanish (default, Argentina and Uruguay) translation (contributed by gnemmi).
6 12
@@ -22,7 +28,7 @@ Added Greek translation (contributed by uhuru).
22 28
23Added Italian translation (contributed by anzu). 29Added Italian translation (contributed by anzu).
24 30
25Mastodon API: added support for /api/v1/custom_emojis (contributed by violette). 31Mastodon API: added support for `/api/v1/custom_emojis` (contributed by violette).
26 32
27Improved Undo+Follow logic (contributed by rozenglass). 33Improved Undo+Follow logic (contributed by rozenglass).
28 34
diff --git a/TODO.md b/TODO.md
index bdb860c..baa910a 100644
--- a/TODO.md
+++ b/TODO.md
@@ -6,16 +6,12 @@ Investigate the problem with boosts inside the same instance (see https://codebe
6 6
7Editing / Updating a post does not index newly added hashtags. 7Editing / Updating a post does not index newly added hashtags.
8 8
9Wrong level of message visibility when using the Mastodon API: https://codeberg.org/grunfink/snac2/issues/200#issuecomment-2351042
10
11Unfollowing guppe groups seems to work (http status of 200), but messages continue to arrive as if it didn't. 9Unfollowing guppe groups seems to work (http status of 200), but messages continue to arrive as if it didn't.
12 10
13Important: deleting a follower should do more that just delete the object, see https://codeberg.org/grunfink/snac2/issues/43#issuecomment-956721 11Important: deleting a follower should do more that just delete the object, see https://codeberg.org/grunfink/snac2/issues/43#issuecomment-956721
14 12
15## Wishlist 13## Wishlist
16 14
17Each notification should show a link to the full thread, to see it in context.
18
19The instance timeline should also show boosts from users. 15The instance timeline should also show boosts from users.
20 16
21Mastoapi: implement /v1/conversations. 17Mastoapi: implement /v1/conversations.
@@ -30,14 +26,10 @@ Integrate "Added handling for International Domain Names" PR https://codeberg.or
30 26
31Do something about Akkoma and Misskey's quoted replies (they use the `quoteUrl` field instead of `inReplyTo`). 27Do something about Akkoma and Misskey's quoted replies (they use the `quoteUrl` field instead of `inReplyTo`).
32 28
33Add a list of hashtags to drop.
34
35Take a look at crashes in the brittle Mastodon official app (crashes when hitting the reply button, crashes or 'ownVotes is null' errors when trying to show polls). 29Take a look at crashes in the brittle Mastodon official app (crashes when hitting the reply button, crashes or 'ownVotes is null' errors when trying to show polls).
36 30
37The 'history' pages are just monthly HTML snapshots of the local timeline. This is ok and cheap and easy, but is problematic if you e.g. intentionally delete a post because it will remain there in the history forever. If you activate local timeline purging, purged entries will remain in the history as 'ghosts', which may or may not be what the user wants. 31The 'history' pages are just monthly HTML snapshots of the local timeline. This is ok and cheap and easy, but is problematic if you e.g. intentionally delete a post because it will remain there in the history forever. If you activate local timeline purging, purged entries will remain in the history as 'ghosts', which may or may not be what the user wants.
38 32
39The actual storage system wastes too much disk space (lots of small files that really consume 4k of storage). Consider alternatives.
40
41## Closed 33## Closed
42 34
43Start a TODO file (2022-08-25T10:07:44+0200). 35Start a TODO file (2022-08-25T10:07:44+0200).
@@ -367,3 +359,11 @@ Add support for /authorize_interaction (whatever it is) (2025-01-16T14:45:28+010
367Implement following of hashtags (this is not trivial) (2025-01-30T16:12:16+0100). 359Implement following of hashtags (this is not trivial) (2025-01-30T16:12:16+0100).
368 360
369Add support for subscribing and posting to relays (see https://codeberg.org/grunfink/snac2/issues/216 for more information) (2025-01-30T16:12:34+0100). 361Add support for subscribing and posting to relays (see https://codeberg.org/grunfink/snac2/issues/216 for more information) (2025-01-30T16:12:34+0100).
362
363Wrong level of message visibility when using the Mastodon API: https://codeberg.org/grunfink/snac2/issues/200#issuecomment-2351042 (2025-03-23T15:44:35+0100).
364
365Each notification should show a link to the full thread, to see it in context (2025-03-23T15:44:50+0100).
366
367Add a list of hashtags to drop (2025-03-23T15:45:30+0100).
368
369The actual storage system wastes too much disk space (lots of small files that really consume 4k of storage). Consider alternatives (2025-03-23T15:46:02+0100).
diff --git a/data.c b/data.c
index ce040dd..a192830 100644
--- a/data.c
+++ b/data.c
@@ -2619,10 +2619,9 @@ xs_list *inbox_list(void)
2619 xs_list *ibl = xs_list_new(); 2619 xs_list *ibl = xs_list_new();
2620 xs *spec = xs_fmt("%s/inbox/" "*", srv_basedir); 2620 xs *spec = xs_fmt("%s/inbox/" "*", srv_basedir);
2621 xs *files = xs_glob(spec, 0, 0); 2621 xs *files = xs_glob(spec, 0, 0);
2622 xs_list *p = files;
2623 const xs_val *v; 2622 const xs_val *v;
2624 2623
2625 while (xs_list_iter(&p, &v)) { 2624 xs_list_foreach(files, v) {
2626 FILE *f; 2625 FILE *f;
2627 2626
2628 if ((f = fopen(v, "r")) != NULL) { 2627 if ((f = fopen(v, "r")) != NULL) {
@@ -2630,7 +2629,9 @@ xs_list *inbox_list(void)
2630 2629
2631 if (line && *line) { 2630 if (line && *line) {
2632 line = xs_strip_i(line); 2631 line = xs_strip_i(line);
2633 ibl = xs_list_append(ibl, line); 2632
2633 if (!is_instance_blocked(line))
2634 ibl = xs_list_append(ibl, line);
2634 } 2635 }
2635 2636
2636 fclose(f); 2637 fclose(f);
diff --git a/html.c b/html.c
index 3d8f0e1..d549f75 100644
--- a/html.c
+++ b/html.c
@@ -72,6 +72,9 @@ xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems, const char *p
72 const xs_dict *v; 72 const xs_dict *v;
73 int c = 0; 73 int c = 0;
74 74
75 xs_set rep_emoji;
76 xs_set_init(&rep_emoji);
77
75 while (xs_list_next(tag_list, &v, &c)) { 78 while (xs_list_next(tag_list, &v, &c)) {
76 const char *t = xs_dict_get(v, "type"); 79 const char *t = xs_dict_get(v, "type");
77 80
@@ -79,6 +82,10 @@ xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems, const char *p
79 const char *n = xs_dict_get(v, "name"); 82 const char *n = xs_dict_get(v, "name");
80 const xs_dict *i = xs_dict_get(v, "icon"); 83 const xs_dict *i = xs_dict_get(v, "icon");
81 84
85 /* avoid repeated emojis (Misskey seems to return this) */
86 if (xs_set_add(&rep_emoji, n) == 0)
87 continue;
88
82 if (xs_is_string(n) && xs_is_dict(i)) { 89 if (xs_is_string(n) && xs_is_dict(i)) {
83 const char *u = xs_dict_get(i, "url"); 90 const char *u = xs_dict_get(i, "url");
84 const char *mt = xs_dict_get(i, "mediaType"); 91 const char *mt = xs_dict_get(i, "mediaType");
@@ -106,6 +113,8 @@ xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems, const char *p
106 } 113 }
107 } 114 }
108 } 115 }
116
117 xs_set_free(&rep_emoji);
109 } 118 }
110 119
111 return s; 120 return s;
diff --git a/mastoapi.c b/mastoapi.c
index 8d61681..7b1e0ad 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -2256,6 +2256,25 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
2256 status = HTTP_STATUS_OK; 2256 status = HTTP_STATUS_OK;
2257 } 2257 }
2258 else 2258 else
2259 if (strcmp(cmd, "/v1/instance/peers") == 0) { /** **/
2260 /* get the collected inbox list as the instances "this domain is aware of" */
2261 xs *list = inbox_list();
2262 xs *peers = xs_list_new();
2263 const char *inbox;
2264
2265 xs_list_foreach(list, inbox) {
2266 xs *l = xs_split(inbox, "/");
2267 const char *domain = xs_list_get(l, 2);
2268
2269 if (xs_is_string(domain))
2270 peers = xs_list_append(peers, domain);
2271 }
2272
2273 *body = xs_json_dumps(peers, 4);
2274 *ctype = "application/json";
2275 status = HTTP_STATUS_OK;
2276 }
2277 else
2259 if (xs_startswith(cmd, "/v1/statuses/")) { /** **/ 2278 if (xs_startswith(cmd, "/v1/statuses/")) { /** **/
2260 /* information about a status */ 2279 /* information about a status */
2261 if (logged_in) { 2280 if (logged_in) {