Code Duplication    Length = 10-12 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 2 locations

@@ 390-399 (lines=10) @@
387
	 * @throws ShareNotFound
388
	 * @throws \OC\HintException
389
	 */
390
	protected function sendPermissionUpdate(IShare $share) {
391
		$remoteId = $this->getRemoteId($share);
392
		// if the local user is the owner we send the permission change to the initiator
393
		if ($this->userManager->userExists($share->getShareOwner())) {
394
			list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
395
		} else { // ... if not we send the permission change to the owner
396
			list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
397
		}
398
		$this->notifications->sendPermissionChange($remote, $remoteId, $share->getToken(), $share->getPermissions());
399
	}
400
401
402
	/**
@@ 535-546 (lines=12) @@
532
	 * @throws ShareNotFound
533
	 * @throws \OC\HintException
534
	 */
535
	protected function revokeShare($share, $isOwner) {
536
		// also send a unShare request to the initiator, if this is a different user than the owner
537
		if ($share->getShareOwner() !== $share->getSharedBy()) {
538
			if ($isOwner) {
539
				list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
540
			} else {
541
				list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
542
			}
543
			$remoteId = $this->getRemoteId($share);
544
			$this->notifications->sendRevokeShare($remote, $remoteId, $share->getToken());
545
		}
546
	}
547
548
	/**
549
	 * remove share from table