Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions .changeset/lemon-lions-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

fixes the possibility of see new messages without being subscribed to a public channel.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export class NotificationsModule {
if (!canAccess) {
// verify if can preview messages from public channels
if (room.t === 'c' && this.userId) {
return Authorization.hasPermission(this.userId, 'preview-c-room');
const subscription = await Subscriptions.findOne({ rid: room._id });
Comment thread
tiagoevanp marked this conversation as resolved.
Outdated
return !!subscription && Authorization.hasPermission(this.userId, 'preview-c-room');
}
return false;
}
Expand Down Expand Up @@ -186,6 +187,7 @@ export class NotificationsModule {
if (!this.userId) {
return false;
}

const canAccess = await Authorization.canAccessRoomId(room._id, this.userId);

return canAccess;
Expand Down