Skip to content

Commit

Permalink
Merge pull request #41622 from Expensify/dangrous-flagworkspaceinvites
Browse files Browse the repository at this point in the history
Allow flags of all non-Concierge whispers
  • Loading branch information
jasperhuangg authored May 15, 2024
2 parents 4705d89 + 05d65df commit 3096d55
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5292,13 +5292,9 @@ function canFlagReportAction(reportAction: OnyxEntry<ReportAction>, 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 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 (!isCurrentUserAction && reportAction?.actorAccountID !== CONST.ACCOUNT_ID.CONCIERGE) {
return true;
}

Expand Down

0 comments on commit 3096d55

Please sign in to comment.