mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-04 21:15:55 +01:00
closes #1504
This commit is contained in:
@@ -53,7 +53,8 @@ define(['taskbar', 'string', 'sounds'], function(taskbar, S, sounds) {
|
||||
socket.on('event:chats.receive', function(data) {
|
||||
|
||||
var username = data.message.fromUser.username;
|
||||
if(parseInt(data.message.fromUser.uid, 10) === parseInt(app.uid, 10)) {
|
||||
var isSelf = parseInt(data.message.fromUser.uid, 10) === parseInt(app.uid, 10);
|
||||
if (isSelf) {
|
||||
username = data.message.toUser.username;
|
||||
}
|
||||
|
||||
@@ -70,17 +71,19 @@ define(['taskbar', 'string', 'sounds'], function(taskbar, S, sounds) {
|
||||
module.toggleNew(modal.attr('UUID'), true);
|
||||
}
|
||||
|
||||
if (!modal.is(":visible") || !app.isFocused) {
|
||||
if (!isSelf && (!modal.is(":visible") || !app.isFocused)) {
|
||||
app.alternatingTitle(username + ' has messaged you');
|
||||
}
|
||||
} else {
|
||||
module.createModal(username, data.withUid, function(modal) {
|
||||
module.toggleNew(modal.attr('UUID'), true);
|
||||
app.alternatingTitle(username + ' has messaged you');
|
||||
if (!isSelf) {
|
||||
app.alternatingTitle(username + ' has messaged you');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (parseInt(app.uid, 10) !== parseInt(data.message.fromuid, 10)) {
|
||||
if (!isSelf) {
|
||||
sounds.play('chat-incoming');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user