@@ -117,13 +117,14 @@ public function shareReceived(ICloudFederationShare $share): string {
117117 }
118118
119119 if (!is_numeric ($ share ->getShareType ())) {
120- throw new ProviderCouldNotAddShareException ('RoomType is not a number ' , '' , Http::STATUS_BAD_REQUEST );
120+ throw new ProviderCouldNotAddShareException ('shareType is not a number ' , '' , Http::STATUS_BAD_REQUEST );
121121 }
122122
123123 $ shareSecret = $ share ->getShareSecret ();
124124 $ shareWith = $ share ->getShareWith ();
125- $ roomToken = $ share ->getProviderId ();
126- $ roomName = $ share ->getResourceName ();
125+ $ remoteId = $ share ->getProviderId ();
126+ $ roomToken = $ share ->getResourceName ();
127+ $ roomName = $ share ->getProtocol ()['roomName ' ];
127128 $ roomType = (int ) $ share ->getShareType ();
128129 $ sharedBy = $ share ->getSharedByDisplayName ();
129130 $ sharedByFederatedId = $ share ->getSharedBy ();
@@ -138,13 +139,13 @@ public function shareReceived(ICloudFederationShare $share): string {
138139 $ sharedByFederatedId = $ ownerFederatedId ;
139140 }
140141
141- if ($ remote && $ shareSecret && $ shareWith && $ roomToken && $ roomName && $ owner ) {
142+ if ($ remote && $ shareSecret && $ shareWith && $ roomToken && $ remoteId && is_string ( $ roomName ) && $ roomName && $ owner ) {
142143 $ shareWith = $ this ->userManager ->get ($ shareWith );
143144 if ($ shareWith === null ) {
144145 throw new ProviderCouldNotAddShareException ('User does not exist ' , '' ,Http::STATUS_BAD_REQUEST );
145146 }
146147
147- $ shareId = (string ) $ this ->federationManager ->addRemoteRoom ($ shareWith , $ roomType , $ roomName , $ roomToken , $ remote , $ shareSecret );
148+ $ shareId = (string ) $ this ->federationManager ->addRemoteRoom ($ shareWith , $ remoteId , $ roomType , $ roomName , $ roomToken , $ remote , $ shareSecret );
148149
149150 $ this ->notifyAboutNewShare ($ shareWith , $ shareId , $ sharedByFederatedId , $ sharedBy , $ roomName , $ roomToken , $ remote );
150151 return $ shareId ;
0 commit comments