mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-08-05 04:07:07 +00:00
Fix calculating reply end offset
This commit is contained in:
parent
84a6484e86
commit
a17b4892fc
1 changed files with 3 additions and 1 deletions
|
|
@ -1734,8 +1734,10 @@ func (c *Client) messageToPrefix(message *client.Message, previewString string,
|
|||
reply = gwReply
|
||||
|
||||
var replyStart, replyEnd int
|
||||
var hadPrefix bool
|
||||
|
||||
if len(prefix) > 0 {
|
||||
hadPrefix = true
|
||||
replyStart = c.countCharsInLines(&prefix) + (len(prefix)-1)*len(messageHeaderSeparator)
|
||||
}
|
||||
|
||||
|
|
@ -1743,7 +1745,7 @@ func (c *Client) messageToPrefix(message *client.Message, previewString string,
|
|||
prefix = append(prefix, replyLine)
|
||||
|
||||
replyEnd = replyStart + utf8.RuneCountInString(replyLine)
|
||||
if len(prefix) > 0 {
|
||||
if hadPrefix {
|
||||
replyEnd += len(messageHeaderSeparator)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue