Merge "(bug 46046) Notification should not be created for anon users"

This commit is contained in:
Kaldari 2013-03-15 00:33:49 +00:00 committed by Gerrit Code Review
commit 6e8aa9b808
2 changed files with 8 additions and 1 deletions

View file

@ -204,6 +204,12 @@ class EchoNotificationController {
foreach ( $subscriptions as $subscription ) {
$user = $subscription->getUser();
// Notification should not be sent to anonymous user
if ( $user->isAnon() ) {
continue;
}
$notifyTypes = $subscription->getNotificationTypes();
$notifyTypes = array_keys( array_filter( $notifyTypes ) );

View file

@ -112,8 +112,9 @@ abstract class EchoDiscussionParser {
// 1. the user name is not valid
// 2. the user mentions themselves
// 3. the user is the owner of the talk page
// 4. user is anonymous
if (
!$user || $user->getId() == $revision->getUser() ||
!$user || $user->isAnon() || $user->getId() == $revision->getUser() ||
( $title->getNamespace() === NS_USER_TALK && $title->getDBkey() === $dbk )
) {
continue;