Mainframe98 has uploaded a new change for review. ( 
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.

Depends-On: Iea20bad42abf2e1f966b835c6965aa1fd67fa92d
Change-Id: I373706e346995e33c747e0599285460ff4284fbc
---
M HAWelcome.class.php
M README
2 files changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/HAWelcome 
refs/changes/55/386255/1

diff --git a/HAWelcome.class.php b/HAWelcome.class.php
index 7b6d428..9013a4a 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.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I373706e346995e33c747e0599285460ff4284fbc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/HAWelcome
Gerrit-Branch: master
Gerrit-Owner: Mainframe98 <[email protected]>

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

Reply via email to