mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-12-25 00:48:51 -05:00
Fix: JID in URI
This commit is contained in:
parent
c9da0de13d
commit
735b9ca08f
@ -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',
|
||||
|
@ -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))
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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('/');
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user