diff --git a/css/converse.css b/css/converse.css index 08a27a521..6e871e3ea 100644 --- a/css/converse.css +++ b/css/converse.css @@ -2040,9 +2040,12 @@ padding: 2px 5px; text-overflow: ellipsis; white-space: nowrap; + color: #A8ABA1; width: 100px; } - #conversejs .chatroom .box-flyout .chatroom-body .occupants .occupant-list li.moderator { - color: #D24E2B; } + #conversejs .chatroom .box-flyout .chatroom-body .occupants .occupant-list li.online { + 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 { background-color: white; border-bottom-left-radius: 4px; diff --git a/sass/_chatrooms.scss b/sass/_chatrooms.scss index f44910b65..93d921c6c 100644 --- a/sass/_chatrooms.scss +++ b/sass/_chatrooms.scss @@ -101,9 +101,13 @@ padding: 2px 5px; text-overflow: ellipsis; white-space: nowrap; + color: $light-text-color; width: 100px; - &.moderator { - color: $moderator-color; + &.online { + color: $online-color; + &.moderator { + color: $moderator-color; + } } } } diff --git a/sass/_variables.scss b/sass/_variables.scss index 318fd313e..4d7ccbe76 100644 --- a/sass/_variables.scss +++ b/sass/_variables.scss @@ -8,6 +8,7 @@ $inverse-link-color: white !default; $link-shadow-color: #FAFAFA !default; $text-shadow-color: #FAFAFA !default; $text-color: #818479 !default; +$light-text-color: #A8ABA1 !default; $border-color: #CCC !default; $icon-color: #114327 !default; $save-button-color: #436F64 !default; @@ -37,6 +38,7 @@ $toolbar-height: 25px !default; $toolbar-color: #FFF5EE !default; $moderator-color: #D24E2B !default; +$online-color: #1A9707 !default; $chatbox-border-radius: 4px !default; $bottom-gutter-height: 35px !default; diff --git a/src/converse-muc.js b/src/converse-muc.js index 31cff488a..caea3d3bc 100755 --- a/src/converse-muc.js +++ b/src/converse-muc.js @@ -678,14 +678,20 @@ }, 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 = []; this.occupantsview.model.each(function (occupant) { + var affiliation = occupant.get('affiliation'); members.push({ 'affiliation': affiliation !== 'none' ? affiliation : 'member', 'jid': Strophe.getBareJidFromJid(occupant.get('jid')) }); }); - // this.updateMembersList(members); + this.updateMembersList(members); + */ }, onErrorConfigSaved: function (stanza) { @@ -995,10 +1001,14 @@ }); converse.ChatRoomOccupant = Backbone.Model.extend({ - initialize: function () { - this.set({'id': converse.connection.getUniqueId()}); + initialize: function (attributes) { + this.set(_.extend({ + 'id': converse.connection.getUniqueId(), + 'online': false + }, attributes)); } }); + converse.ChatRoomOccupantView = Backbone.View.extend({ tagName: 'li', initialize: function () { @@ -1125,8 +1135,10 @@ switch (data.type) { case 'unavailable': - if (occupant) { - occupant[0].destroy(); + if (_.contains(['owner', 'admin', 'member'], occupant.get('affiliation'))) { + occupant.save({'online': false}); + } else { + occupant.destroy(); } break; default: diff --git a/src/templates/occupant.html b/src/templates/occupant.html index 809e07552..48482eeba 100644 --- a/src/templates/occupant.html +++ b/src/templates/occupant.html @@ -1,4 +1,4 @@ -
  • {{nick}}
  • + {[ } ]}>{{nick}}