fix offline users on search

pull/7748/head
Guilherme Gazzo 8 years ago
parent 0392572b98
commit 24ab3c50bd
No known key found for this signature in database
GPG Key ID: 1F85C9AD922D0829
  1. 38
      packages/rocketchat-ui-sidenav/client/chatRoomItem.js

@ -27,26 +27,30 @@ Template.chatRoomItem.helpers({
}
let statusClass = false;
let status = 'offline';
if (this.t === 'd') {
switch (RocketChat.roomTypes.getUserStatus(this.t, this.rid)) {
case 'online':
statusClass = 'general-success-background';
break;
case 'away':
statusClass = 'general-pending-background';
break;
case 'busy':
statusClass = 'general-error-background';
break;
case 'offline':
statusClass = 'general-inactive-background';
break;
default:
statusClass = 'general-inactive-background';
}
status = Session.get(`user_${ this.name }_status`);
} else {
status = RocketChat.roomTypes.getUserStatus(this.t, this.rid);
}
switch (status) {
case 'online':
statusClass = 'general-success-background';
break;
case 'away':
statusClass = 'general-pending-background';
break;
case 'busy':
statusClass = 'general-error-background';
break;
case 'offline':
statusClass = 'general-inactive-background';
break;
default:
statusClass = 'general-inactive-background';
}
// Sound notification
if (!(FlowRouter.getParam('name') === this.name) && !this.ls && this.alert === true) {
KonchatNotification.newRoom(this.rid);

Loading…
Cancel
Save