Skip to content

Commit

Permalink
remove features from other PR
Browse files Browse the repository at this point in the history
  • Loading branch information
heitortanoue committed Oct 13, 2023
1 parent ae04252 commit 809e522
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ callbacks.add(

if (tmid) {
await MessageReads.readThread(uid, tmid);
} else {
} else if (lastSeen) {
await ReadReceipt.markMessagesAsRead(rid, uid, lastSeen);
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const ReadReceipt = {
const room = await Rooms.findOneById(roomId, { projection: { lm: 1 } });

// if users last seen is greater than room's last message, it means the user already have this room marked as read
if (!room || (userLastSeen && userLastSeen > room.lm)) {
if (!room || userLastSeen > room.lm) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/server/models/raw/Messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@ export class MessagesRaw extends BaseRaw<IMessage> implements IMessagesModel {
);
}

findVisibleUnreadMessagesByRoomAndDate(rid: string, after?: Date): FindCursor<Pick<IMessage, '_id' | 't' | 'pinned' | 'drid' | 'tmid'>> {
findVisibleUnreadMessagesByRoomAndDate(rid: string, after: Date): FindCursor<Pick<IMessage, '_id' | 't' | 'pinned' | 'drid' | 'tmid'>> {
const query = {
unread: true,
rid,
Expand Down
2 changes: 1 addition & 1 deletion packages/model-typings/src/models/IMessagesModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export interface IMessagesModel extends IBaseModel<IMessage> {
userId: string,
after: Date,
): FindCursor<Pick<IMessage, '_id' | 't' | 'pinned' | 'drid' | 'tmid'>>;
findVisibleUnreadMessagesByRoomAndDate(rid: string, after?: Date): FindCursor<Pick<IMessage, '_id' | 't' | 'pinned' | 'drid' | 'tmid'>>;
findVisibleUnreadMessagesByRoomAndDate(rid: string, after: Date): FindCursor<Pick<IMessage, '_id' | 't' | 'pinned' | 'drid' | 'tmid'>>;
setAsReadById(_id: string): Promise<UpdateResult>;
countThreads(): Promise<number>;
addThreadFollowerByThreadId(tmid: string, userId: string): Promise<UpdateResult>;
Expand Down

0 comments on commit 809e522

Please sign in to comment.