Skip to content

Node.js based forum software built for the modern web

closes #216

Baris Usakli08ba9117389e
diff --git a/src/websockets.js b/src/websockets.js
index a3edea4f19..92546790bb 100644
--- a/src/websockets.js
+++ b/src/websockets.js
@@ -529,11 +529,13 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
user.getUserField(uid, 'username', function(err, username) {
var finalMessage = 'New message from <strong>' + username + '</strong>';
- notifications.create(finalMessage, 5, '#', 'notification_' + uid + '_' + touid, function(nid) {
- notifications.push(nid, [touid], function(success) {
+ if(!isUserOnline(touid)) {
+ notifications.create(finalMessage, 5, '#', 'notification_' + uid + '_' + touid, function(nid) {
+ notifications.push(nid, [touid], function(success) {
+ });
});
- });
+ }
require('./messaging').addMessage(uid, touid, msg, function(err, message) {
var numSockets = 0;