summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-08-20 14:37:41 +0200
committerGitHub <noreply@github.com>2018-08-20 14:37:41 +0200
commit9cf11bd73cd8e35c700149779d9f0d923225acd8 (patch)
treea3b0c74b2bf2cbd86ec88614fb50c33a0c4d323e /settings
parente33670ebcdca2c5234247533069cd82ee1b0638e (diff)
parent2b903aa267a1969edea945538ac778a008ea7955 (diff)
downloadnextcloud-server-9cf11bd73cd8e35c700149779d9f0d923225acd8.tar.gz
nextcloud-server-9cf11bd73cd8e35c700149779d9f0d923225acd8.zip
Merge pull request #10687 from nextcloud/fix/noid/false-positive-change-mention
don't blame randome people for background email updates
Diffstat (limited to 'settings')
-rw-r--r--settings/Hooks.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/settings/Hooks.php b/settings/Hooks.php
index 097d708a36a..f2b9e4fd086 100644
--- a/settings/Hooks.php
+++ b/settings/Hooks.php
@@ -165,6 +165,7 @@ class Hooks {
$actor = $this->userSession->getUser();
if ($actor instanceof IUser) {
+ $subject = Provider::EMAIL_CHANGED_SELF;
if ($actor->getUID() !== $user->getUID()) {
$this->l = $this->languageFactory->get(
'settings',
@@ -173,15 +174,11 @@ class Hooks {
$this->config->getSystemValue('default_language', 'en')
)
);
-
- $text = $this->l->t('%1$s changed your email address on %2$s.', [$actor->getDisplayName(), $instanceUrl]);
- $event->setAuthor($actor->getUID())
- ->setSubject(Provider::EMAIL_CHANGED_BY, [$actor->getUID()]);
- } else {
- $text = $this->l->t('Your email address on %s was changed.', [$instanceUrl]);
- $event->setAuthor($actor->getUID())
- ->setSubject(Provider::EMAIL_CHANGED_SELF);
+ $subject = Provider::EMAIL_CHANGED;
}
+ $text = $this->l->t('Your email address on %s was changed.', [$instanceUrl]);
+ $event->setAuthor($actor->getUID())
+ ->setSubject($subject);
} else {
$text = $this->l->t('Your email address on %s was changed by an administrator.', [$instanceUrl]);
$event->setSubject(Provider::EMAIL_CHANGED);