Fix unexpected results when clicking some message senders
This commit is contained in:
parent
58fff45d69
commit
a79de7ba76
@ -358,14 +358,16 @@ func (view *MessageView) handleMessageClick(message *messages.UIMessage, mod tce
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (view *MessageView) handleUsernameClick(message *messages.UIMessage, prevMessage *messages.UIMessage) bool {
|
func (view *MessageView) handleUsernameClick(message *messages.UIMessage, prevMessage *messages.UIMessage) bool {
|
||||||
if prevMessage != nil && prevMessage.Sender() == message.Sender() {
|
// 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 message.SenderName == "---" || message.SenderName == "-->" || message.SenderName == "<--" || message.Type == mautrix.MsgEmote {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(message.Sender()) == 0 {
|
sender := fmt.Sprintf("[%s](https://matrix.to/#/%s)", message.SenderName, message.SenderID)
|
||||||
return false
|
|
||||||
}
|
|
||||||
sender := fmt.Sprintf("[%s](https://matrix.to/#/%s)", message.Sender(), message.SenderID)
|
|
||||||
|
|
||||||
cursorPos := view.parent.input.GetCursorOffset()
|
cursorPos := view.parent.input.GetCursorOffset()
|
||||||
text := view.parent.input.GetText()
|
text := view.parent.input.GetText()
|
||||||
|
Loading…
Reference in New Issue
Block a user