Code Duplication    Length = 6-6 lines in 3 locations

lib/private/Share20/Manager.php 1 location

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

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);