Skip to content

Commit

Permalink
prevent self-flagging whoops
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrous committed May 3, 2024
1 parent 2f5273f commit 05d65df
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5175,13 +5175,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 whispers that are sent by other users
if (reportAction?.actorAccountID !== CONST.ACCOUNT_ID.CONCIERGE) {
if (!isCurrentUserAction && reportAction?.actorAccountID !== CONST.ACCOUNT_ID.CONCIERGE) {
return true;
}

Expand Down

0 comments on commit 05d65df

Please sign in to comment.