Skip to content
Snippets Groups Projects
Commit aee5d309 authored by Marcos Spessatto Defendi's avatar Marcos Spessatto Defendi Committed by Diego Sampaio
Browse files

[FIX] Unreads counter for new rooms on /channels.counters REST endpoint (#11531)

parent 99141498
No related branches found
No related tags found
No related merge requests found
......@@ -129,10 +129,8 @@ RocketChat.API.v1.addRoute('channels.counters', { authRequired: true }, {
const lm = room.lm ? room.lm : room._updatedAt;
if (typeof subscription !== 'undefined' && subscription.open) {
if (subscription.ls) {
unreads = RocketChat.models.Messages.countVisibleByRoomIdBetweenTimestampsInclusive(subscription.rid, subscription.ls, lm);
unreadsFrom = subscription.ls;
}
unreads = RocketChat.models.Messages.countVisibleByRoomIdBetweenTimestampsInclusive(subscription.rid, subscription.ls, lm);
unreadsFrom = subscription.ls || subscription.ts;
userMentions = subscription.userMentions;
joined = true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment