1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2025-01-09 00:20:08 +00:00

Properly handle suspended status in JS and fix "you"

This commit is contained in:
Tim Düsterhus 2012-10-19 17:49:56 +02:00
parent d45c8e3a63
commit dcd72ef7e1
2 changed files with 8 additions and 2 deletions

View File

@ -356,6 +356,11 @@ window.console ?=
element.removeClass 'timsChatAway' element.removeClass 'timsChatAway'
element.removeAttr 'title' element.removeAttr 'title'
element.data 'tooltip', '' element.data 'tooltip', ''
if user.suspended
element.addClass 'suspended'
else
element.removeClass 'suspended'
$('#timsChatUserList').append element $('#timsChatUserList').append element
# Insert the user # Insert the user
else else
@ -365,6 +370,7 @@ window.console ?=
li.addClass 'timsChatUser' li.addClass 'timsChatUser'
li.addClass 'jsTooltip' li.addClass 'jsTooltip'
li.addClass 'you' if user.userID is WCF.User.userID li.addClass 'you' if user.userID is WCF.User.userID
li.addClass 'suspended' if user.suspended
if user.awayStatus? if user.awayStatus?
li.addClass 'timsChatAway' li.addClass 'timsChatAway'
li.attr 'title', user.awayStatus li.attr 'title', user.awayStatus

View File

@ -159,10 +159,10 @@ public function show() {
} }
foreach ($this->users as $user) { foreach ($this->users as $user) {
$json['users'][] = array( $json['users'][] = array(
'userID' => $user->userID, 'userID' => (int) $user->userID,
'username' => $user->username, 'username' => $user->username,
'awayStatus' => $user->awayStatus, 'awayStatus' => $user->awayStatus,
'suspended' => !$this->room->canWrite($user) 'suspended' => (boolean) !$this->room->canWrite($user)
); );
} }