aboutsummaryrefslogtreecommitdiff
path: root/ui/view-main.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-04-25 07:01:00 +0300
committerTulir Asokan <tulir@maunium.net>2018-04-25 00:42:05 +0300
commit576bab9e2e9589942d4cac8742fa1b54e8b237f9 (patch)
treedaea2d011127c00a254182bd957d2e5fe93fe9aa /ui/view-main.go
parent3de07ad550776a57e96399660c0ccd9c58dafcf3 (diff)
Fix People tag
Diffstat (limited to 'ui/view-main.go')
-rw-r--r--ui/view-main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/view-main.go b/ui/view-main.go
index d20fed3..4b01829 100644
--- a/ui/view-main.go
+++ b/ui/view-main.go
@@ -67,6 +67,7 @@ func (ui *GomuksUI) NewMainView() tview.Primitive {
mainView.AddItem(mainView.roomList, 25, 0, false)
mainView.AddItem(widget.NewBorder(), 1, 0, false)
mainView.AddItem(mainView.roomView, 0, 1, true)
+ mainView.BumpFocus()
ui.mainView = mainView
@@ -398,6 +399,7 @@ func sendNotification(room *rooms.Room, sender, text string, critical, sound boo
if room.GetTitle() != sender {
sender = fmt.Sprintf("%s (%s)", sender, room.GetTitle())
}
+ debug.Printf("Sending notification with body \"%s\" from %s in room ID %s (critical=%v, sound=%v)", text, sender, room.ID, critical, sound)
notification.Send(sender, text, critical, sound)
}
@@ -405,7 +407,7 @@ func (view *MainView) NotifyMessage(room *rooms.Room, message ifc.Message, shoul
// 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.
- isFocused := view.lastFocusTime.Add(30 * time.Second).Before(time.Now())
+ isFocused := time.Now().Add(-30 * 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