Skip to content

Commit

Permalink
Allow reactions/replies after setting removalStage
Browse files Browse the repository at this point in the history
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
  • Loading branch information
automated-signal and indutny-signal committed Dec 8, 2023
1 parent 1754b99 commit 5d30f54
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ts/components/CompositionArea.tsx
Expand Up @@ -781,7 +781,7 @@ export function CompositionArea({
// If no message request, but we haven't shared profile yet, we show profile-sharing UI
if (
!left &&
((conversationType === 'direct' && removalStage !== 'justNotification') ||
(conversationType === 'direct' ||
(conversationType === 'group' && groupVersion === 1)) &&
isMissingMandatoryProfileSharing
) {
Expand Down
15 changes: 15 additions & 0 deletions ts/reactions/enqueueReactionForSend.ts
Expand Up @@ -55,6 +55,21 @@ export async function enqueueReactionForSend({
);

const isMessageAStory = isStory(message.attributes);

if (
!isMessageAStory ||
isDirectConversation(messageConversation.attributes)
) {
log.info('Enabling profile sharing for reaction send');
if (!messageConversation.get('profileSharing')) {
messageConversation.set('profileSharing', true);
await window.Signal.Data.updateConversation(
messageConversation.attributes
);
}
await messageConversation.restoreContact();
}

const targetConversation =
isMessageAStory && isDirectConversation(messageConversation.attributes)
? window.ConversationController.get(targetAuthorAci)
Expand Down
1 change: 1 addition & 0 deletions ts/state/selectors/conversations.ts
Expand Up @@ -1049,6 +1049,7 @@ export function isMissingRequiredProfileSharing(
const doesConversationRequireIt =
!conversation.isMe &&
!conversation.left &&
!conversation.removalStage &&
(isGroupV1(conversation) || isDirectConversation(conversation));

return Boolean(
Expand Down
5 changes: 4 additions & 1 deletion ts/state/selectors/message.ts
Expand Up @@ -1766,7 +1766,10 @@ function canReplyOrReact(
return false;
}

if (!conversation.acceptedMessageRequest) {
if (
!conversation.acceptedMessageRequest &&
conversation.removalStage !== 'justNotification'
) {
return false;
}

Expand Down

0 comments on commit 5d30f54

Please sign in to comment.