1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2025-01-12 14:18:00 -05: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) { initialize: function (attrs) {
this.contact.onCall = true; this.contact.onCall = true;
// temporary, this won't stay here // temporary, this won't stay here
app.navigate('/chat/' + this.contact.jid); app.navigate('/chat/' + encodeURIComponent(this.contact.jid));
}, },
session: { session: {
contact: 'object', contact: 'object',

View File

@ -261,7 +261,7 @@ module.exports = HumanModel.define({
body: message.body, body: message.body,
icon: this.avatar, icon: this.avatar,
tag: this.jid, 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, body: message.body,
icon: this.avatar, icon: this.avatar,
tag: this.id, 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) { chat: function (jid) {
var contact = me.contacts.get(jid); var contact = me.contacts.get(decodeURIComponent(jid));
if (contact) { if (contact) {
app.renderPage(new ChatPage({ app.renderPage(new ChatPage({
model: contact model: contact
@ -32,7 +32,7 @@ module.exports = Backbone.Router.extend({
} }
}, },
groupchat: function (jid) { groupchat: function (jid) {
var contact = me.mucs.get(jid); var contact = me.mucs.get(decodeURIComponent(jid));
if (contact) { if (contact) {
app.renderPage(new GroupChatPage({ app.renderPage(new GroupChatPage({
model: contact model: contact

View File

@ -38,7 +38,7 @@ module.exports = HumanView.extend({
e.preventDefault(); e.preventDefault();
var self = this; var self = this;
self.model.state = 'active'; 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.contact.onCall = true;
self.model.jingleSession.accept(); self.model.jingleSession.accept();
return false; return false;

View File

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

View File

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