@@ -816,19 +816,34 @@ protected function parseDeletedMessage(Message $chatMessage): void {
816816 */
817817 protected function getFileFromNodeId (Room $ room , ?Participant $ participant , int $ nodeId , bool $ allowInaccurate = false ): array {
818818 if ($ participant && $ participant ->getAttendee ()->getActorType () === Attendee::ACTOR_USERS ) {
819- $ uid = $ participant ->getAttendee ()->getActorId ();
820- $ userFolder = $ this ->rootFolder ->getUserFolder ($ uid );
819+ if ($ allowInaccurate ) {
820+ // Lightweight lookup: search the filecache directly without setting up the user
821+ // filesystem, mirroring getFileFromShare()'s use of getNodeCacheEntry().
822+ // Path is intentionally inaccurate (filename only) — callers that need the full
823+ // relative path must pass $allowInaccurate = false.
824+ $ node = $ this ->rootFolder ->getFirstNodeById ($ nodeId );
825+ if (!$ node instanceof Node) {
826+ throw new NotFoundException ('File node ' . $ nodeId . ' not found ' );
827+ }
821828
822- $ node = $ userFolder ->getFirstNodeById ($ nodeId );
823- if (!$ node instanceof Node) {
824- throw new NotFoundException ('File node ' . $ nodeId . ' not found for user ' . $ uid );
825- }
829+ $ name = $ node ->getName ();
830+ $ size = $ node ->getSize ();
831+ $ path = $ name ;
832+ } else {
833+ $ uid = $ participant ->getAttendee ()->getActorId ();
834+ $ userFolder = $ this ->rootFolder ->getUserFolder ($ uid );
826835
827- $ fullPath = $ node ->getPath ();
828- $ pathSegments = explode ('/ ' , $ fullPath , 4 );
829- $ name = $ node ->getName ();
830- $ size = $ node ->getSize ();
831- $ path = $ pathSegments [3 ] ?? $ name ;
836+ $ node = $ userFolder ->getFirstNodeById ($ nodeId );
837+ if (!$ node instanceof Node) {
838+ throw new NotFoundException ('File node ' . $ nodeId . ' not found for user ' . $ uid );
839+ }
840+
841+ $ fullPath = $ node ->getPath ();
842+ $ pathSegments = explode ('/ ' , $ fullPath , 4 );
843+ $ name = $ node ->getName ();
844+ $ size = $ node ->getSize ();
845+ $ path = $ pathSegments [3 ] ?? $ name ;
846+ }
832847
833848 $ url = $ this ->url ->linkToRouteAbsolute ('files.viewcontroller.showFile ' , [
834849 'fileid ' => $ node ->getId (),
0 commit comments