@@ -95,8 +95,6 @@ protected function dropMailSharesWhereRemoteShareIsPossible(ISearchResult $searc
9595 $ allResults = $ searchResult ->asArray ();
9696
9797 $ emailType = new SearchResultType ('emails ' );
98- $ remoteType = new SearchResultType ('remotes ' );
99-
10098 $ emailLabel = $ emailType ->getLabel ();
10199 $ emailEntries = array_merge (
102100 $ allResults ['exact ' ][$ emailLabel ] ?? [],
@@ -115,14 +113,18 @@ protected function dropMailSharesWhereRemoteShareIsPossible(ISearchResult $searc
115113 $ mailIdMap [$ mailRow ['uuid ' ]] = $ mailRow ['value ' ]['shareWith ' ];
116114 }
117115
118- foreach ($ allResults [$ remoteType ->getLabel ()] as $ resultRow ) {
119- if (!isset ($ resultRow ['uuid ' ])) {
120- continue ;
121- }
122- if (isset ($ mailIdMap [$ resultRow ['uuid ' ]])) {
123- $ searchResult ->removeCollaboratorResult ($ emailType , $ mailIdMap [$ resultRow ['uuid ' ]]);
116+ $ remoteType = new SearchResultType ('remotes ' );
117+ if (isset ($ allResults [$ remoteType ->getLabel ()])) {
118+ foreach ($ allResults [$ remoteType ->getLabel ()] as $ resultRow ) {
119+ if (!isset ($ resultRow ['uuid ' ])) {
120+ continue ;
121+ }
122+ if (isset ($ mailIdMap [$ resultRow ['uuid ' ]])) {
123+ $ searchResult ->removeCollaboratorResult ($ emailType , $ mailIdMap [$ resultRow ['uuid ' ]]);
124+ }
124125 }
125126 }
127+
126128 $ lookupType = new SearchResultType ('lookup ' );
127129 if (isset ($ allResults [$ lookupType ->getLabel ()])) {
128130 foreach ($ allResults [$ lookupType ->getLabel ()] as $ resultRow ) {
0 commit comments