diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-02-22 03:04:44 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-02-22 03:04:44 +0200 |
commit | a79de7ba76757931559af9a6639255a03eddbf18 (patch) | |
tree | 2c418e08facd7a1dd7afb90c0114e8463083d604 | |
parent | 58fff45d69717a9e78d127505527e541e22d3cff (diff) |
Fix unexpected results when clicking some message senders
-rw-r--r-- | ui/message-view.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/message-view.go b/ui/message-view.go index 8d39ab6..3635a7b 100644 --- a/ui/message-view.go +++ b/ui/message-view.go @@ -358,14 +358,16 @@ func (view *MessageView) handleMessageClick(message *messages.UIMessage, mod tce } func (view *MessageView) handleUsernameClick(message *messages.UIMessage, prevMessage *messages.UIMessage) bool { - if prevMessage != nil && prevMessage.Sender() == message.Sender() { - return false - } + // TODO this is needed if senders are hidden for messages from the same sender (see Draw method) + //if prevMessage != nil && prevMessage.SenderName == message.SenderName { + // return false + //} - if len(message.Sender()) == 0 { + if message.SenderName == "---" || message.SenderName == "-->" || message.SenderName == "<--" || message.Type == mautrix.MsgEmote { return false } - sender := fmt.Sprintf("[%s](https://matrix.to/#/%s)", message.Sender(), message.SenderID) + + sender := fmt.Sprintf("[%s](https://matrix.to/#/%s)", message.SenderName, message.SenderID) cursorPos := view.parent.input.GetCursorOffset() text := view.parent.input.GetText() |