Code Duplication    Length = 14-15 lines in 2 locations

apps/federatedfilesharing/lib/FedShareManager.php 2 locations

@@ 83-96 (lines=14) @@
80
	 * @throws \OCP\Files\InvalidPathException
81
	 * @throws \OCP\Files\NotFoundException
82
	 */
83
	public function acceptShare(IShare $share) {
84
		$uid = $this->getCorrectUid($share);
85
		$fileId = $share->getNode()->getId();
86
		list($file, $link) = $this->getFile($uid, $fileId);
87
		$this->publishActivity(
88
			$uid,
89
			Activity::SUBJECT_REMOTE_SHARE_ACCEPTED,
90
			[$share->getSharedWith(), \basename($file)],
91
			'files',
92
			$fileId,
93
			$file,
94
			$link
95
		);
96
	}
97
98
	/**
99
	 * Delete declined share and create a activity
@@ 106-120 (lines=15) @@
103
	 * @throws \OCP\Files\InvalidPathException
104
	 * @throws \OCP\Files\NotFoundException
105
	 */
106
	public function declineShare(IShare $share) {
107
		$uid = $this->getCorrectUid($share);
108
		$fileId = $share->getNode()->getId();
109
		$this->federatedShareProvider->removeShareFromTable($share);
110
		list($file, $link) = $this->getFile($uid, $fileId);
111
		$this->publishActivity(
112
			$uid,
113
			Activity::SUBJECT_REMOTE_SHARE_DECLINED,
114
			[$share->getSharedWith(), \basename($file)],
115
			'files',
116
			$fileId,
117
			$file,
118
			$link
119
		);
120
	}
121
122
	/**
123
	 * Publish a new activity