@@ -619,24 +619,24 @@ function getLastMessageTextForReport({
619619} ) : string {
620620 const reportID = report ?. reportID ;
621621 const canUserPerformWrite = canUserPerformWriteAction ( report , isReportArchived ) ;
622- let lastReportAction = lastAction ?? getLastVisibleAction ( reportID , canUserPerformWrite , { } , undefined , visibleReportActionsDataParam ) ;
622+ let lastReportAction = lastAction ?? getLastVisibleAction ( reportID , canUserPerformWrite , { } , undefined , visibleReportActionsDataParam , policy ) ;
623623
624624 const transactionThreadReportID = reportID ? cachedOneTransactionThreadReportIDs [ reportID ] : undefined ;
625625
626626 if ( reportID && ! lastAction && transactionThreadReportID ) {
627627 lastReportAction =
628- getLastVisibleActionIncludingTransactionThread ( reportID , canUserPerformWrite , undefined , visibleReportActionsDataParam , transactionThreadReportID ) ?? lastReportAction ;
628+ getLastVisibleActionIncludingTransactionThread ( reportID , canUserPerformWrite , undefined , visibleReportActionsDataParam , transactionThreadReportID , policy ) ?? lastReportAction ;
629629 }
630630
631631 // Compute lastVisibleMessage before IOU filter — it needs IOU CREATE/TRACK for text extraction.
632- const lastVisibleMessage = getLastVisibleMessage ( report ?. reportID , undefined , { } , lastReportAction , visibleReportActionsDataParam ) ;
632+ const lastVisibleMessage = getLastVisibleMessage ( report ?. reportID , undefined , { } , lastReportAction , visibleReportActionsDataParam , policy ) ;
633633
634634 // For one-transaction reports, filter IOU CREATE/TRACK and fall back to the parent's action (e.g. REPORT_PREVIEW).
635635 if ( transactionThreadReportID && lastReportAction && isMoneyRequestAction ( lastReportAction ) ) {
636636 const actionType = getOriginalMessage ( lastReportAction ) ?. type ?? '' ;
637637 const isSelfDMReport = reportUtilsIsSelfDM ( report ) ;
638638 if ( actionType === CONST . IOU . REPORT_ACTION_TYPE . CREATE || ( ! isSelfDMReport && actionType === CONST . IOU . REPORT_ACTION_TYPE . TRACK ) ) {
639- const parentLastAction = getLastVisibleAction ( reportID , canUserPerformWrite , { } , undefined , visibleReportActionsDataParam ) ;
639+ const parentLastAction = getLastVisibleAction ( reportID , canUserPerformWrite , { } , undefined , visibleReportActionsDataParam , policy ) ;
640640 if ( parentLastAction && isMoneyRequestAction ( parentLastAction ) ) {
641641 const parentActionType = getOriginalMessage ( parentLastAction ) ?. type ?? '' ;
642642 if ( parentActionType === CONST . IOU . REPORT_ACTION_TYPE . CREATE || ( ! isSelfDMReport && parentActionType === CONST . IOU . REPORT_ACTION_TYPE . TRACK ) ) {
0 commit comments