Code Duplication    Length = 6-6 lines in 3 locations

apps/sharebymail/lib/ShareByMailProvider.php 2 locations

@@ 432-437 (lines=6) @@
429
		// The "Reply-To" is set to the sharer if an mail address is configured
430
		// also the default footer contains a "Do not reply" which needs to be adjusted.
431
		$initiatorEmail = $initiatorUser->getEMailAddress();
432
		if($initiatorEmail !== null) {
433
			$message->setReplyTo([$initiatorEmail => $initiatorDisplayName]);
434
			$emailTemplate->addFooter($instanceName . ($this->defaults->getSlogan() !== '' ? ' - ' . $this->defaults->getSlogan() : ''));
435
		} else {
436
			$emailTemplate->addFooter();
437
		}
438
439
		$message->useTemplate($emailTemplate);
440
		$this->mailer->send($message);
@@ 493-498 (lines=6) @@
490
			]
491
		);
492
		$message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
493
		if ($initiatorEmailAddress !== null) {
494
			$message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]);
495
			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
496
		} else {
497
			$emailTemplate->addFooter();
498
		}
499
500
		$message->setTo([$shareWith]);
501
		$message->useTemplate($emailTemplate);

lib/private/Share20/Manager.php 1 location

@@ 767-772 (lines=6) @@
764
		// The "Reply-To" is set to the sharer if an mail address is configured
765
		// also the default footer contains a "Do not reply" which needs to be adjusted.
766
		$initiatorEmail = $initiatorUser->getEMailAddress();
767
		if($initiatorEmail !== null) {
768
			$message->setReplyTo([$initiatorEmail => $initiatorDisplayName]);
769
			$emailTemplate->addFooter($instanceName . ($this->defaults->getSlogan() !== '' ? ' - ' . $this->defaults->getSlogan() : ''));
770
		} else {
771
			$emailTemplate->addFooter();
772
		}
773
774
		$message->useTemplate($emailTemplate);
775
		$this->mailer->send($message);