Allow reactions/replies after setting removalStage

This commit is contained in:
Fedor Indutny 2023-12-08 03:20:36 +01:00 committed by GitHub
parent b089eef942
commit 9eea26c5d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 2 deletions

View file

@ -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
) {

View file

@ -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)

View file

@ -1049,6 +1049,7 @@ export function isMissingRequiredProfileSharing(
const doesConversationRequireIt =
!conversation.isMe &&
!conversation.left &&
!conversation.removalStage &&
(isGroupV1(conversation) || isDirectConversation(conversation));
return Boolean(

View file

@ -1766,7 +1766,10 @@ function canReplyOrReact(
return false;
}
if (!conversation.acceptedMessageRequest) {
if (
!conversation.acceptedMessageRequest &&
conversation.removalStage !== 'justNotification'
) {
return false;
}