Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/lib/methods/subscriptions/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default function subscribeRoom({ rid }) {

const handleMessageReceived = protectedFunction((ddpMessage) => {
const message = buildMessage(EJSON.fromJSONValue(ddpMessage.fields.args[0]));
const lastOpen = new Date();
if (rid !== message.rid) {
return;
}
Expand Down Expand Up @@ -163,7 +164,7 @@ export default function subscribeRoom({ rid }) {

try {
await subCollection.find(rid);
this.readMessages(rid);
this.readMessages(rid, lastOpen);
} catch (e) {
console.log('Subscription not found. We probably subscribed to a not joined channel. No need to mark as read.');
}
Expand Down