Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Commit

Permalink
Ignore mentions from muted channel
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed May 1, 2020
1 parent f424c36 commit fe94972
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/model/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class Channel extends MessageList {
this.isMember = false
this.isPrivate = false
this.isDefault = false
this.isMuted = false

this.openedThreads = []
}
Expand Down
5 changes: 4 additions & 1 deletion lib/model/message-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class MessageList {
this.draft = null
this.mentions = 0

// Whether the notifications of the channel is muted.
this.isMuted = false

// Whether all messages of channel have been read.
this.isRead = true

Expand Down Expand Up @@ -164,7 +167,7 @@ class MessageList {
if (!this.firstUnreadTs)
this.firstUnreadTs = this.latestTs
// New dm messages are always treated as mentions.
if (message.hasMention || this.type === 'dm') {
if (!this.isMuted && (message.hasMention || this.type === 'dm')) {
this.mentions++
this.onUpdateMentions.dispatch()
}
Expand Down

0 comments on commit fe94972

Please sign in to comment.