From 850bfacfbb28f083c1b29be1a164b5dfaa366739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 27 Jul 2014 22:21:49 +0200 Subject: [PATCH] Add class 'mod' to user if he's got moderative permissions in the room --- file/js/be.bastelstu.Chat.litcoffee | 6 ++++++ file/lib/page/NewMessagesPage.class.php | 1 + 2 files changed, 7 insertions(+) diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index e705018..5da3c4a 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -720,6 +720,11 @@ Move the user to the new position if he was found in the old list. else element.removeClass 'suspended' + if user.mod + element.addClass 'mod' + else + element.removeClass 'mod' + $('#timsChatUserList > ul').append element Build HTML of the user and insert it into the list, if the users was not found in the chat before. @@ -732,6 +737,7 @@ Build HTML of the user and insert it into the list, if the users was not found i li.addClass 'jsTooltip' li.addClass 'you' if user.userID is WCF.User.userID li.addClass 'suspended' if user.suspended + li.addClass 'mod' if user.mod if user.awayStatus? li.addClass 'away' li.attr 'title', user.awayStatus diff --git a/file/lib/page/NewMessagesPage.class.php b/file/lib/page/NewMessagesPage.class.php index 0d1d7cf..0a2925f 100644 --- a/file/lib/page/NewMessagesPage.class.php +++ b/file/lib/page/NewMessagesPage.class.php @@ -122,6 +122,7 @@ public function show() { 'username' => $user->username, 'awayStatus' => $user->chatAway, 'suspended' => (boolean) !$this->room->canWrite($user->getDecoratedObject()), + 'mod' => $this->room->canBan($user->getDecoratedObject()) || $this->room->canMute($user->getDecoratedObject()), 'avatar' => array( 16 => $user->getAvatar()->getImageTag(16), 24 => $user->getAvatar()->getImageTag(24),