@@ -117,13 +117,14 @@ public function shareReceived(ICloudFederationShare $share): string {
117
117
}
118
118
119
119
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 );
121
121
}
122
122
123
123
$ shareSecret = $ share ->getShareSecret ();
124
124
$ shareWith = $ share ->getShareWith ();
125
- $ roomToken = $ share ->getProviderId ();
126
- $ roomName = $ share ->getResourceName ();
125
+ $ remoteId = $ share ->getProviderId ();
126
+ $ roomToken = $ share ->getResourceName ();
127
+ $ roomName = $ share ->getProtocol ()['roomName ' ];
127
128
$ roomType = (int ) $ share ->getShareType ();
128
129
$ sharedBy = $ share ->getSharedByDisplayName ();
129
130
$ sharedByFederatedId = $ share ->getSharedBy ();
@@ -138,13 +139,13 @@ public function shareReceived(ICloudFederationShare $share): string {
138
139
$ sharedByFederatedId = $ ownerFederatedId ;
139
140
}
140
141
141
- if ($ remote && $ shareSecret && $ shareWith && $ roomToken && $ roomName && $ owner ) {
142
+ if ($ remote && $ shareSecret && $ shareWith && $ roomToken && $ remoteId && is_string ( $ roomName ) && $ roomName && $ owner ) {
142
143
$ shareWith = $ this ->userManager ->get ($ shareWith );
143
144
if ($ shareWith === null ) {
144
145
throw new ProviderCouldNotAddShareException ('User does not exist ' , '' ,Http::STATUS_BAD_REQUEST );
145
146
}
146
147
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 );
148
149
149
150
$ this ->notifyAboutNewShare ($ shareWith , $ shareId , $ sharedByFederatedId , $ sharedBy , $ roomName , $ roomToken , $ remote );
150
151
return $ shareId ;
0 commit comments