| @@ 215-229 (lines=15) @@ | ||
| 212 | * @throws \OCP\Files\InvalidPathException  | 
                                |
| 213 | * @throws \OCP\Files\NotFoundException  | 
                                |
| 214 | */  | 
                                |
| 215 | 	public function acceptShare(IShare $share) { | 
                                |
| 216 | $uid = $this->getCorrectUid($share);  | 
                                |
| 217 | $fileId = $share->getNode()->getId();  | 
                                |
| 218 | list($file, $link) = $this->getFile($uid, $fileId);  | 
                                |
| 219 | $this->publishActivity(  | 
                                |
| 220 | $uid,  | 
                                |
| 221 | Activity::SUBJECT_REMOTE_SHARE_ACCEPTED,  | 
                                |
| 222 | [$share->getSharedWith(), \basename($file)],  | 
                                |
| 223 | 'files',  | 
                                |
| 224 | $fileId,  | 
                                |
| 225 | $file,  | 
                                |
| 226 | $link  | 
                                |
| 227 | );  | 
                                |
| 228 | $this->notifyRemote($share, [$this->notifications, 'sendAcceptShare']);  | 
                                |
| 229 | }  | 
                                |
| 230 | ||
| 231 | /**  | 
                                |
| 232 | * Delete declined share and create a activity  | 
                                |
| @@ 239-254 (lines=16) @@ | ||
| 236 | * @throws \OCP\Files\InvalidPathException  | 
                                |
| 237 | * @throws \OCP\Files\NotFoundException  | 
                                |
| 238 | */  | 
                                |
| 239 | 	public function declineShare(IShare $share) { | 
                                |
| 240 | $this->notifyRemote($share, [$this->notifications, 'sendDeclineShare']);  | 
                                |
| 241 | $uid = $this->getCorrectUid($share);  | 
                                |
| 242 | $fileId = $share->getNode()->getId();  | 
                                |
| 243 | $this->federatedShareProvider->removeShareFromTable($share);  | 
                                |
| 244 | list($file, $link) = $this->getFile($uid, $fileId);  | 
                                |
| 245 | $this->publishActivity(  | 
                                |
| 246 | $uid,  | 
                                |
| 247 | Activity::SUBJECT_REMOTE_SHARE_DECLINED,  | 
                                |
| 248 | [$share->getSharedWith(), \basename($file)],  | 
                                |
| 249 | 'files',  | 
                                |
| 250 | $fileId,  | 
                                |
| 251 | $file,  | 
                                |
| 252 | $link  | 
                                |
| 253 | );  | 
                                |
| 254 | }  | 
                                |
| 255 | ||
| 256 | /**  | 
                                |
| 257 | * Unshare an item from self  | 
                                |