From b807915515a3797fd41a1807787eedd4538c2ee0 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 24 Nov 2016 15:53:46 +0300 Subject: [PATCH] removed incorrect markread nid --- src/messaging.js | 11 ----------- src/socket.io/modules.js | 7 +------ test/messaging.js | 3 +-- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/messaging.js b/src/messaging.js index 494a354da0..d5d43e1041 100644 --- a/src/messaging.js +++ b/src/messaging.js @@ -46,7 +46,6 @@ var userNotifications = require('./user/notifications'); var isNew = params.isNew || false; var start = params.hasOwnProperty('start') ? params.start : 0; var stop = parseInt(start, 10) + ((params.count || 50) - 1); - var markRead = params.markRead || true; var indices = {}; async.waterfall([ @@ -79,16 +78,6 @@ var userNotifications = require('./user/notifications'); next(null, messageData); } ], callback); - - if (markRead) { - notifications.markRead('chat_' + roomId + '_' + uid, uid, function (err) { - if (err) { - winston.error('[messaging] Could not mark notifications related to this chat as read: ' + err.message); - } - - userNotifications.pushCount(uid); - }); - } }; function canGetMessages(callerUid, uid, callback) { diff --git a/src/socket.io/modules.js b/src/socket.io/modules.js index 46f3804c03..c8862c4941 100644 --- a/src/socket.io/modules.js +++ b/src/socket.io/modules.js @@ -330,14 +330,9 @@ SocketModules.chats.getMessages = function (socket, data, callback) { uid: data.uid, roomId: data.roomId, start: parseInt(data.start, 10) || 0, - count: 50, - markRead: false + count: 50 }; - if (data.hasOwnProperty('markRead')) { - params.markRead = data.markRead; - } - Messaging.getMessages(params, callback); }; diff --git a/test/messaging.js b/test/messaging.js index 16f611821d..06991b2088 100644 --- a/test/messaging.js +++ b/test/messaging.js @@ -126,8 +126,7 @@ describe('Messaging Library', function () { socketModules.chats.getMessages({uid: fooUid}, { uid: fooUid, roomId: roomId, - start: 0, - markRead: true + start: 0 }, function (err, messages) { assert.ifError(err); assert(Array.isArray(messages));