From d11ce2ef3b7967dfe71e1f7b2eeb31f7d64618d6 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sun, 27 Jul 2014 23:25:49 +0200 Subject: [PATCH] Consistently use "email-notify_fave" syntax for preference --- lib/mail.php | 2 +- plugins/Favorite/FavoritePlugin.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mail.php b/lib/mail.php index 39714c5fc0..507b9254d3 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -683,7 +683,7 @@ function mail_notify_fave(User $rcpt, Profile $sender, Notice $notice) return; } - if (!$rcpt->getPref('notify', 'email_fave', 1)) { + if (!$rcpt->getPref('email', 'notify_fave', 1)) { return; } diff --git a/plugins/Favorite/FavoritePlugin.php b/plugins/Favorite/FavoritePlugin.php index 062b2147ce..82409d23f7 100644 --- a/plugins/Favorite/FavoritePlugin.php +++ b/plugins/Favorite/FavoritePlugin.php @@ -25,7 +25,7 @@ if (!defined('GNUSOCIAL')) { exit(1); } */ class FavoritePlugin extends ActivityHandlerPlugin { - protected $notify_email_fave = 1; + protected $email_notify_fave = 1; public function tag() { @@ -211,7 +211,7 @@ class FavoritePlugin extends ActivityHandlerPlugin foreach ($mentioned_ids as $id) { $mentioned = User::getKV('id', $id); if ($mentioned instanceof User && $mentioned->id != $stored->profile_id - && $mentioned->email && $mentioned->getPref('email', 'notify_fave', $this->notify_email_fave)) { // do we have an email, and does user want it? + && $mentioned->email && $mentioned->getPref('email', 'notify_fave', $this->email_notify_fave)) { // do we have an email, and does user want it? mail_notify_fave($mentioned, $stored->getProfile(), $stored->getParent()); } } @@ -409,7 +409,7 @@ class FavoritePlugin extends ActivityHandlerPlugin { // getConfigData will fall back on systemwide default // and we only wish to save numerical true or false. - $emailfave = $scoped->getPref('email', 'notify_fave', $this->notify_email_fave) ? 1 : 0; + $emailfave = $scoped->getPref('email', 'notify_fave', $this->email_notify_fave) ? 1 : 0; $action->elementStart('li'); $action->checkbox('email-notify_fave', -- 2.39.5