Code Duplication    Length = 10-12 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 2 locations

@@ 369-378 (lines=10) @@
366
	 * @throws ShareNotFound
367
	 * @throws \OC\HintException
368
	 */
369
	protected function sendPermissionUpdate(IShare $share) {
370
		$remoteId = $this->getRemoteId($share);
371
		// if the local user is the owner we send the permission change to the initiator
372
		if ($this->userManager->userExists($share->getShareOwner())) {
373
			list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
374
		} else { // ... if not we send the permission change to the owner
375
			list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
376
		}
377
		$this->notifications->sendPermissionChange($remote, $remoteId, $share->getToken(), $share->getPermissions());
378
	}
379
380
381
	/**
@@ 514-525 (lines=12) @@
511
	 * @throws ShareNotFound
512
	 * @throws \OC\HintException
513
	 */
514
	protected function revokeShare($share, $isOwner) {
515
		// also send a unShare request to the initiator, if this is a different user than the owner
516
		if ($share->getShareOwner() !== $share->getSharedBy()) {
517
			if ($isOwner) {
518
				list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
519
			} else {
520
				list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
521
			}
522
			$remoteId = $this->getRemoteId($share);
523
			$this->notifications->sendRevokeShare($remote, $remoteId, $share->getToken());
524
		}
525
	}
526
527
	/**
528
	 * remove share from table