Notification mails are sent again fixes ssue #99
The problem was that the ActivityVerbPostPlugin handled 'post' verbs but didn't handle the notifications for them, so now we're returning true in the event so the default behaviour (sending to 'getReplies' recipients) is done by default.
This commit is contained in:
parent
ad5d5f8054
commit
998db39b1a
|
@ -1732,7 +1732,6 @@ class Notice extends Managed_DataObject
|
||||||
function sendReplyNotifications()
|
function sendReplyNotifications()
|
||||||
{
|
{
|
||||||
// Don't send reply notifications for repeats
|
// Don't send reply notifications for repeats
|
||||||
|
|
||||||
if ($this->isRepeat()) {
|
if ($this->isRepeat()) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
@ -1742,9 +1741,11 @@ class Notice extends Managed_DataObject
|
||||||
require_once INSTALLDIR.'/lib/mail.php';
|
require_once INSTALLDIR.'/lib/mail.php';
|
||||||
|
|
||||||
foreach ($recipientIds as $recipientId) {
|
foreach ($recipientIds as $recipientId) {
|
||||||
$user = User::getKV('id', $recipientId);
|
try {
|
||||||
if ($user instanceof User) {
|
$user = User::getByID($recipientId);
|
||||||
mail_notify_attn($user, $this);
|
mail_notify_attn($user, $this);
|
||||||
|
} catch (NoResultException $e) {
|
||||||
|
// No such user
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Event::handle('EndNotifyMentioned', array($this, $recipientIds));
|
Event::handle('EndNotifyMentioned', array($this, $recipientIds));
|
||||||
|
|
|
@ -233,6 +233,9 @@ abstract class ActivityHandlerPlugin extends Plugin
|
||||||
protected function notifyMentioned(Notice $stored, array &$mentioned_ids)
|
protected function notifyMentioned(Notice $stored, array &$mentioned_ids)
|
||||||
{
|
{
|
||||||
// pass through silently by default
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->notifyMentioned($stored, $mentioned_ids);
|
return $this->notifyMentioned($stored, $mentioned_ids);
|
||||||
|
|
||||||
// If it was _our_ notice, only we should do anything with the mentions.
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -30,9 +30,7 @@
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('STATUSNET') && !defined('LACONICA')) {
|
if (!defined('GNUSOCIAL')) { exit(1); }
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once 'Mail.php';
|
require_once 'Mail.php';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue