Commit 1029aae2 authored by JC Brand's avatar JC Brand

Write out map when calling create

parent c8f72b35
...@@ -899,7 +899,6 @@ ...@@ -899,7 +899,6 @@
* (String) message - An optional message to explain the * (String) message - An optional message to explain the
* reason for the subscription request. * reason for the subscription request.
*/ */
this.save('ask', "subscribe"); // ask === 'subscribe' Means we have ask to subscribe to them.
const pres = $pres({to: this.get('jid'), type: "subscribe"}); const pres = $pres({to: this.get('jid'), type: "subscribe"});
if (message && message !== "") { if (message && message !== "") {
pres.c("status").t(message).up(); pres.c("status").t(message).up();
...@@ -909,6 +908,7 @@ ...@@ -909,6 +908,7 @@
pres.c('nick', {'xmlns': Strophe.NS.NICK}).t(nick).up(); pres.c('nick', {'xmlns': Strophe.NS.NICK}).t(nick).up();
} }
_converse.connection.send(pres); _converse.connection.send(pres);
this.save('ask', "subscribe"); // ask === 'subscribe' Means we have asked to subscribe to them.
return this; return this;
}, },
...@@ -1311,11 +1311,11 @@ ...@@ -1311,11 +1311,11 @@
return; // We're lazy when adding contacts. return; // We're lazy when adding contacts.
} }
this.create({ this.create({
ask, 'ask': ask,
fullname: item.getAttribute("name") || jid, 'fullname': item.getAttribute("name") || jid,
groups, 'groups': groups,
jid, 'jid': jid,
subscription 'subscription': subscription
}, {sort: false}); }, {sort: false});
} else { } else {
if (subscription === "remove") { if (subscription === "remove") {
...@@ -1326,10 +1326,10 @@ ...@@ -1326,10 +1326,10 @@
// here, we know they aren't requesting anymore. // here, we know they aren't requesting anymore.
// see docs/DEVELOPER.rst // see docs/DEVELOPER.rst
contact.save({ contact.save({
subscription, 'subscription': subscription,
ask, 'ask': ask,
requesting: null, 'requesting': null,
groups 'groups': groups
}); });
} }
}, },
......
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