Commit 359dbc68 authored by JC Brand's avatar JC Brand

Merge branch 'master' into mockup

parents a9c19788 44d094f5
Changelog
=========
0.5.3 (Unreleased)
------------------
- Register presence and message handlers before fetching the roster. Otherwise
some presence notifications might be missed. [jcbrand]
- Add a debug option (logs to the browser console). [jcbrand]
0.5.2 (2013-08-05)
------------------
......
{
"name": "converse",
"version": "0.5.0",
"version": "0.5.2",
"devDependencies": {
"jasmine": "https://github.com/jcbrand/jasmine.git#1_3_x"
},
......
......@@ -48,6 +48,7 @@
this.auto_list_rooms = false;
this.auto_subscribe = false;
this.bosh_service_url = ''; // The BOSH connection manager URL. Required if you are not prebinding.
this.debug = false;
this.hide_muc_server = false;
this.i18n = locales.en;
this.prebind = false;
......@@ -2615,8 +2616,13 @@
this.onConnected = function (connection, callback) {
this.connection = connection;
if (this.debug) {
this.connection.xmlInput = function (body) { console.log(body); };
this.connection.xmlOutput = function (body) { console.log(body); };
Strophe.log = function (level, msg) {
console.log(level+' '+msg);
};
}
this.bare_jid = Strophe.getBareJidFromJid(this.connection.jid);
this.domain = Strophe.getDomainFromJid(this.connection.jid);
this.features = new this.Features();
......@@ -2627,18 +2633,20 @@
$.proxy(this.roster.subscribeToSuggestedItems, this.roster),
'http://jabber.org/protocol/rosterx', 'message', null);
this.connection.roster.get($.proxy(function (a) {
this.connection.addHandler(
$.proxy(function (presence) {
this.presenceHandler(presence);
return true;
}, this.roster), null, 'presence', null);
this.connection.addHandler(
$.proxy(function (message) {
this.chatboxes.messageReceived(message);
return true;
}, this), null, 'message', 'chat');
}, this));
this.connection.roster.get(function () {});
$(window).on("blur focus", $.proxy(function(e) {
if ((this.windowState != e.type) && (e.type == 'focus')) {
converse.clearMsgCounter();
......
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