diff --git a/src/screens/Messages/components/MessagesList.tsx b/src/screens/Messages/components/MessagesList.tsx index 727829795c..2d471a8d35 100644 --- a/src/screens/Messages/components/MessagesList.tsx +++ b/src/screens/Messages/components/MessagesList.tsx @@ -709,7 +709,13 @@ function getFooterState( convoState: ActiveConvoStates, hasAcceptOverride?: boolean, ): FooterState { - if (convoState.convo.view.status === 'request' && !hasAcceptOverride) { + const isRequest = + convoState.convo.view.status === 'request' && !hasAcceptOverride + + // For group chats, the request footer is driven purely off status: the owner + // is always 'accepted' so never sees it, while members the owner added are + // 'request' until they accept. This holds even before any messages load. + if (convoState.convo.kind === 'group' && isRequest) { return 'request' } @@ -721,6 +727,15 @@ function getFooterState( } } + // For direct chats, only show the request footer once there's a message. The + // viewer's status stays 'request' until they send their first message, so an + // empty direct request is one the viewer started themselves (show the + // composer), whereas any message present must be an incoming one from the + // other user (show the accept/reject footer). + if (isRequest) { + return 'request' + } + return 'standard' } diff --git a/src/state/queries/messages/list-conversations.tsx b/src/state/queries/messages/list-conversations.tsx index 372ef708f3..62f5772bef 100644 --- a/src/state/queries/messages/list-conversations.tsx +++ b/src/state/queries/messages/list-conversations.tsx @@ -738,7 +738,16 @@ function calculateCount( moderateProfile(convo.primaryMember, moderationOpts).blocked || convo.primaryMember.handle === 'missing.invalid' || (convo.kind === 'group' && convo.details.lockStatus !== 'unlocked') - const unreadCount = !shouldIgnore && convo.view.unreadCount > 0 ? 1 : 0 + const unreadJoinRequestCount = + convo.kind === 'group' + ? (convo.details.unreadJoinRequestCount ?? 0) + : 0 + + const unreadCount = + !shouldIgnore && + (convo.view.unreadCount > 0 || unreadJoinRequestCount > 0) + ? 1 + : 0 return acc + unreadCount }, 0) ?? 0