summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RELEASE_NOTES.md4
-rw-r--r--activitypub.c13
-rw-r--r--html.c18
-rw-r--r--po/de_DE.po10
-rw-r--r--snac.h2
-rw-r--r--webfinger.c4
6 files changed, 42 insertions, 9 deletions
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 7dfb332..410376e 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,5 +1,9 @@
1# Release Notes 1# Release Notes
2 2
3## UNRELEASED
4
5Quoted posts are now shown.
6
3## 2.84 7## 2.84
4 8
5Implemented more scopes to match other ActivityPub implementations (public, unlisted, followers-only and direct message) (contributed by byte). 9Implemented more scopes to match other ActivityPub implementations (public, unlisted, followers-only and direct message) (contributed by byte).
diff --git a/activitypub.c b/activitypub.c
index 0368ac8..bb6f460 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -2686,6 +2686,19 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
2686 2686
2687 timeline_request(snac, &in_reply_to, &wrk, 0); 2687 timeline_request(snac, &in_reply_to, &wrk, 0);
2688 2688
2689 const char *quoted_id = xs_dict_get(object, "quoteUri");
2690 if (xs_is_string(quoted_id) && xs_match(quoted_id, "https://*|http://*")) { /** **/
2691 xs *quoted_post = NULL;
2692 int status;
2693
2694 if (valid_status(status = activitypub_request(snac, quoted_id, &quoted_post))) {
2695 /* got quoted post */
2696 object_add(quoted_id, quoted_post);
2697 }
2698
2699 snac_debug(snac, 1, xs_fmt("retrieving quoted post %s %d", quoted_id, status));
2700 }
2701
2689 if (timeline_add(snac, id, object)) { 2702 if (timeline_add(snac, id, object)) {
2690 snac_log(snac, xs_fmt("new '%s' %s %s", utype, actor, id)); 2703 snac_log(snac, xs_fmt("new '%s' %s %s", utype, actor, id));
2691 do_notify = 1; 2704 do_notify = 1;
diff --git a/html.c b/html.c
index e482b53..bcafba4 100644
--- a/html.c
+++ b/html.c
@@ -2394,6 +2394,22 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
2394 /* c contains sanitized HTML */ 2394 /* c contains sanitized HTML */
2395 xs_html_add(snac_content, 2395 xs_html_add(snac_content,
2396 xs_html_raw(c)); 2396 xs_html_raw(c));
2397
2398 /* quoted post */
2399 const char *quoted_id = xs_dict_get(msg, "quoteUri");
2400 if (xs_is_string(quoted_id) && xs_match(quoted_id, "https://*|http://*")) { /** **/
2401 xs *quoted_post = NULL;
2402
2403 if (valid_status(object_get(quoted_id, &quoted_post))) {
2404 xs_html_add(snac_content,
2405 xs_html_tag("blockquote",
2406 xs_html_attr("class", "snac-quoted-post"),
2407 html_entry(user, quoted_post, 1, 1, NULL, 1)));
2408 }
2409 else
2410 if (user)
2411 enqueue_object_request(user, quoted_id, 0);
2412 }
2397 } 2413 }
2398 2414
2399 if (strcmp(type, "Question") == 0) { /** question content **/ 2415 if (strcmp(type, "Question") == 0) { /** question content **/
@@ -3221,7 +3237,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
3221 continue; 3237 continue;
3222 } 3238 }
3223 /* hide non-public posts viewed from outside */ 3239 /* hide non-public posts viewed from outside */
3224 if (read_only && scope != SCOPE_PUBLIC){ 3240 if (read_only && (scope != SCOPE_PUBLIC && scope != SCOPE_UNLISTED)) {
3225 continue; 3241 continue;
3226 } 3242 }
3227 3243
diff --git a/po/de_DE.po b/po/de_DE.po
index 147f7ac..bb6876c 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -782,20 +782,20 @@ msgstr "en fr es de_DE"
782 782
783#: html.c:460 783#: html.c:460
784msgid "Visibility: " 784msgid "Visibility: "
785msgstr "" 785msgstr "Sichtbarkeit"
786 786
787#: html.c:468 787#: html.c:468
788msgid "Public" 788msgid "Public"
789msgstr "" 789msgstr "Öffentlich"
790 790
791#: html.c:477 791#: html.c:477
792msgid "Unlisted" 792msgid "Unlisted"
793msgstr "" 793msgstr "Ungelistete"
794 794
795#: html.c:486 795#: html.c:486
796msgid "Followers-only" 796msgid "Followers-only"
797msgstr "" 797msgstr "Nur Follower"
798 798
799#: html.c:495 799#: html.c:495
800msgid "Direct Message" 800msgid "Direct Message"
801msgstr "" 801msgstr "Direktnachricht"
diff --git a/snac.h b/snac.h
index 4c3100a..91dfa27 100644
--- a/snac.h
+++ b/snac.h
@@ -1,7 +1,7 @@
1/* snac - A simple, minimalistic ActivityPub instance */ 1/* snac - A simple, minimalistic ActivityPub instance */
2/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ 2/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
3 3
4#define VERSION "2.84" 4#define VERSION "2.85-dev"
5 5
6#define USER_AGENT "snac/" VERSION 6#define USER_AGENT "snac/" VERSION
7 7
diff --git a/webfinger.c b/webfinger.c
index 12ec42c..1ce5e76 100644
--- a/webfinger.c
+++ b/webfinger.c
@@ -76,9 +76,9 @@ int webfinger_request_signed(snac *snac, const char *qs, xs_str **actor, xs_str
76 xs *url = xs_fmt("%s:/" "/%s/.well-known/webfinger?resource=%s", proto, host, resource); 76 xs *url = xs_fmt("%s:/" "/%s/.well-known/webfinger?resource=%s", proto, host, resource);
77 77
78 if (snac == NULL) 78 if (snac == NULL)
79 xs_http_request("GET", url, headers, NULL, 0, &status, &payload, &p_size, 0); 79 xs_free(xs_http_request("GET", url, headers, NULL, 0, &status, &payload, &p_size, 0));
80 else 80 else
81 http_signed_request(snac, "GET", url, headers, NULL, 0, &status, &payload, &p_size, 0); 81 xs_free(http_signed_request(snac, "GET", url, headers, NULL, 0, &status, &payload, &p_size, 0));
82 } 82 }
83 83
84 if (obj == NULL && valid_status(status) && payload) { 84 if (obj == NULL && valid_status(status) && payload) {