[FIX] im: notifications fixes & sound change

notification sound on first message of conversation
no notification when message received is from the current uid
notifcation sound changed. Louder & clearer.

bzr revid: dle@openerp.com-20140106135056-4179b6u5lcou2w52
This commit is contained in:
Denis Ledoux
2014-01-06 14:50:56 +01:00
parent 964dae2311
commit 68de728214
3 changed files with 8 additions and 7 deletions
Binary file not shown.
Binary file not shown.
+8 -7
View File
@@ -259,7 +259,7 @@ function declare($, _, openerp) {
_.each(messages, function(message) {
if (! message.technical) {
defs.push(self.activate_session(message.session_id[0]).then(function(conv) {
received = true;
received = self.my_id[0] !== message.from_id[0];
return conv.received_message(message);
}));
} else {
@@ -268,12 +268,13 @@ function declare($, _, openerp) {
defs.push($.when(im_common.technical_messages_handlers[json.type](self, message)));
}
});
if (! this.get("window_focus") && received) {
this.set("waiting_messages", this.get("waiting_messages") + messages.length);
this.ting.play();
this.create_ting();
}
return $.when.apply($, defs);
return $.when.apply($, defs).then(function(){
if (! self.get("window_focus") && received) {
self.set("waiting_messages", self.get("waiting_messages") + messages.length);
self.ting.play();
self.create_ting();
}
});
},
calc_positions: function() {
var current = this.get("right_offset");