Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Add option on Channel Settings: Hide Notifications and Hide Unread Room Status (#2707, #2143) #5373

Merged
merged 14 commits into from
Apr 19, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Stops notifications on direct messages when set to disabled
  • Loading branch information
marceloschmidt committed Mar 22, 2017
commit 6dfab4aafb3b11806ea4a686640acb8c8bfc6d11
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ RocketChat.models.Subscriptions.findNotificationPreferencesByRoom = function(roo
{audioNotification: {$exists: true}},
{desktopNotifications: {$exists: true}},
{desktopNotificationDuration: {$exists: true}},
{mobilePushNotifications: {$exists: true}}
{mobilePushNotifications: {$exists: true}},
{disableNotifications: {$exists: true}}
]
};

Expand Down
7 changes: 5 additions & 2 deletions packages/rocketchat-ui-sidenav/client/channels.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ Template.channels.helpers
query.f = { $ne: true }

if Meteor.user()?.settings?.preferences?.unreadRoomsMode
query.alert =
$ne: true
query.$or = [
alert: $ne: true
,
hideUnreadStatus: true
]

return ChatSubscription.find query, { sort: 't': 1, 'name': 1 }

Expand Down
7 changes: 5 additions & 2 deletions packages/rocketchat-ui-sidenav/client/combined.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ Template.combined.helpers
query.f = { $ne: true }

if Meteor.user()?.settings?.preferences?.unreadRoomsMode
query.alert =
$ne: true
query.$or = [
alert: $ne: true
,
hideUnreadStatus: true
]

return ChatSubscription.find query, { sort: 'name': 1 }

Expand Down
7 changes: 5 additions & 2 deletions packages/rocketchat-ui-sidenav/client/directMessages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ Template.directMessages.helpers
query = { t: { $in: ['d']}, f: { $ne: true }, open: true }

if Meteor.user()?.settings?.preferences?.unreadRoomsMode
query.alert =
$ne: true
query.$or = [
alert: $ne: true
,
hideUnreadStatus: true
]

return ChatSubscription.find query, { sort: 't': 1, 'name': 1 }
7 changes: 5 additions & 2 deletions packages/rocketchat-ui-sidenav/client/privateGroups.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ Template.privateGroups.helpers
query = { t: { $in: ['p']}, f: { $ne: true }, open: true }

if Meteor.user()?.settings?.preferences?.unreadRoomsMode
query.alert =
$ne: true
query.$or = [
alert: $ne: true
,
hideUnreadStatus: true
]

return ChatSubscription.find query, { sort: 't': 1, 'name': 1 }

Expand Down
7 changes: 5 additions & 2 deletions packages/rocketchat-ui-sidenav/client/starredRooms.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ Template.starredRooms.helpers
query = { f: true, open: true }

if Meteor.user()?.settings?.preferences?.unreadRoomsMode
query.alert =
$ne: true
query.$or = [
alert: $ne: true
,
hideUnreadStatus: true
]

return ChatSubscription.find query, { sort: 't': 1, 'name': 1 }
total: ->
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-ui-sidenav/client/unreadRooms.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ Template.unreadRooms.onCreated ->
query =
alert: true
open: true
hideUnreadStatus: { $ne: true }

@unreadRooms = ChatSubscription.find query, { sort: 't': 1, 'name': 1 }