From 2f5273f78675cb10357d193fc3c6365739a83f13 Mon Sep 17 00:00:00 2001 From: Daniel Gale-Rosen Date: Fri, 3 May 2024 17:02:07 -0400 Subject: [PATCH 1/2] allow flags of all non-Concierge whispers --- src/libs/ReportUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 9c5e437a874e..7be02e76ea30 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5180,8 +5180,8 @@ function canFlagReportAction(reportAction: OnyxEntry, reportID: st reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED || reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CHRONOS_OOO_LIST; if (ReportActionsUtils.isWhisperAction(reportAction)) { - // Allow flagging welcome message whispers as they can be set by any room creator - if (report?.description && !isCurrentUserAction && isOriginalMessageHaveHtml && reportAction?.originalMessage?.html === report.description) { + // Allow flagging whispers that are sent by other users + if (reportAction?.actorAccountID !== CONST.ACCOUNT_ID.CONCIERGE) { return true; } From 05d65dfc8f8039571879dd9f68cc6eb1b51f3539 Mon Sep 17 00:00:00 2001 From: Daniel Gale-Rosen Date: Fri, 3 May 2024 17:05:09 -0400 Subject: [PATCH 2/2] prevent self-flagging whoops --- src/libs/ReportUtils.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 7be02e76ea30..8678c488473d 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5175,13 +5175,9 @@ function canFlagReportAction(reportAction: OnyxEntry, reportID: st report = getReport(report?.parentReportID); } const isCurrentUserAction = reportAction?.actorAccountID === currentUserAccountID; - const isOriginalMessageHaveHtml = - reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT || - reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED || - reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CHRONOS_OOO_LIST; if (ReportActionsUtils.isWhisperAction(reportAction)) { // Allow flagging whispers that are sent by other users - if (reportAction?.actorAccountID !== CONST.ACCOUNT_ID.CONCIERGE) { + if (!isCurrentUserAction && reportAction?.actorAccountID !== CONST.ACCOUNT_ID.CONCIERGE) { return true; }