aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2020-03-06 10:53:23 +0200
committerTulir Asokan <tulir@maunium.net>2020-03-06 10:53:23 +0200
commit5a2c74514dd672343fbd012ab864518b9ee12957 (patch)
treea82dd5111449dcd6fd151268b8f20a14f0229b0f /ui
parent5db5cd550d71c9844f3abeb44d3a9bb7fd23ad80 (diff)
Fix selecting other users' messages
Diffstat (limited to 'ui')
-rw-r--r--ui/room-view.go8
1 files 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