Code Duplication    Length = 10-12 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 2 locations

@@ 406-415 (lines=10) @@
403
	 * @throws ShareNotFound
404
	 * @throws \OC\HintException
405
	 */
406
	protected function sendPermissionUpdate(IShare $share) {
407
		$remoteId = $this->getRemoteId($share);
408
		// if the local user is the owner we send the permission change to the initiator
409
		if ($this->userManager->userExists($share->getShareOwner())) {
410
			list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
411
		} else { // ... if not we send the permission change to the owner
412
			list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
413
		}
414
		$this->notifications->sendPermissionChange($remote, $remoteId, $share->getToken(), $share->getPermissions());
415
	}
416
417
418
	/**
@@ 541-552 (lines=12) @@
538
	 * @throws ShareNotFound
539
	 * @throws \OC\HintException
540
	 */
541
	protected function revokeShare($share, $isOwner) {
542
		// also send a unShare request to the initiator, if this is a different user than the owner
543
		if ($share->getShareOwner() !== $share->getSharedBy()) {
544
			if ($isOwner) {
545
				list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
546
			} else {
547
				list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
548
			}
549
			$remoteId = $this->getRemoteId($share);
550
			$this->notifications->sendRevokeShare($remote, $remoteId, $share->getToken());
551
		}
552
	}
553
554
	/**
555
	 * remove share from table