removed incorrect markread nid

v1.18.x
barisusakli 8 years ago
parent 1bda0395b8
commit b807915515

@ -46,7 +46,6 @@ var userNotifications = require('./user/notifications');
var isNew = params.isNew || false; var isNew = params.isNew || false;
var start = params.hasOwnProperty('start') ? params.start : 0; var start = params.hasOwnProperty('start') ? params.start : 0;
var stop = parseInt(start, 10) + ((params.count || 50) - 1); var stop = parseInt(start, 10) + ((params.count || 50) - 1);
var markRead = params.markRead || true;
var indices = {}; var indices = {};
async.waterfall([ async.waterfall([
@ -79,16 +78,6 @@ var userNotifications = require('./user/notifications');
next(null, messageData); next(null, messageData);
} }
], callback); ], 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) { function canGetMessages(callerUid, uid, callback) {

@ -330,14 +330,9 @@ SocketModules.chats.getMessages = function (socket, data, callback) {
uid: data.uid, uid: data.uid,
roomId: data.roomId, roomId: data.roomId,
start: parseInt(data.start, 10) || 0, start: parseInt(data.start, 10) || 0,
count: 50, count: 50
markRead: false
}; };
if (data.hasOwnProperty('markRead')) {
params.markRead = data.markRead;
}
Messaging.getMessages(params, callback); Messaging.getMessages(params, callback);
}; };

@ -126,8 +126,7 @@ describe('Messaging Library', function () {
socketModules.chats.getMessages({uid: fooUid}, { socketModules.chats.getMessages({uid: fooUid}, {
uid: fooUid, uid: fooUid,
roomId: roomId, roomId: roomId,
start: 0, start: 0
markRead: true
}, function (err, messages) { }, function (err, messages) {
assert.ifError(err); assert.ifError(err);
assert(Array.isArray(messages)); assert(Array.isArray(messages));

Loading…
Cancel
Save