Jack Phoenix has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/386255 )

Change subject: Integrate Automatic Board Welcome functionality
......................................................................


Integrate Automatic Board Welcome functionality

Suggested in the dependency linked. It is toggeable by adding
board-welcome to welcome-enabled.

Bug: T178939
Depends-On: Iea20bad42abf2e1f966b835c6965aa1fd67fa92d
Change-Id: I373706e346995e33c747e0599285460ff4284fbc
---
M HAWelcome.class.php
M README
M extension.json
3 files changed, 24 insertions(+), 1 deletion(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/HAWelcome.class.php b/HAWelcome.class.php
index 7b6d428..b88718d 100644
--- a/HAWelcome.class.php
+++ b/HAWelcome.class.php
@@ -120,6 +120,27 @@
                                                                
wfEscapeWikiText( $this->mUser->getName() )
                                                        )->text();
                                                }
+
+                                               $msgObj = wfMessage( 
'user-board-welcome-message' )->inContentLanguage();
+                                               // Send a welcome message on 
UserBoard provided it's installed and enabled
+                                               if (
+                                                       class_exists( 
'UserBoard' ) &&
+                                                       $this->isEnabled( 
'board-welcome' ) &&
+                                                       !$msgObj->isDisabled()
+                                               ) {
+                                                       // Send the message
+                                                       $board = new 
UserBoard();
+                                                       
$board->sendBoardMessage(
+                                                               
$this->mSysop->getId(), // sender's UID
+                                                               
$this->mSysop->getName(), // sender's name
+                                                               
$this->mUser->getId(),
+                                                               
$this->mUser->getName(),
+                                                               // passing the 
senderName as an argument here so that we can do
+                                                               // stuff like 
[[User talk:$1|contact me]] or w/e in the message
+                                                               
$msgObj->params( $this->mSysop->getName() )->parse()
+                                                       // the final argument 
is message type: 0 (default) for public
+                                                       );
+                                               }
                                        }
 
                                        if ( $welcomeMsg ) {
diff --git a/README b/README
index ee2d919..11b1a91 100644
--- a/README
+++ b/README
@@ -18,6 +18,7 @@
 ** page-user - Create a user page for a registered user. The content of the 
user page is controlled by the message welcome-user-page
 ** message-anon - Leave welcome messages for anonymous users. The content of 
the message is controlled by the message welcome-message-anon
 ** message-user - Leave welcome messages for registered users. The content of 
the message is controlled by the message welcome-message-user
+** board-welcome - Leave a welcome message on the UserBoard. The content of 
the message is controlled by the message user-board-welcome-message
 
 == User rights ==
 There is one user right, assigned to the groups bot, staff, sysop and 
bureaucrat by default: welcomeexempt. Users with this right will not receive a 
message or have their user page created when they make their first edit. This 
feature was backported from Wikia.
@@ -26,6 +27,7 @@
 * When the user rights are changed, and the user is the last active sysop, the 
cached value will be removed from cache. Tweaked to only remove the cache entry 
when the group sysop is removed. This feature was backported from Wikia.
 * When GlobalUserrights is installed, the global user groups table will too be 
checked for staff users.
 * When SocialProfile is installed, and the user has opted to use the social 
profile, the user page will be created in the UserWiki: namespace rather than 
the User: namespace.
+* When SocialProfile is installed, a message can be left on the UserBoard.
 
 == Known limitations ==
 * Structured Discussions nor LiquidThreads are not supported. No welcome 
message will be left on the talk page of users with a Structured Discussions or 
LiquidThreads talk page.
diff --git a/extension.json b/extension.json
index 91ae477..17e68ba 100644
--- a/extension.json
+++ b/extension.json
@@ -1,7 +1,7 @@
 {
        "name": "Highly Automated Welcome Tool",
        "namemsg": "welcome-user-name",
-       "version": "0.7.0",
+       "version": "0.7.1",
        "author": [
                "Krzysztof Krzyżaniak",
                "Maciej Błaszkowski",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I373706e346995e33c747e0599285460ff4284fbc
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/HAWelcome
Gerrit-Branch: master
Gerrit-Owner: Mainframe98 <[email protected]>
Gerrit-Reviewer: Isarra <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Lewis Cawte <[email protected]>
Gerrit-Reviewer: SamanthaNguyen <[email protected]>

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

Reply via email to