From a79de7ba76757931559af9a6639255a03eddbf18 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 22 Feb 2020 03:04:44 +0200 Subject: Fix unexpected results when clicking some message senders --- ui/message-view.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ui') 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() -- cgit v1.2.3