Changed the following:
- Removed situation where extra data passed in keyPressed was overriden with the same result because of the two assignments inside the if statements - Cached fullname and presence_type at initialize of ChatBoxView
This commit is contained in:
parent
87d66b0dec
commit
5c5b7b9dd7
19
converse.js
19
converse.js
@ -519,7 +519,6 @@
|
|||||||
notify = $msg({'to':this.model.get('jid'), 'type': 'chat'})
|
notify = $msg({'to':this.model.get('jid'), 'type': 'chat'})
|
||||||
.c('composing', {'xmlns':'http://jabber.org/protocol/chatstates'});
|
.c('composing', {'xmlns':'http://jabber.org/protocol/chatstates'});
|
||||||
xmppchat.connection.send(notify);
|
xmppchat.connection.send(notify);
|
||||||
this.$el.data('composing', true);
|
|
||||||
}
|
}
|
||||||
this.$el.data('composing', true);
|
this.$el.data('composing', true);
|
||||||
}
|
}
|
||||||
@ -542,19 +541,21 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
initialize: function (){
|
initialize: function (){
|
||||||
$('body').append($(this.el).hide());
|
$('body').append(this.$el.hide());
|
||||||
|
|
||||||
xmppchat.roster.on('change', function (item, changed) {
|
xmppchat.roster.on('change', function (item, changed) {
|
||||||
|
var fullname = this.model.get('fullname'),
|
||||||
|
presence_type = item.get('presence_type');
|
||||||
if (item.get('jid') === this.model.get('jid')) {
|
if (item.get('jid') === this.model.get('jid')) {
|
||||||
if (_.has(changed.changes, 'presence_type')) {
|
if (_.has(changed.changes, 'presence_type')) {
|
||||||
if (this.$el.is(':visible')) {
|
if (this.$el.is(':visible')) {
|
||||||
if (item.get('presence_type') === 'offline') {
|
if (presence_type === 'offline') {
|
||||||
this.insertStatusNotification(this.model.get('fullname')+' '+'has gone offline');
|
this.insertStatusNotification(fullname+' '+'has gone offline');
|
||||||
} else if (item.get('presence_type') === 'away') {
|
} else if (presence_type === 'away') {
|
||||||
this.insertStatusNotification(this.model.get('fullname')+' '+'has gone away');
|
this.insertStatusNotification(fullname+' '+'has gone away');
|
||||||
} else if ((item.get('presence_type') === 'busy') || (item.get('presence_type') === 'dnd')) {
|
} else if ((presence_type === 'busy') || (presence_type === 'dnd')) {
|
||||||
this.insertStatusNotification(this.model.get('fullname')+' '+'is busy');
|
this.insertStatusNotification(fullname+' '+'is busy');
|
||||||
} else if (item.get('presence_type') === 'online') {
|
} else if (presence_type === 'online') {
|
||||||
this.$el.find('div.chat-event').remove();
|
this.$el.find('div.chat-event').remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user