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:
parent
d45c8e3a63
commit
dcd72ef7e1
@ -356,6 +356,11 @@ window.console ?=
|
||||
element.removeClass 'timsChatAway'
|
||||
element.removeAttr 'title'
|
||||
element.data 'tooltip', ''
|
||||
if user.suspended
|
||||
element.addClass 'suspended'
|
||||
else
|
||||
element.removeClass 'suspended'
|
||||
|
||||
$('#timsChatUserList').append element
|
||||
# Insert the user
|
||||
else
|
||||
@ -365,6 +370,7 @@ window.console ?=
|
||||
li.addClass 'timsChatUser'
|
||||
li.addClass 'jsTooltip'
|
||||
li.addClass 'you' if user.userID is WCF.User.userID
|
||||
li.addClass 'suspended' if user.suspended
|
||||
if user.awayStatus?
|
||||
li.addClass 'timsChatAway'
|
||||
li.attr 'title', user.awayStatus
|
||||
|
@ -159,10 +159,10 @@ public function show() {
|
||||
}
|
||||
foreach ($this->users as $user) {
|
||||
$json['users'][] = array(
|
||||
'userID' => $user->userID,
|
||||
'userID' => (int) $user->userID,
|
||||
'username' => $user->username,
|
||||
'awayStatus' => $user->awayStatus,
|
||||
'suspended' => !$this->room->canWrite($user)
|
||||
'suspended' => (boolean) !$this->room->canWrite($user)
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user