From 5a2c74514dd672343fbd012ab864518b9ee12957 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 6 Mar 2020 10:53:23 +0200 Subject: [PATCH] Fix selecting other users' messages --- ui/room-view.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ui/room-view.go b/ui/room-view.go index 55d1c2b..3c4be8f 100644 --- a/ui/room-view.go +++ b/ui/room-view.go @@ -478,9 +478,7 @@ func (view *RoomView) findMessage(current *event.Event, ownMessage, forward bool if evt.EventID == "" || evt.EventID == evt.TxnID || evt.IsService { continue } else if currentFound { - if ownMessage && evt.SenderID == self && evt.Event.Type == mautrix.EventMessage { - return evt - } else if !ownMessage { + if !ownMessage || (evt.SenderID == self && evt.Event.Type == mautrix.EventMessage) { return evt } } else if evt.EventID == current.ID { @@ -513,7 +511,7 @@ func (view *RoomView) SelectNext() { if msgView.selected == nil { return } - foundMsg := view.findMessage(msgView.selected.GetEvent(), true, true) + foundMsg := view.findMessage(msgView.selected.GetEvent(), false, true) if foundMsg != nil { msgView.SetSelected(foundMsg) // TODO scroll selected message into view @@ -522,7 +520,7 @@ func (view *RoomView) SelectNext() { func (view *RoomView) SelectPrevious() { msgView := view.MessageView() - foundMsg := view.findMessage(msgView.selected.GetEvent(), true, false) + foundMsg := view.findMessage(msgView.selected.GetEvent(), false, false) if foundMsg != nil { msgView.SetSelected(foundMsg) // TODO scroll selected message into view