1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-08-13 17:03:51 -04:00

Fix: JID in URI

This commit is contained in:
Sebastien Hut 2014-12-10 11:25:19 +01:00
parent c9da0de13d
commit 735b9ca08f
7 changed files with 9 additions and 9 deletions

View File

@ -11,7 +11,7 @@ module.exports = HumanModel.define({
initialize: function (attrs) {
this.contact.onCall = true;
// temporary, this won't stay here
app.navigate('/chat/' + this.contact.jid);
app.navigate('/chat/' + encodeURIComponent(this.contact.jid));
},
session: {
contact: 'object',

View File

@ -261,7 +261,7 @@ module.exports = HumanModel.define({
body: message.body,
icon: this.avatar,
tag: this.jid,
onclick: _.bind(app.navigate, app, '/chat/' + this.jid)
onclick: _.bind(app.navigate, app, '/chat/' + encodeURIComponent(this.jid))
});
}

View File

@ -96,7 +96,7 @@ module.exports = HumanModel.define({
body: message.body,
icon: this.avatar,
tag: this.id,
onclick: _.bind(app.navigate, app, '/groupchat/' + this.jid)
onclick: _.bind(app.navigate, app, '/groupchat/' + encodeURIComponent(this.jid))
});
}
}

View File

@ -22,7 +22,7 @@ module.exports = Backbone.Router.extend({
}));
},
chat: function (jid) {
var contact = me.contacts.get(jid);
var contact = me.contacts.get(decodeURIComponent(jid));
if (contact) {
app.renderPage(new ChatPage({
model: contact
@ -32,7 +32,7 @@ module.exports = Backbone.Router.extend({
}
},
groupchat: function (jid) {
var contact = me.mucs.get(jid);
var contact = me.mucs.get(decodeURIComponent(jid));
if (contact) {
app.renderPage(new GroupChatPage({
model: contact

View File

@ -38,7 +38,7 @@ module.exports = HumanView.extend({
e.preventDefault();
var self = this;
self.model.state = 'active';
app.navigate('/chat/' + self.model.contact.jid);
app.navigate('/chat/' + encodeURIComponent(self.model.contact.jid));
self.model.contact.onCall = true;
self.model.jingleSession.accept();
return false;

View File

@ -33,12 +33,12 @@ module.exports = HumanView.extend({
},
handleClick: function () {
if (me.contacts.get(this.model.jid)) {
app.navigate('chat/' + this.model.jid);
app.navigate('chat/' + encodeURIComponent(this.model.jid));
}
},
handleRemoveContact: function() {
me.removeContact(this.model.jid);
if (app.history.fragment === 'chat/' + this.model.jid) {
if (app.history.fragment === 'chat/' + encodeURIComponent(this.model.jid)) {
app.navigate('/');
}
}

View File

@ -28,7 +28,7 @@ module.exports = HumanView.extend({
return this;
},
handleClick: function (e) {
app.navigate('groupchat/' + this.model.jid);
app.navigate('groupchat/' + encodeURIComponent(this.model.jid));
},
handleJoinRoom: function (e) {
this.model.join();