UltrasonicNXT has uploaded a new change for review. https://gerrit.wikimedia.org/r/101222
Change subject: Show different messages to blocked users and anons ...................................................................... Show different messages to blocked users and anons The same message was being shown to users who were blocked as to users who were anons, and simply not allowed to chat. https://github.com/Brickimedia/brickimedia/issues/128 Change-Id: Ieb6ca5bff044d199e714f26952621b92b8fabcba --- M MediaWikiChat.i18n.php M SpecialChat.php 2 files changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiChat refs/changes/22/101222/1 diff --git a/MediaWikiChat.i18n.php b/MediaWikiChat.i18n.php index 6b1a8e6..ac135bc 100644 --- a/MediaWikiChat.i18n.php +++ b/MediaWikiChat.i18n.php @@ -17,6 +17,7 @@ 'chat-type-your-private-message' => 'Type your private message', 'chat-no-other-users' => 'No other users on chat', 'chat-blocked-from-chat' => 'You have been blocked from this chat.', + 'chat-not-allowed' => 'You are not allowed to chat, try logging in first', 'chat-just-now' => 'just now', 'chat-a-minute-ago' => 'a minute ago', 'chat-quarter-of-an-hour-ago' => 'quarter of an hour ago', @@ -69,6 +70,7 @@ $messages['qqq'] = array( 'chat' => 'Important! This is the string that appears on Special:SpecialPages', 'chat-desc' => '{{desc}}', + 'chat-not-allowed' => 'Message shown to users who are not in the groups required to chat (normally users who are not logged in)', 'log-name-chat' => 'Name of the chat log as it appears on the drop-down menu on [[Special:Log]]', 'log-show-hide-chat' => 'For [[Special:Log]]. Parameters: * $1 - {{int:show}} or {{int:hide}}', diff --git a/SpecialChat.php b/SpecialChat.php index 008ffe3..bff1272 100644 --- a/SpecialChat.php +++ b/SpecialChat.php @@ -21,7 +21,12 @@ $this->setHeaders(); if ( !$this->getUser()->isAllowed( 'chat' ) ) { - $out->addWikiMsg( 'chat-blocked-from-chat' ); + $groups = $this->getUser->getGroups(); + if ( in_array( 'blockedfromchat', $groups ) ) { + $out->addWikiMsg( 'chat-blocked-from-chat' ); + } else { + $out->addWikiMsg( 'chat-not-allowed' ); + } } else { // Load modules via ResourceLoader -- To view, visit https://gerrit.wikimedia.org/r/101222 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb6ca5bff044d199e714f26952621b92b8fabcba Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MediaWikiChat Gerrit-Branch: master Gerrit-Owner: UltrasonicNXT <adamr_car...@btinternet.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits