diff --git a/classes/Notice.php b/classes/Notice.php index c5c07e6d19..22796abcfa 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1732,7 +1732,6 @@ class Notice extends Managed_DataObject function sendReplyNotifications() { // Don't send reply notifications for repeats - if ($this->isRepeat()) { return array(); } @@ -1742,9 +1741,11 @@ class Notice extends Managed_DataObject require_once INSTALLDIR.'/lib/mail.php'; foreach ($recipientIds as $recipientId) { - $user = User::getKV('id', $recipientId); - if ($user instanceof User) { + try { + $user = User::getByID($recipientId); mail_notify_attn($user, $this); + } catch (NoResultException $e) { + // No such user } } Event::handle('EndNotifyMentioned', array($this, $recipientIds)); diff --git a/lib/activityhandlerplugin.php b/lib/activityhandlerplugin.php index 967454bad5..d22b4d2f44 100644 --- a/lib/activityhandlerplugin.php +++ b/lib/activityhandlerplugin.php @@ -233,6 +233,9 @@ abstract class ActivityHandlerPlugin extends Plugin protected function notifyMentioned(Notice $stored, array &$mentioned_ids) { // pass through silently by default + + // If we want to stop any other plugin from notifying based on this activity, return false instead. + return true; } /** @@ -305,10 +308,7 @@ abstract class ActivityHandlerPlugin extends Plugin return true; } - $this->notifyMentioned($stored, $mentioned_ids); - - // If it was _our_ notice, only we should do anything with the mentions. - return false; + return $this->notifyMentioned($stored, $mentioned_ids); } /** diff --git a/lib/mail.php b/lib/mail.php index a5e9efded1..2076476f87 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -30,9 +30,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } require_once 'Mail.php';