JoHammer has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354937 )

Change subject: Notify user if sub-page of user-discussion is modified
......................................................................

Notify user if sub-page of user-discussion is modified

Bug: T5234
Change-Id: Id3a903d131fa6ae844082492bb393eac023e0e48
---
M includes/DiscussionParser.php
M includes/UserLocator.php
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/37/354937/1

diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php
index 3759af0..5b0120d 100644
--- a/includes/DiscussionParser.php
+++ b/includes/DiscussionParser.php
@@ -69,7 +69,7 @@
                }
 
                if ( $title->getNamespace() == NS_USER_TALK ) {
-                       $notifyUser = User::newFromName( $title->getText() );
+                       $notifyUser = User::newFromName( $title->getRootText() 
);
                        // If the recipient is a valid non-anonymous user and 
hasn't turned
                        // off their notifications, generate a talk page post 
Echo notification.
                        if ( $notifyUser && $notifyUser->getId() ) {
@@ -277,7 +277,7 @@
         * Set of arrays containing valid mentions and possible intended but 
failed mentions.
         * - [validMentions]: An array of valid users to mention with ID => ID.
         * - [unknownUsers]: An array of DBKey strings representing unknown 
users.
-        * - [anonymousUsers]: An array of DBKey strings representing anonymous 
IP users.
+        * - [validMentions]: An array of DBKey strings representing anonymous 
IP users.
         */
        private static function getUserMentions( Title $title, $revisionUserId, 
array $userLinks ) {
                global $wgEchoMaxMentionsCount;
diff --git a/includes/UserLocator.php b/includes/UserLocator.php
index 286ded2..76ae652 100644
--- a/includes/UserLocator.php
+++ b/includes/UserLocator.php
@@ -51,7 +51,7 @@
                        return [];
                }
 
-               $user = User::newFromName( $title->getDBkey() );
+               $user = User::newFromName( $title->getRootText() );
                if ( $user && !$user->isAnon() ) {
                        return [ $user->getId() => $user ];
                } else {

-- 
To view, visit https://gerrit.wikimedia.org/r/354937
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id3a903d131fa6ae844082492bb393eac023e0e48
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: JoHammer <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to