Commit 14d90bc9 authored by JC Brand's avatar JC Brand

Upgrade dependencies to their latest versions

parent bf6474ff
...@@ -12,18 +12,18 @@ ...@@ -12,18 +12,18 @@
"jquery": "1.11.0", "jquery": "1.11.0",
"jed": "0.5.4", "jed": "0.5.4",
"tinysort": "git://github.com/Sjeiti/TinySort.git", "tinysort": "git://github.com/Sjeiti/TinySort.git",
"underscore": "1.5.1", "underscore": "1.6.0",
"backbone": "1.0.0", "backbone": "1.1.2",
"backbone.localStorage": "1.1.6", "backbone.localStorage": "1.1.7",
"strophe": "https://github.com/jcbrand/strophejs.git#converse", "strophe": "git@github.com:strophe/strophejs-bower.git#v1.1.3",
"strophe.roster": "https://raw.github.com/jcbrand/strophejs-plugins/75c8693992bc357c699b6d615eeb396e799f5c02/roster/strophe.roster.js", "strophe.roster": "https://raw.github.com/strophe/strophejs-plugins/b1f364eb6e854ffe844c57add38e885cfeb9b498/roster/strophe.roster.js",
"strophe.vcard": "https://raw.github.com/jcbrand/strophejs-plugins/75c8693992bc357c699b6d615eeb396e799f5c02/vcard/strophe.vcard.js", "strophe.vcard": "https://raw.github.com/strophe/strophejs-plugins/f5c9e16b463610d501591452cded0359f53aae48/vcard/strophe.vcard.js",
"strophe.disco": "https://raw.github.com/jcbrand/strophejs-plugins/75c8693992bc357c699b6d615eeb396e799f5c02/disco/strophe.disco.js", "strophe.disco": "https://raw.github.com/jcbrand/strophejs-plugins/75c8693992bc357c699b6d615eeb396e799f5c02/disco/strophe.disco.js",
"strophe.muc": "https://raw.github.com/strophe/strophejs-plugins/02310ad1b8da2962cd05b0f4bceaecca134efed4/muc/strophe.muc.js", "strophe.muc": "https://raw.github.com/strophe/strophejs-plugins/02310ad1b8da2962cd05b0f4bceaecca134efed4/muc/strophe.muc.js",
"otr": "0.2.12", "otr": "0.2.12",
"crypto-js-evanvosberg": "~3.1.2", "crypto-js-evanvosberg": "~3.1.2",
"almond": "~0.2.6", "almond": "~0.2.9",
"requirejs-text": "~2.0.10", "requirejs-text": "~2.0.12",
"requirejs-tpl-jcbrand": "*", "requirejs-tpl-jcbrand": "*",
"momentjs": "~2.6.0", "momentjs": "~2.6.0",
"jquery.browser": "~0.0.6" "jquery.browser": "~0.0.6"
......
...@@ -477,7 +477,7 @@ ...@@ -477,7 +477,7 @@
this.initStatus = function (callback) { this.initStatus = function (callback) {
this.xmppstatus = new this.XMPPStatus(); this.xmppstatus = new this.XMPPStatus();
var id = hex_sha1('converse.xmppstatus-'+this.bare_jid); var id = b64_sha1('converse.xmppstatus-'+this.bare_jid);
this.xmppstatus.id = id; // This appears to be necessary for backbone.localStorage this.xmppstatus.id = id; // This appears to be necessary for backbone.localStorage
this.xmppstatus.localStorage = new Backbone.LocalStorage(id); this.xmppstatus.localStorage = new Backbone.LocalStorage(id);
this.xmppstatus.fetch({success: callback, error: callback}); this.xmppstatus.fetch({success: callback, error: callback});
...@@ -508,7 +508,7 @@ ...@@ -508,7 +508,7 @@
// Set up the roster // Set up the roster
this.roster = new this.RosterItems(); this.roster = new this.RosterItems();
this.roster.localStorage = new Backbone.LocalStorage( this.roster.localStorage = new Backbone.LocalStorage(
hex_sha1('converse.rosteritems-'+converse.bare_jid)); b64_sha1('converse.rosteritems-'+converse.bare_jid));
this.registerRosterHandler(); this.registerRosterHandler();
this.registerRosterXHandler(); this.registerRosterXHandler();
this.registerPresenceHandler(); this.registerPresenceHandler();
...@@ -607,7 +607,7 @@ ...@@ -607,7 +607,7 @@
// A model for managing OTR settings. // A model for managing OTR settings.
getSessionPassphrase: function () { getSessionPassphrase: function () {
if (converse.prebind) { if (converse.prebind) {
var key = hex_sha1(converse.connection.jid), var key = b64_sha1(converse.connection.jid),
pass = window.sessionStorage[key]; pass = window.sessionStorage[key];
if (typeof pass === 'undefined') { if (typeof pass === 'undefined') {
pass = Math.floor(Math.random()*4294967295).toString(); pass = Math.floor(Math.random()*4294967295).toString();
...@@ -627,10 +627,10 @@ ...@@ -627,10 +627,10 @@
var pass = this.getSessionPassphrase(); var pass = this.getSessionPassphrase();
if (typeof pass !== "undefined") { if (typeof pass !== "undefined") {
// Encrypt the key and set in sessionStorage. Also store instance tag. // Encrypt the key and set in sessionStorage. Also store instance tag.
window.sessionStorage[hex_sha1(jid+'priv_key')] = window.sessionStorage[b64_sha1(jid+'priv_key')] =
cipher.encrypt(CryptoJS.algo.AES, key.packPrivate(), pass).toString(); cipher.encrypt(CryptoJS.algo.AES, key.packPrivate(), pass).toString();
window.sessionStorage[hex_sha1(jid+'instance_tag')] = instance_tag; window.sessionStorage[b64_sha1(jid+'instance_tag')] = instance_tag;
window.sessionStorage[hex_sha1(jid+'pass_check')] = window.sessionStorage[b64_sha1(jid+'pass_check')] =
cipher.encrypt(CryptoJS.algo.AES, 'match', pass).toString(); cipher.encrypt(CryptoJS.algo.AES, 'match', pass).toString();
} }
} }
...@@ -650,10 +650,10 @@ ...@@ -650,10 +650,10 @@
if (this.get('box_id') !== 'controlbox') { if (this.get('box_id') !== 'controlbox') {
this.messages = new converse.Messages(); this.messages = new converse.Messages();
this.messages.localStorage = new Backbone.LocalStorage( this.messages.localStorage = new Backbone.LocalStorage(
hex_sha1('converse.messages'+this.get('jid')+converse.bare_jid)); b64_sha1('converse.messages'+this.get('jid')+converse.bare_jid));
this.save({ this.save({
'user_id' : Strophe.getNodeFromJid(this.get('jid')), 'user_id' : Strophe.getNodeFromJid(this.get('jid')),
'box_id' : hex_sha1(this.get('jid')), 'box_id' : b64_sha1(this.get('jid')),
'otr_status': this.get('otr_status') || UNENCRYPTED, 'otr_status': this.get('otr_status') || UNENCRYPTED,
'minimized': this.get('minimized') || false, 'minimized': this.get('minimized') || false,
'time_minimized': this.get('time_minimized') || converse.toISOString(new Date()), 'time_minimized': this.get('time_minimized') || converse.toISOString(new Date()),
...@@ -670,9 +670,9 @@ ...@@ -670,9 +670,9 @@
if (converse.cache_otr_key) { if (converse.cache_otr_key) {
pass = converse.otr.getSessionPassphrase(); pass = converse.otr.getSessionPassphrase();
if (typeof pass !== "undefined") { if (typeof pass !== "undefined") {
instance_tag = window.sessionStorage[hex_sha1(this.id+'instance_tag')]; instance_tag = window.sessionStorage[b64_sha1(this.id+'instance_tag')];
saved_key = window.sessionStorage[hex_sha1(this.id+'priv_key')]; saved_key = window.sessionStorage[b64_sha1(this.id+'priv_key')];
pass_check = window.sessionStorage[hex_sha1(this.connection.jid+'pass_check')]; pass_check = window.sessionStorage[b64_sha1(this.connection.jid+'pass_check')];
if (saved_key && instance_tag && typeof pass_check !== 'undefined') { if (saved_key && instance_tag && typeof pass_check !== 'undefined') {
var decrypted = cipher.decrypt(CryptoJS.algo.AES, saved_key, pass); var decrypted = cipher.decrypt(CryptoJS.algo.AES, saved_key, pass);
var key = DSA.parsePrivate(decrypted.toString(CryptoJS.enc.Latin1)); var key = DSA.parsePrivate(decrypted.toString(CryptoJS.enc.Latin1));
...@@ -1055,7 +1055,8 @@ ...@@ -1055,7 +1055,8 @@
if (match) { if (match) {
if (match[1] === "clear") { if (match[1] === "clear") {
this.$el.find('.chat-content').empty(); this.$el.find('.chat-content').empty();
this.model.messages.reset().localStorage._clear(); this.model.messages.reset();
this.model.messages.localStorage._clear();
return; return;
} }
else if (match[1] === "help") { else if (match[1] === "help") {
...@@ -1753,7 +1754,7 @@ ...@@ -1753,7 +1754,7 @@
'name': Strophe.unescapeNode(Strophe.getNodeFromJid(jid)), 'name': Strophe.unescapeNode(Strophe.getNodeFromJid(jid)),
'nick': nick, 'nick': nick,
'chatroom': true, 'chatroom': true,
'box_id' : hex_sha1(jid) 'box_id' : b64_sha1(jid)
}); });
if (!chatroom.get('connected')) { if (!chatroom.get('connected')) {
converse.chatboxviews.get(jid).connect(null); converse.chatboxviews.get(jid).connect(null);
...@@ -2382,7 +2383,7 @@ ...@@ -2382,7 +2383,7 @@
onConnected: function () { onConnected: function () {
this.localStorage = new Backbone.LocalStorage( this.localStorage = new Backbone.LocalStorage(
hex_sha1('converse.chatboxes-'+converse.bare_jid)); b64_sha1('converse.chatboxes-'+converse.bare_jid));
if (!this.get('controlbox')) { if (!this.get('controlbox')) {
this.add({ this.add({
id: 'controlbox', id: 'controlbox',
...@@ -2988,11 +2989,8 @@ ...@@ -2988,11 +2989,8 @@
}, },
removeRosterItemView: function (item) { removeRosterItemView: function (item) {
var view = this.get(item.id); if (this.get(item.id)) {
if (view) { this.get(item.id).remove();
view.$el.remove();
delete this.get(item.id);
this.render();
} }
return this; return this;
}, },
...@@ -3279,7 +3277,7 @@ ...@@ -3279,7 +3277,7 @@
model: converse.Feature, model: converse.Feature,
initialize: function () { initialize: function () {
this.localStorage = new Backbone.LocalStorage( this.localStorage = new Backbone.LocalStorage(
hex_sha1('converse.features'+converse.bare_jid)); b64_sha1('converse.features'+converse.bare_jid));
if (this.localStorage.records.length === 0) { if (this.localStorage.records.length === 0) {
// localStorage is empty, so we've likely never queried this // localStorage is empty, so we've likely never queried this
// domain for features yet // domain for features yet
......
...@@ -6,6 +6,7 @@ Changelog ...@@ -6,6 +6,7 @@ Changelog
* Chat boxes and rooms can now be resized vertically. [jcbrand] * Chat boxes and rooms can now be resized vertically. [jcbrand]
* Chat boxes and rooms can be minimized. [jcbrand] * Chat boxes and rooms can be minimized. [jcbrand]
* Upgraded many dependencies to their latest versions. [jcrand]
0.7.4 (2014-03-05) 0.7.4 (2014-03-05)
------------------ ------------------
......
...@@ -447,7 +447,7 @@ ...@@ -447,7 +447,7 @@
expect(new_roster.length).toEqual(0); expect(new_roster.length).toEqual(0);
new_roster.localStorage = new Backbone.LocalStorage( new_roster.localStorage = new Backbone.LocalStorage(
hex_sha1('converse.rosteritems-dummy@localhost')); b64_sha1('converse.rosteritems-dummy@localhost'));
new_roster.fetch(); new_roster.fetch();
expect(this.roster.length).toEqual(num_contacts); expect(this.roster.length).toEqual(num_contacts);
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
expect(pp).not.toBe(this.connection.pass); expect(pp).not.toBe(this.connection.pass);
expect(window.sessionStorage.length).toBe(1); expect(window.sessionStorage.length).toBe(1);
expect(window.localStorage.length).toBe(0); expect(window.localStorage.length).toBe(0);
expect(pp).toBe(window.sessionStorage[hex_sha1(converse.connection.jid)]); expect(pp).toBe(window.sessionStorage[b64_sha1(converse.connection.jid)]);
// Clean up // Clean up
this.prebind = false; this.prebind = false;
......
...@@ -93,7 +93,8 @@ ...@@ -93,7 +93,8 @@
utils.clearChatBoxMessages = function (jid) { utils.clearChatBoxMessages = function (jid) {
var view = converse.chatboxviews.get(jid); var view = converse.chatboxviews.get(jid);
view.$el.find('.chat-content').empty(); view.$el.find('.chat-content').empty();
view.model.messages.reset().localStorage._clear(); view.model.messages.reset();
view.model.messages.localStorage._clear();
}; };
utils.createCurrentContacts = function () { utils.createCurrentContacts = function () {
......
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