summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/telegram/handlers.go')
-rw-r--r--bridge/telegram/handlers.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go
index 48cfd316..dbbc36ea 100644
--- a/bridge/telegram/handlers.go
+++ b/bridge/telegram/handlers.go
@@ -181,13 +181,15 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
// sends a EVENT_AVATAR_DOWNLOAD message to the gateway if successful.
// logs an error message if it fails
func (b *Btelegram) handleDownloadAvatar(userid int, channel string) {
- rmsg := config.Message{Username: "system",
- Text: "avatar",
- Channel: channel,
- Account: b.Account,
- UserID: strconv.Itoa(userid),
- Event: config.EventAvatarDownload,
- Extra: make(map[string][]interface{})}
+ rmsg := config.Message{
+ Username: "system",
+ Text: "avatar",
+ Channel: channel,
+ Account: b.Account,
+ UserID: strconv.Itoa(userid),
+ Event: config.EventAvatarDownload,
+ Extra: make(map[string][]interface{}),
+ }
if _, ok := b.avatarMap[strconv.Itoa(userid)]; !ok {
photos, err := b.c.GetUserProfilePhotos(tgbotapi.UserProfilePhotosConfig{UserID: userid, Limit: 1})
@@ -413,7 +415,7 @@ func (b *Btelegram) handleQuote(message, quoteNick, quoteMessage string) string
if format == "" {
format = "{MESSAGE} (re @{QUOTENICK}: {QUOTEMESSAGE})"
}
- quoteMessagelength := len(quoteMessage)
+ quoteMessagelength := len([]rune(quoteMessage))
if b.GetInt("QuoteLengthLimit") != 0 && quoteMessagelength >= b.GetInt("QuoteLengthLimit") {
runes := []rune(quoteMessage)
quoteMessage = string(runes[0:b.GetInt("QuoteLengthLimit")])