From d31674b9bb8c6b4801a1845396549e279fde140e Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 24 Oct 2024 11:51:59 +0900 Subject: [PATCH 1/4] Version bump [ci skip] --- CHANGES.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index c77b81be..5517ab83 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ Hollo changelog =============== +Version 0.1.3 +------------- + +To be released. + + Version 0.1.2 ------------- diff --git a/package.json b/package.json index 0b001b30..18b02bb6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@fedify/hollo", "description": "Federated single-user microblogging software", - "version": "0.1.2", + "version": "0.1.3", "private": true, "scripts": { "prod": "bun run migrate && bun run src/index.tsx", From 8b06aecfe45baa51b6681a3d9595d5ec6dee2584 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Sun, 27 Oct 2024 10:45:50 +0900 Subject: [PATCH 2/4] Upgrade Fedify to 1.1.2 --- CHANGES.md | 4 ++++ bun.lockb | Bin 153528 -> 153528 bytes package.json | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 5517ab83..d18c3f71 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,10 @@ Version 0.1.3 To be released. + - Fixed incorrect handling of relative path URIs in `Link` headers with + `rel=alternate`. This caused inoperability with some software such as + GoToSocial. + Version 0.1.2 ------------- diff --git a/bun.lockb b/bun.lockb index 0f3fd4a366990c5aa1ee92b38d4e0b9805726bce..f2c59402b86f76172897c0cf59b63167305e0d1d 100755 GIT binary patch delta 446 zcmXZTT_}T57zgn8c{B6&jzUSBu*FK|ZIhI&xRKJxS3)cw`B)5P$wV=`k}>DKg+++uKTm+fY_a>C5t=zwAHFgy}P z3r^+#PJ*2$who}c)3Qz|VIe}Mxuc{008FL|5pVEc8HzXdml0 z-RS`_a5vcf=!+ir!bVKdAa)ZPM`LInjUXfHMs27c4WK^Mj_hcGZW^Il5(^qZBjnSF z8J<$fnGK{Q-+^JVK>^W4+e$QE9C!^cVoP&koJM!Gb5M|4u3(rHhMCm4?kZ|#4%b-F nYlI>}O~SK~Mqc+oO07;<9wmh#kdvWomLr}lHijNFP( delta 339 zcmdn7o^!`~&Ix)78lq{E23mI?@am=ZDexY8%zD=@eak1A^ev0dPpB~a*E8Rb(|*CxPiGl? zC%%09mUE$=kxKuJk1pEZxq9*^?g*W}*>#uv3QYz^1~Bje(jX=`5VJwWe4%1IKrzng zy-AGQ8F{w5CNtVI>4MZU0x=U1GXpUT5VHa?NGm%Ka{w_X5OV=B_x6pcjMo`CzXOfA z1;n?fPfcf(=e!JLUIpTV+jpijvNLji1F~-b@uBS}GZ>e%Oz+5HwAsEUm(iDpjR`2s zz_9&)CF4_xZM}?bjMLxjW|Z3AGKFzQ#q=*985O1 Date: Sun, 27 Oct 2024 10:50:50 +0900 Subject: [PATCH 3/4] Send `Delete(Person)` to followings --- CHANGES.md | 2 ++ bun.lockb | Bin 153528 -> 153528 bytes src/pages/accounts.tsx | 33 ++++++++++++++++++++++++++++----- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d18c3f71..1a08ab59 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,8 @@ To be released. - Fixed incorrect handling of relative path URIs in `Link` headers with `rel=alternate`. This caused inoperability with some software such as GoToSocial. + - It now sends `Delete(Person)` activity to followees besides followers + when a user deletes their account. Version 0.1.2 diff --git a/bun.lockb b/bun.lockb index f2c59402b86f76172897c0cf59b63167305e0d1d..a07faa3673d7afb2ec85fb9ca409bfa136ecad9e 100755 GIT binary patch delta 23 fcmdn7o^!`~&W0_Fzbe_{4D}54jJ8!V?zjs8cbf^L delta 23 fcmdn7o^!`~&W0_Fzbe@b^$hil7`9b0?zjs8bb$#) diff --git a/src/pages/accounts.tsx b/src/pages/accounts.tsx index 9961415d..979ac1ec 100644 --- a/src/pages/accounts.tsx +++ b/src/pages/accounts.tsx @@ -8,6 +8,7 @@ import { generateCryptoKeyPair, getActorHandle, isActor, + type Recipient, } from "@fedify/fedify"; import { getLogger } from "@logtape/logtape"; import { eq, sql } from "drizzle-orm"; @@ -30,6 +31,7 @@ import { type PostVisibility, accountOwners, accounts as accountsTable, + follows, } from "../schema.ts"; import { extractCustomEmojis, formatText } from "../text.ts"; @@ -269,14 +271,35 @@ accounts.post("/:id/delete", async (c) => { }); if (accountOwner == null) return c.notFound(); const fedCtx = federation.createContext(c.req.raw, undefined); + const activity = new Delete({ + actor: fedCtx.getActorUri(accountOwner.handle), + to: PUBLIC_COLLECTION, + object: await fedCtx.getActor(accountOwner.handle), + }); await fedCtx.sendActivity( { handle: accountOwner.handle }, "followers", - new Delete({ - actor: fedCtx.getActorUri(accountOwner.handle), - to: PUBLIC_COLLECTION, - object: await fedCtx.getActor(accountOwner.handle), - }), + activity, + { preferSharedInbox: true, excludeBaseUris: [fedCtx.url] }, + ); + const following = await db.query.follows.findMany({ + with: { following: true }, + where: eq(follows.followerId, accountId), + }); + await fedCtx.sendActivity( + { handle: accountOwner.handle }, + following.map( + (f) => + ({ + id: new URL(f.following.iri), + inboxId: new URL(f.following.inboxUrl), + endpoints: + f.following.sharedInboxUrl == null + ? null + : { sharedInbox: new URL(f.following.sharedInboxUrl) }, + }) satisfies Recipient, + ), + activity, { preferSharedInbox: true, excludeBaseUris: [fedCtx.url] }, ); await db.transaction(async (tx) => { From a91f178c6d5ff387369c2448c8c8f81343137af3 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Sun, 27 Oct 2024 10:52:37 +0900 Subject: [PATCH 4/4] Release 0.1.3 --- CHANGES.md | 2 +- src/pages/accounts.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1a08ab59..9dfb1a32 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ Hollo changelog Version 0.1.3 ------------- -To be released. +Released on October 27, 2024. - Fixed incorrect handling of relative path URIs in `Link` headers with `rel=alternate`. This caused inoperability with some software such as diff --git a/src/pages/accounts.tsx b/src/pages/accounts.tsx index 979ac1ec..d7dcd65a 100644 --- a/src/pages/accounts.tsx +++ b/src/pages/accounts.tsx @@ -3,12 +3,12 @@ import { Move, type Object, PUBLIC_COLLECTION, + type Recipient, Update, exportJwk, generateCryptoKeyPair, getActorHandle, isActor, - type Recipient, } from "@fedify/fedify"; import { getLogger } from "@logtape/logtape"; import { eq, sql } from "drizzle-orm";