Skip to content

Commit 4cbe381

Browse files
authored
Merge pull request #1465 from session-foundation/fix/SES-4050/incoming_message_request_message_info
fix: allow showing the message info panel for incoming message requests
2 parents 4b28fb6 + eb5a7ac commit 4cbe381

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

ts/components/conversation/right-panel/overlay/message-info/OverlayMessageInfo.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { PanelIconLucideIcon } from '../../../../buttons/PanelIconButton';
5353
import { useShowCopyAccountIdCb } from '../../../../menuAndSettingsHooks/useCopyAccountId';
5454
import { localize } from '../../../../../localization/localeTools';
5555
import { sectionActions } from '../../../../../state/ducks/section';
56+
import { useIsIncomingRequest } from '../../../../../hooks/useParamSelector';
5657

5758
// NOTE we override the default max-widths when in the detail isDetailView
5859
const StyledMessageBody = styled.div`
@@ -272,6 +273,8 @@ export const OverlayMessageInfo = () => {
272273
// is always the currently selected conversation
273274
const convoId = useSelectedConversationKey();
274275

276+
const isIncomingMessageRequest = useIsIncomingRequest(convoId);
277+
275278
const closePanel = useCallback(() => {
276279
dispatch(closeRightPanel());
277280
dispatch(sectionActions.resetRightOverlayMode());
@@ -379,7 +382,8 @@ export const OverlayMessageInfo = () => {
379382
dataTestId="resend-msg-from-details"
380383
/>
381384
)}
382-
{hasAttachments && (
385+
{/* Saving attachments sends a data extraction message so it must be disabled for message requests. */}
386+
{hasAttachments && !isIncomingMessageRequest && (
383387
<PanelIconButton
384388
text={localize('save').toString()}
385389
iconElement={
@@ -399,7 +403,8 @@ export const OverlayMessageInfo = () => {
399403
}}
400404
/>
401405
)}
402-
{isDeletable && !isLegacyGroup && (
406+
{/* Deleting messages sends a "delete message" message so it must be disabled for message requests. */}
407+
{isDeletable && !isLegacyGroup && !isIncomingMessageRequest && (
403408
<PanelIconButton
404409
text={localize('delete').toString()}
405410
iconElement={<PanelIconLucideIcon iconUnicode={LUCIDE_ICONS_UNICODE.TRASH2} />}

ts/session/messages/outgoing/controlMessage/DataExtractionNotificationMessage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const sendDataExtractionNotification = async (
5757
!convo ||
5858
!convo.isPrivate() ||
5959
convo.isMe() ||
60+
convo.isIncomingRequest() ||
6061
UserUtils.isUsFromCache(attachmentSender) ||
6162
convo.isBlocked()
6263
) {

ts/state/ducks/conversations.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -636,14 +636,8 @@ const conversationsSlice = createSlice({
636636
) {
637637
return state;
638638
}
639-
const selected = state.conversationLookup[state.selectedConversation];
640639

641-
// we can open the right panel always for non private chats. and also when the chat is private, and we are friends with the other person
642-
if (!selected.isPrivate || (selected.isApproved && selected.didApproveMe)) {
643-
return { ...state, showRightPanel: true };
644-
}
645-
646-
return state;
640+
return { ...state, showRightPanel: true };
647641
},
648642
closeRightPanel(state: ConversationsStateType) {
649643
return { ...state, showRightPanel: false, messageInfoId: undefined };

0 commit comments

Comments
 (0)