Commit c646e93a authored by JC Brand's avatar JC Brand

Don't set out message carbons IQ stanza on each page load.

parent ad0f8a33
......@@ -615,7 +615,7 @@
/* Ask the XMPP server to enable Message Carbons
* See XEP-0280 https://xmpp.org/extensions/xep-0280.html#enabling
*/
if (!this.message_carbons) {
if (!this.message_carbons || this.session.get('carbons_enabled')) {
return;
}
var carbons_iq = new Strophe.Builder('iq', {
......@@ -624,14 +624,15 @@
type: 'set'
})
.c('enable', {xmlns: 'urn:xmpp:carbons:2'});
this.connection.send(carbons_iq);
this.connection.addHandler(function (iq) {
this.connection.addHandler($.proxy(function (iq) {
if ($(iq).find('error').length > 0) {
converse.log('ERROR: An error occured while trying to enable message carbons.');
} else {
converse.log('Message carbons appear to have been enabled.');
this.session.save({carbons_enabled: true});
converse.log('Message carbons have been enabled.');
}
}, null, "iq", null, "enablecarbons");
}, this), null, "iq", null, "enablecarbons");
this.connection.send(carbons_iq);
};
this.onConnected = function () {
......
......@@ -7,6 +7,7 @@ Changelog
* Norwegian Bokmål translations. [Andreas Lorentsen]
* Updated Afrikaans translations. [jcbrand]
* Add responsiveness to CSS. We now use Sass preprocessor for generating CSS. [jcbrand]
* Don't send out the message carbons IQ stanza on each page load. [jcbrand]
* #252, 253 Add fullname and jid to contact's tooltip in roster. [gbonvehi]
* #292 Better support for XEP-0085 Chat State Notifications. [jcbrand]
* #295 Document "allow_registration". [gbonvehi]
......
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