Code Duplication    Length = 10-12 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 2 locations

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