diff --git a/Makefile b/Makefile index 33bedad..ef6aef4 100644 --- a/Makefile +++ b/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: diff --git a/telegabber.go b/telegabber.go index 37d5890..3802764 100644 --- a/telegabber.go +++ b/telegabber.go @@ -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 diff --git a/xmpp/handlers.go b/xmpp/handlers.go index e85dfc9..36f9cf9 100644 --- a/xmpp/handlers.go +++ b/xmpp/handlers.go @@ -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