From 55944ccf72882ae83dcf17a8013c63c49e51581d Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Wed, 13 Aug 2014 14:31:48 +0100 Subject: Use strings instead of opaque magic-number constants for presence states; rename AWAY to UNAVAILABLE --- webclient/app.css | 2 +- webclient/room/room-controller.js | 11 ++++------- webclient/room/room.html | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'webclient') diff --git a/webclient/app.css b/webclient/app.css index 9a46613d49..15b6c91300 100644 --- a/webclient/app.css +++ b/webclient/app.css @@ -106,7 +106,7 @@ h1 { background-color: #38AF00; } -.away { +.unavailable { background-color: #FFCC00; } diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index cbd5c1a175..5d1c65641e 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -123,17 +123,14 @@ angular.module('RoomController', []) var member = $scope.members[chunk.content.user_id]; if ("state" in chunk.content) { - var ONLINE = 2; - var AWAY = 1; - var OFFLINE = 0; - if (chunk.content.state === ONLINE) { + if (chunk.content.state === "online") { member.presenceState = "online"; } - else if (chunk.content.state === OFFLINE) { + else if (chunk.content.state === "offline") { member.presenceState = "offline"; } - else if (chunk.content.state === AWAY) { - member.presenceState = "away"; + else if (chunk.content.state === "unavailable") { + member.presenceState = "unavailable"; } } diff --git a/webclient/room/room.html b/webclient/room/room.html index 9cd1ec3645..5de2190b8b 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -14,7 +14,7 @@
{{ info.displayname || name }}
- + -- cgit 1.5.1