diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-08-13 14:31:48 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-08-13 14:31:48 +0100 |
commit | 55944ccf72882ae83dcf17a8013c63c49e51581d (patch) | |
tree | d90dad63a3af61032c6b10934d1b09aba9cee3fa /webclient/room/room-controller.js | |
parent | verbose by default please (diff) | |
download | synapse-55944ccf72882ae83dcf17a8013c63c49e51581d.tar.xz |
Use strings instead of opaque magic-number constants for presence states; rename AWAY to UNAVAILABLE
Diffstat (limited to 'webclient/room/room-controller.js')
-rw-r--r-- | webclient/room/room-controller.js | 11 |
1 files changed, 4 insertions, 7 deletions
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"; } } |