|
@@ -2468,6 +2468,7 @@
|
|
render: function () {
|
|
render: function () {
|
|
var item = this.model,
|
|
var item = this.model,
|
|
ask = item.get('ask'),
|
|
ask = item.get('ask'),
|
|
|
|
+ requesting = item.get('requesting'),
|
|
subscription = item.get('subscription');
|
|
subscription = item.get('subscription');
|
|
|
|
|
|
var classes_to_remove = [
|
|
var classes_to_remove = [
|
|
@@ -2488,7 +2489,7 @@
|
|
if ((ask === 'subscribe') && (subscription == 'none')) {
|
|
if ((ask === 'subscribe') && (subscription == 'none')) {
|
|
this.$el.addClass('pending-xmpp-contact');
|
|
this.$el.addClass('pending-xmpp-contact');
|
|
this.$el.html(this.pending_template(item.toJSON()));
|
|
this.$el.html(this.pending_template(item.toJSON()));
|
|
- } else if ((ask === 'subscribe') && (subscription == 'from')) {
|
|
|
|
|
|
+ } else if (requesting === true) {
|
|
this.$el.addClass('requesting-xmpp-contact');
|
|
this.$el.addClass('requesting-xmpp-contact');
|
|
this.$el.html(this.request_template(item.toJSON()));
|
|
this.$el.html(this.request_template(item.toJSON()));
|
|
converse.controlboxtoggle.showControlBox();
|
|
converse.controlboxtoggle.showControlBox();
|
|
@@ -2709,8 +2710,9 @@
|
|
$.proxy(function (jid, fullname, img, img_type, url) {
|
|
$.proxy(function (jid, fullname, img, img_type, url) {
|
|
this.add({
|
|
this.add({
|
|
jid: bare_jid,
|
|
jid: bare_jid,
|
|
- subscription: 'from',
|
|
|
|
- ask: 'subscribe',
|
|
|
|
|
|
+ subscription: 'none',
|
|
|
|
+ ask: null,
|
|
|
|
+ requesting: true,
|
|
fullname: fullname,
|
|
fullname: fullname,
|
|
image: img,
|
|
image: img,
|
|
image_type: img_type,
|
|
image_type: img_type,
|
|
@@ -2725,8 +2727,9 @@
|
|
// well?
|
|
// well?
|
|
this.add({
|
|
this.add({
|
|
jid: bare_jid,
|
|
jid: bare_jid,
|
|
- subscription: 'from',
|
|
|
|
- ask: 'subscribe',
|
|
|
|
|
|
+ subscription: 'none',
|
|
|
|
+ ask: null,
|
|
|
|
+ requesting: true,
|
|
fullname: jid,
|
|
fullname: jid,
|
|
is_last: true
|
|
is_last: true
|
|
});
|
|
});
|
|
@@ -2891,12 +2894,13 @@
|
|
view = this.rosteritemviews[item.id],
|
|
view = this.rosteritemviews[item.id],
|
|
ask = item.get('ask'),
|
|
ask = item.get('ask'),
|
|
subscription = item.get('subscription'),
|
|
subscription = item.get('subscription'),
|
|
|
|
+ requesting = item.get('requesting'),
|
|
crit = {order:'asc'};
|
|
crit = {order:'asc'};
|
|
|
|
|
|
if ((ask === 'subscribe') && (subscription == 'none')) {
|
|
if ((ask === 'subscribe') && (subscription == 'none')) {
|
|
$pending_contacts.after(view.render().el);
|
|
$pending_contacts.after(view.render().el);
|
|
$pending_contacts.after($pending_contacts.siblings('dd.pending-xmpp-contact').tsort(crit));
|
|
$pending_contacts.after($pending_contacts.siblings('dd.pending-xmpp-contact').tsort(crit));
|
|
- } else if ((ask === 'subscribe') && (subscription == 'from')) {
|
|
|
|
|
|
+ } else if (requesting === true) {
|
|
$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') {
|