diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-05-16 21:42:07 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-05-16 21:42:07 +0300 |
commit | 512ca88804268bf58a754e8a02be556f953db317 (patch) | |
tree | e5b6980661bde6ec1cbcfed1f16f040bea2be2f0 /ui/view-main.go | |
parent | a8a4c72d14027afa669fd7c85ea3a48bde8a3924 (diff) |
Fix notifications about own messages
Diffstat (limited to 'ui/view-main.go')
-rw-r--r-- | ui/view-main.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/view-main.go b/ui/view-main.go index 9f7c690..c8977d3 100644 --- a/ui/view-main.go +++ b/ui/view-main.go @@ -429,6 +429,10 @@ func sendNotification(room *rooms.Room, sender, text string, critical, sound boo } func (view *MainView) NotifyMessage(room *rooms.Room, message ifc.Message, should pushrules.PushActionArrayShould) { + view.roomList.Bump(room) + if message.SenderID() == view.config.Session.UserID { + return + } // Whether or not the room where the message came is the currently shown room. isCurrent := room == view.roomList.SelectedRoom() // Whether or not the terminal window is focused. @@ -436,7 +440,7 @@ func (view *MainView) NotifyMessage(room *rooms.Room, message ifc.Message, shoul isFocused := time.Now().Add(-5 * time.Second).Before(view.lastFocusTime) // Whether or not the push rules say this message should be notified about. - shouldNotify := (should.Notify || !should.NotifySpecified) && message.Sender() != view.config.Session.UserID + shouldNotify := should.Notify || !should.NotifySpecified if !isCurrent || !isFocused { // The message is not in the current room, show new message status in room list. @@ -452,7 +456,6 @@ func (view *MainView) NotifyMessage(room *rooms.Room, message ifc.Message, shoul } message.SetIsHighlight(should.Highlight) - view.roomList.Bump(room) } func (view *MainView) InitialSyncDone() { |