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 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) {

@ -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);
};

@ -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));

Loading…
Cancel
Save