Code Duplication    Length = 10-12 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 2 locations

@@ 379-388 (lines=10) @@
376
	 * @throws ShareNotFound
377
	 * @throws \OC\HintException
378
	 */
379
	protected function sendPermissionUpdate(IShare $share) {
380
		$remoteId = $this->getRemoteId($share);
381
		// if the local user is the owner we send the permission change to the initiator
382
		if ($this->userManager->userExists($share->getShareOwner())) {
383
			list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
384
		} else { // ... if not we send the permission change to the owner
385
			list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
386
		}
387
		$this->notifications->sendPermissionChange($remote, $remoteId, $share->getToken(), $share->getPermissions());
388
	}
389
390
	/**
391
	 * update successful reShare with the correct token
@@ 522-533 (lines=12) @@
519
	 * @throws ShareNotFound
520
	 * @throws \OC\HintException
521
	 */
522
	protected function revokeShare($share, $isOwner) {
523
		// also send a unShare request to the initiator, if this is a different user than the owner
524
		if ($share->getShareOwner() !== $share->getSharedBy()) {
525
			if ($isOwner) {
526
				list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
527
			} else {
528
				list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
529
			}
530
			$remoteId = $this->getRemoteId($share);
531
			$this->notifications->sendRevokeShare($remote, $remoteId, $share->getToken());
532
		}
533
	}
534
535
	/**
536
	 * remove share from table