Fix replies to messages with non-ASCII characters
This commit is contained in:
parent
9377d7a155
commit
64515e2c66
2
Makefile
2
Makefile
|
@ -2,7 +2,7 @@
|
|||
|
||||
COMMIT := $(shell git rev-parse --short HEAD)
|
||||
TD_COMMIT := "8517026415e75a8eec567774072cbbbbb52376c1"
|
||||
VERSION := "v1.7.5"
|
||||
VERSION := "v1.7.6"
|
||||
MAKEOPTS := "-j4"
|
||||
|
||||
all:
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
goxmpp "gosrc.io/xmpp"
|
||||
)
|
||||
|
||||
var version string = "1.7.5"
|
||||
var version string = "1.7.6"
|
||||
var commit string
|
||||
|
||||
var sm *goxmpp.StreamManager
|
||||
|
|
|
@ -149,7 +149,12 @@ func HandleMessage(s xmpp.Sender, p stanza.Packet) {
|
|||
"end": body.End,
|
||||
}).Warn(errors.Wrap(err, "Failed to parse fallback end!"))
|
||||
}
|
||||
text = text[:start] + text[end:]
|
||||
|
||||
fullRunes := []rune(text)
|
||||
cutRunes := make([]rune, 0, len(text)-int(end-start))
|
||||
cutRunes = append(cutRunes, fullRunes[:start]...)
|
||||
cutRunes = append(cutRunes, fullRunes[end:]...)
|
||||
text = string(cutRunes)
|
||||
}
|
||||
}
|
||||
var replaceId int64
|
||||
|
|
Loading…
Reference in a new issue