Commit 93a8dfc0 authored by JC Brand's avatar JC Brand

Indicate whether a room occupant is online or not.

parent 09802cfb
...@@ -2040,9 +2040,12 @@ ...@@ -2040,9 +2040,12 @@
padding: 2px 5px; padding: 2px 5px;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
color: #A8ABA1;
width: 100px; } width: 100px; }
#conversejs .chatroom .box-flyout .chatroom-body .occupants .occupant-list li.moderator { #conversejs .chatroom .box-flyout .chatroom-body .occupants .occupant-list li.online {
color: #D24E2B; } color: #1A9707; }
#conversejs .chatroom .box-flyout .chatroom-body .occupants .occupant-list li.online.moderator {
color: #D24E2B; }
#conversejs .chatroom .box-flyout .chatroom-body .chatroom-form-container { #conversejs .chatroom .box-flyout .chatroom-body .chatroom-form-container {
background-color: white; background-color: white;
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
......
...@@ -101,9 +101,13 @@ ...@@ -101,9 +101,13 @@
padding: 2px 5px; padding: 2px 5px;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
color: $light-text-color;
width: 100px; width: 100px;
&.moderator { &.online {
color: $moderator-color; color: $online-color;
&.moderator {
color: $moderator-color;
}
} }
} }
} }
......
...@@ -8,6 +8,7 @@ $inverse-link-color: white !default; ...@@ -8,6 +8,7 @@ $inverse-link-color: white !default;
$link-shadow-color: #FAFAFA !default; $link-shadow-color: #FAFAFA !default;
$text-shadow-color: #FAFAFA !default; $text-shadow-color: #FAFAFA !default;
$text-color: #818479 !default; $text-color: #818479 !default;
$light-text-color: #A8ABA1 !default;
$border-color: #CCC !default; $border-color: #CCC !default;
$icon-color: #114327 !default; $icon-color: #114327 !default;
$save-button-color: #436F64 !default; $save-button-color: #436F64 !default;
...@@ -37,6 +38,7 @@ $toolbar-height: 25px !default; ...@@ -37,6 +38,7 @@ $toolbar-height: 25px !default;
$toolbar-color: #FFF5EE !default; $toolbar-color: #FFF5EE !default;
$moderator-color: #D24E2B !default; $moderator-color: #D24E2B !default;
$online-color: #1A9707 !default;
$chatbox-border-radius: 4px !default; $chatbox-border-radius: 4px !default;
$bottom-gutter-height: 35px !default; $bottom-gutter-height: 35px !default;
......
...@@ -678,14 +678,20 @@ ...@@ -678,14 +678,20 @@
}, },
onConfigSaved: function (stanza) { onConfigSaved: function (stanza) {
/*
* When changing a room to members-only, do we want to then
* add all current users to the membership list?
*
var members = []; var members = [];
this.occupantsview.model.each(function (occupant) { this.occupantsview.model.each(function (occupant) {
var affiliation = occupant.get('affiliation');
members.push({ members.push({
'affiliation': affiliation !== 'none' ? affiliation : 'member', 'affiliation': affiliation !== 'none' ? affiliation : 'member',
'jid': Strophe.getBareJidFromJid(occupant.get('jid')) 'jid': Strophe.getBareJidFromJid(occupant.get('jid'))
}); });
}); });
// this.updateMembersList(members); this.updateMembersList(members);
*/
}, },
onErrorConfigSaved: function (stanza) { onErrorConfigSaved: function (stanza) {
...@@ -995,10 +1001,14 @@ ...@@ -995,10 +1001,14 @@
}); });
converse.ChatRoomOccupant = Backbone.Model.extend({ converse.ChatRoomOccupant = Backbone.Model.extend({
initialize: function () { initialize: function (attributes) {
this.set({'id': converse.connection.getUniqueId()}); this.set(_.extend({
'id': converse.connection.getUniqueId(),
'online': false
}, attributes));
} }
}); });
converse.ChatRoomOccupantView = Backbone.View.extend({ converse.ChatRoomOccupantView = Backbone.View.extend({
tagName: 'li', tagName: 'li',
initialize: function () { initialize: function () {
...@@ -1125,8 +1135,10 @@ ...@@ -1125,8 +1135,10 @@
switch (data.type) { switch (data.type) {
case 'unavailable': case 'unavailable':
if (occupant) { if (_.contains(['owner', 'admin', 'member'], occupant.get('affiliation'))) {
occupant[0].destroy(); occupant.save({'online': false});
} else {
occupant.destroy();
} }
break; break;
default: default:
......
<li class="{{role}}" id="{{id}}" <li class="{{role}} {[ if (online) { ]} online {[ } ]}" id="{{id}}"
{[ if (role === "moderator") { ]} {[ if (role === "moderator") { ]}
title="{{desc_moderator}}" title="{{desc_moderator}}"
{[ } ]} {[ } ]}
...@@ -7,5 +7,4 @@ ...@@ -7,5 +7,4 @@
{[ } ]} {[ } ]}
{[ if (role === "visitor") { ]} {[ if (role === "visitor") { ]}
title="{{desc_visitor}}" title="{{desc_visitor}}"
{[ } ]} {[ } ]}>{{nick}}</li>
>{{nick}}</li>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment