diff --git a/ios/patching/023-social-app-ios-disable-dm.patch b/ios/patching/023-social-app-ios-disable-dm.patch index 2f2236e..fdc0278 100644 --- a/ios/patching/023-social-app-ios-disable-dm.patch +++ b/ios/patching/023-social-app-ios-disable-dm.patch @@ -1,70 +1,75 @@ -diff --git a/src/state/messages/events/index.tsx b/src/state/messages/events/index.tsx -index 2ff0784ae..dc314ecc5 100644 ---- a/src/state/messages/events/index.tsx -+++ b/src/state/messages/events/index.tsx -@@ -10,13 +10,7 @@ const MessagesEventBusContext = React.createContext( - MessagesEventBusContext.displayName = 'MessagesEventBusContext' - - export function useMessagesEventBus() { -- const ctx = React.useContext(MessagesEventBusContext) -- if (!ctx) { -- throw new Error( -- 'useMessagesEventBus must be used within a MessagesEventBusProvider', -- ) -- } -- return ctx -+ return React.useContext(MessagesEventBusContext) - } - - export function MessagesEventBusProvider({ -@@ -24,18 +18,11 @@ export function MessagesEventBusProvider({ - }: { - children: React.ReactNode - }) { -- const {currentAccount} = useSession() -- -- if (!currentAccount) { -- return ( -- -- {children} -- -- ) -- } -- -+ // DM functionality is disabled for syu.is - return ( -- {children} -+ -+ {children} -+ - ) - } - -diff --git a/src/state/queries/messages/list-conversations.tsx b/src/state/queries/messages/list-conversations.tsx -index c5457d1cb..5bc37bdce 100644 ---- a/src/state/queries/messages/list-conversations.tsx -+++ b/src/state/queries/messages/list-conversations.tsx -@@ -74,17 +74,12 @@ export function useListConvos() { - - const empty = {accepted: [], request: []} - export function ListConvosProvider({children}: {children: React.ReactNode}) { -- const {hasSession} = useSession() -- -- if (!hasSession) { -- return ( -- -- {children} -- -- ) -- } -- -- return {children} -+ // DM functionality is disabled for syu.is - always return empty -+ return ( -+ -+ {children} -+ -+ ) - } - - export function ListConvosProviderInner({ +--- a/src/view/shell/bottom-bar/BottomBar.tsx ++++ b/src/view/shell/bottom-bar/BottomBar.tsx +@@ -198,38 +198,40 @@ + accessibilityLabel={_(msg`Search`)} + accessibilityHint="" + /> +- +- ) : ( +- +- ) +- } +- onPress={onPressMessages} +- notificationCount={numUnreadMessages.numUnread} +- hasNew={numUnreadMessages.hasNew} +- accessible={true} +- accessibilityRole="tab" +- accessibilityLabel={_(msg`Chat`)} +- accessibilityHint={ +- numUnreadMessages.count > 0 +- ? _( +- msg`${plural(numUnreadMessages.numUnread ?? 0, { +- one: '# unread item', +- other: '# unread items', +- })}` || '', +- ) +- : '' +- } +- /> ++ {!currentAccount?.isSelfHosted && ( ++ ++ ) : ( ++ ++ ) ++ } ++ onPress={onPressMessages} ++ notificationCount={numUnreadMessages.numUnread} ++ hasNew={numUnreadMessages.hasNew} ++ accessible={true} ++ accessibilityRole="tab" ++ accessibilityLabel={_(msg`Chat`)} ++ accessibilityHint={ ++ numUnreadMessages.count > 0 ++ ? _( ++ msg`${plural(numUnreadMessages.numUnread ?? 0, { ++ one: '# unread item', ++ other: '# unread items', ++ })}` || '', ++ ) ++ : '' ++ } ++ /> ++ )} +