UltrasonicNXT has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/158944

Change subject: When a user is blocked, ban them from chat.
......................................................................

When a user is blocked, ban them from chat.

Suggested by Krusher

Also some changes for JSlint

Change-Id: I76e84cdb29bbc8645e701776b9c89d8a4949fd75
---
M MediaWikiChat.js
M Send.api.php
M SendPM.api.php
3 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiChat 
refs/changes/44/158944/1

diff --git a/MediaWikiChat.js b/MediaWikiChat.js
index a819c04..b34dd2c 100644
--- a/MediaWikiChat.js
+++ b/MediaWikiChat.js
@@ -25,7 +25,7 @@
        },
 
        ie: function() {
-               return navigator.appVersion.indexOf( "MSIE" ) != -1;
+               return navigator.appVersion.indexOf( 'MSIE' ) != -1;
        },
 
        unique: function( array ) {
@@ -158,9 +158,9 @@
                        MediaWikiChat.doUsers( onlineUsers );
 
                        for ( var userId in data.users ) { // has to be done 
after doUsers
-                               user = MediaWikiChat.userData[userId];
+                               var user = MediaWikiChat.userData[userId];
                                if ( user.id != mw.config.get( 'wgUserId' ) ) {
-                                       userE = MediaWikiChat.safe( user.name );
+                                       var userE = MediaWikiChat.safe( 
user.name );
                                        MediaWikiChat.greyscale( $( 
'#mwchat-users #' + userE ), user.away );
                                }
                        }
@@ -427,9 +427,9 @@
                });
 
                if ( allusers.length ){
-                       $( "#mwchat-no-other-users" ).hide();
+                       $( '#mwchat-no-other-users' ).hide();
                } else {
-                       $( "#mwchat-no-other-users" ).show();
+                       $( '#mwchat-no-other-users' ).show();
                }
 
                MediaWikiChat.users = newusers;
diff --git a/Send.api.php b/Send.api.php
index 8924b32..11bebb2 100644
--- a/Send.api.php
+++ b/Send.api.php
@@ -8,7 +8,7 @@
                $result = $this->getResult();
                $user = $this->getUser();
 
-               if ( $user->isAllowed( 'chat' ) ) {
+               if ( $user->isAllowed( 'chat' ) && !$user->isBlocked() ) {
                        $originalMessage = $this->getMain()->getVal( 'message' 
);
                        $message = MediaWikiChat::parseMessage( 
$originalMessage );
 
diff --git a/SendPM.api.php b/SendPM.api.php
index 1f72a0e..57b6080 100644
--- a/SendPM.api.php
+++ b/SendPM.api.php
@@ -6,7 +6,7 @@
                $result = $this->getResult();
                $user = $this->getUser();
 
-               if ( $user->isAllowed( 'chat' ) ) {
+               if ( $user->isAllowed( 'chat' ) && !$user->isBlocked() ) {
                        $toId = intval( $this->getMain()->getVal( 'id' ) );
 
                        $originalMessage = $this->getMain()->getVal( 'message' 
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76e84cdb29bbc8645e701776b9c89d8a4949fd75
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

Reply via email to