|
@@ -69,6 +69,7 @@
|
|
this.i18n = locales.en;
|
|
this.i18n = locales.en;
|
|
this.prebind = false;
|
|
this.prebind = false;
|
|
this.show_controlbox_by_default = false;
|
|
this.show_controlbox_by_default = false;
|
|
|
|
+ this.show_only_online_users = false;
|
|
this.show_toolbar = true;
|
|
this.show_toolbar = true;
|
|
this.testing = false; // Exposes sensitive data for testing. Never set to true in production systems!
|
|
this.testing = false; // Exposes sensitive data for testing. Never set to true in production systems!
|
|
this.xhr_custom_status = false;
|
|
this.xhr_custom_status = false;
|
|
@@ -92,6 +93,7 @@
|
|
'prebind',
|
|
'prebind',
|
|
'rid',
|
|
'rid',
|
|
'show_controlbox_by_default',
|
|
'show_controlbox_by_default',
|
|
|
|
+ 'show_only_online_users',
|
|
'show_toolbar',
|
|
'show_toolbar',
|
|
'sid',
|
|
'sid',
|
|
'testing',
|
|
'testing',
|
|
@@ -2605,8 +2607,6 @@
|
|
converse.connection.roster.authorize(bare_jid);
|
|
converse.connection.roster.authorize(bare_jid);
|
|
} else {
|
|
} else {
|
|
if (!this.get(bare_jid)) {
|
|
if (!this.get(bare_jid)) {
|
|
- // TODO: we can perhaps do the creation inside
|
|
|
|
- // getVCard.
|
|
|
|
converse.getVCard(
|
|
converse.getVCard(
|
|
bare_jid,
|
|
bare_jid,
|
|
$.proxy(function (jid, fullname, img, img_type, url) {
|
|
$.proxy(function (jid, fullname, img, img_type, url) {
|
|
@@ -2735,7 +2735,7 @@
|
|
this.model.on("remove", function (item) { this.removeRosterItem(item); }, this);
|
|
this.model.on("remove", function (item) { this.removeRosterItem(item); }, this);
|
|
this.model.on("destroy", function (item) { this.removeRosterItem(item); }, this);
|
|
this.model.on("destroy", function (item) { this.removeRosterItem(item); }, this);
|
|
|
|
|
|
- var roster_markup = this.contacts_template()
|
|
|
|
|
|
+ var roster_markup = this.contacts_template();
|
|
if (converse.allow_contact_requests) {
|
|
if (converse.allow_contact_requests) {
|
|
roster_markup = this.requesting_contacts_template() + roster_markup + this.pending_contacts_template();
|
|
roster_markup = this.requesting_contacts_template() + roster_markup + this.pending_contacts_template();
|
|
}
|
|
}
|
|
@@ -2770,11 +2770,17 @@
|
|
chatbox.save(changes);
|
|
chatbox.save(changes);
|
|
},
|
|
},
|
|
|
|
|
|
- renderRosterItem: function () {
|
|
|
|
|
|
+ renderRosterItem: function (item, view) {
|
|
|
|
+ if (converse.show_only_online_users) {
|
|
|
|
+ if (item.get('chat_status') !== 'online') {
|
|
|
|
+ view.$el.remove();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
if ($.contains(document.documentElement, view.el)) {
|
|
if ($.contains(document.documentElement, view.el)) {
|
|
view.render();
|
|
view.render();
|
|
} else {
|
|
} else {
|
|
- $my_contacts.after(view.render().el);
|
|
|
|
|
|
+ this.$el.find('#xmpp-contacts').after(view.render().el);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -2798,7 +2804,7 @@
|
|
$contact_requests.after(view.render().el);
|
|
$contact_requests.after(view.render().el);
|
|
$contact_requests.after($contact_requests.siblings('dd.requesting-xmpp-contact').tsort(crit));
|
|
$contact_requests.after($contact_requests.siblings('dd.requesting-xmpp-contact').tsort(crit));
|
|
} else if (subscription === 'both' || subscription === 'to') {
|
|
} else if (subscription === 'both' || subscription === 'to') {
|
|
- this.renderRosterItem();
|
|
|
|
|
|
+ this.renderRosterItem(item, view);
|
|
}
|
|
}
|
|
changed_presence = view.model.changed.chat_status;
|
|
changed_presence = view.model.changed.chat_status;
|
|
if (changed_presence) {
|
|
if (changed_presence) {
|