mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 01:04:49 -04:00
Use strings instead of opaque magic-number constants for presence states; rename AWAY to UNAVAILABLE
This commit is contained in:
parent
2a0f7541c7
commit
55944ccf72
7 changed files with 34 additions and 37 deletions
|
@ -106,7 +106,7 @@ h1 {
|
|||
background-color: #38AF00;
|
||||
}
|
||||
|
||||
.away {
|
||||
.unavailable {
|
||||
background-color: #FFCC00;
|
||||
}
|
||||
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<img class="userAvatarGradient" src="img/gradient.png" width="80" height="24"/>
|
||||
<div class="userName">{{ info.displayname || name }}</div>
|
||||
</td>
|
||||
<td class="userPresence" ng-class="info.presenceState === 'online' ? 'online' : (info.presenceState === 'away' ? 'away' : '')" />
|
||||
<td class="userPresence" ng-class="info.presenceState === 'online' ? 'online' : (info.presenceState === 'unavailable' ? 'unavailable' : '')" />
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue