From 110af690d1daeffbb56935f859cf06cfb46d154e Mon Sep 17 00:00:00 2001 From: syui Date: Sun, 22 Mar 2026 12:34:29 +0900 Subject: [PATCH] add chat --- compose.yml | 9 +++++++ install.zsh | 5 ++++ ios/patching/002-social-app-ios-lib.patch | 8 +++---- .../023-social-app-ios-disable-dm.patch | 24 +++++++++++-------- ios/setup.zsh | 1 - 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/compose.yml b/compose.yml index ebb0fe9..728beae 100644 --- a/compose.yml +++ b/compose.yml @@ -157,3 +157,12 @@ services: - ./data/feed:/data/ depends_on: - jetstream + + chat: + ports: + - 3100:3100 + build: + context: ./repos/chat/ + restart: always + volumes: + - ./data/chat:/data diff --git a/install.zsh b/install.zsh index 88d357a..857b473 100755 --- a/install.zsh +++ b/install.zsh @@ -41,6 +41,7 @@ function at-repos-env() { "ozone" "social-app" "feed" + "chat" ) handles=( "syui.syui.ai" @@ -93,6 +94,9 @@ function at-repos-clone() { if [ ! -f $d/repos/feed-generator/Dockerfile ] && [ -f $d/docker/feed/Dockerfile ];then cp -rf $d/docker/feed/Dockerfile $d/repos/feed-generator/ fi + if [ ! -d $d/repos/chat ];then + git clone https://git.syui.ai/ai/chat $d/repos/chat + fi } function at-repos-pull() { @@ -435,6 +439,7 @@ function at-repos-docker-verify() { ozone) check_file="/app/services/ozone/api.js" ;; bgs) check_file="/relay" ;; plc) check_file="/app/packages/server/dist/index.js" ;; + chat) check_file="/usr/local/bin/aichat" ;; *) return 0 ;; esac local cid diff --git a/ios/patching/002-social-app-ios-lib.patch b/ios/patching/002-social-app-ios-lib.patch index 36cc321..74b23c7 100644 --- a/ios/patching/002-social-app-ios-lib.patch +++ b/ios/patching/002-social-app-ios-lib.patch @@ -1,5 +1,5 @@ ---- a/src/lib/constants.ts 2026-03-15 19:17:45 -+++ b/src/lib/constants.ts 2026-03-15 19:16:32 +--- a/src/lib/constants.ts 2026-03-22 12:31:56 ++++ b/src/lib/constants.ts 2026-03-22 12:29:49 @@ -7,12 +7,12 @@ export const LOCAL_DEV_SERVICE = Platform.OS === 'android' ? 'http://10.0.2.2:2583' : 'http://localhost:2583' @@ -95,7 +95,7 @@ + +export function getDmServiceHeaders(serviceUrl?: string) { + const chatDid = isSelfHostedService(serviceUrl) -+ ? CHAT_PROXY_DID ++ ? PUBLIC_APPVIEW_DID + : OFFICIAL_CHAT_DID + return { + 'atproto-proxy': `${chatDid}#bsky_chat`, @@ -116,8 +116,6 @@ community: `https://bsky.social/about/support/community-guidelines`, communityDeprecated: `https://bsky.social/about/support/community-guidelines-deprecated`, } -diff --git a/src/lib/api/feed/home.ts b/src/lib/api/feed/home.ts -index 7a0d72d91..93554dc3e 100644 --- a/src/lib/api/feed/home.ts +++ b/src/lib/api/feed/home.ts @@ -45,7 +45,7 @@ export class HomeFeedAPI implements FeedAPI { diff --git a/ios/patching/023-social-app-ios-disable-dm.patch b/ios/patching/023-social-app-ios-disable-dm.patch index 7ad8ac2..67cd291 100644 --- a/ios/patching/023-social-app-ios-disable-dm.patch +++ b/ios/patching/023-social-app-ios-disable-dm.patch @@ -1,6 +1,6 @@ ---- a/src/view/shell/bottom-bar/BottomBar.tsx -+++ b/src/view/shell/bottom-bar/BottomBar.tsx -@@ -196,38 +196,40 @@ +--- a/src/view/shell/bottom-bar/BottomBar.tsx 2026-03-22 12:16:35 ++++ b/src/view/shell/bottom-bar/BottomBar.tsx 2026-03-22 12:17:01 +@@ -199,40 +199,42 @@ accessibilityLabel={_(msg`Search`)} accessibilityHint="" /> @@ -20,13 +20,15 @@ - ) - } - onPress={onPressMessages} -- notificationCount={numUnreadMessages.numUnread} -- hasNew={numUnreadMessages.hasNew} +- notificationCount={ +- aa.flags.chatDisabled ? undefined : numUnreadMessages.numUnread +- } +- hasNew={aa.flags.chatDisabled ? false : numUnreadMessages.hasNew} - accessible={true} - accessibilityRole="tab" - accessibilityLabel={_(msg`Chat`)} - accessibilityHint={ -- numUnreadMessages.count > 0 +- !aa.flags.chatDisabled && numUnreadMessages.count > 0 - ? _( - plural(numUnreadMessages.numUnread ?? 0, { - one: '# unread item', @@ -36,7 +38,7 @@ - : '' - } - /> -+ {currentAccount?.isSelfHosted && ( ++ {!currentAccount?.isSelfHosted && ( + 0 ++ !aa.flags.chatDisabled && numUnreadMessages.count > 0 + ? _( + plural(numUnreadMessages.numUnread ?? 0, { + one: '# unread item', diff --git a/ios/setup.zsh b/ios/setup.zsh index 74458d9..8facb10 100755 --- a/ios/setup.zsh +++ b/ios/setup.zsh @@ -35,7 +35,6 @@ PATCH_FILES_IOS=( "020-social-app-ios-bypass-age-assurance.patch" "021-social-app-ios-clean-feed.patch" # DiscoverFallback + Empty/End + PostFeed (merged 040) "022-social-app-ios-bskyweb.patch" # bskyweb routes + templates (merged 025) - "023-social-app-ios-disable-dm.patch" "024-social-app-ios-disable-external-services.patch" "027-social-app-ios-remove-birthdate.patch" "028-social-app-ios-remove-discover.patch" # Explore + Feeds (merged 029)