From be3dfb251d2fde30bb6d04b6ac96393c2af23c74 Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 25 Feb 2021 23:28:54 +0100 Subject: [PATCH 1/2] Check rune length instead of bytes (telegram). Fixes #1409 (#1412) --- bridge/telegram/handlers.go | 18 ++++++++++-------- 1 file 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")]) From 3a8857c8c9efb2c67fb8c175f31d2b9c617b771b Mon Sep 17 00:00:00 2001 From: powerjungle Date: Sat, 13 Mar 2021 22:06:01 +0100 Subject: [PATCH 2/2] Add Facebook messenger api bridge URL to README.md (#1425) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0c76fd91..22bf9d0d 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,7 @@ And more... ### 3rd party via matterbridge api - [Discourse](https://github.com/DeclanHoare/matterbabble) +- [Facebook messenger](https://github.com/powerjungle/fbridge-asyncio) - [Facebook messenger](https://github.com/VictorNine/fbridge) - [Minecraft](https://github.com/elytra/MatterLink) - [Minecraft](https://github.com/raws/mattercraft) @@ -129,6 +130,7 @@ Used by the projects below. Feel free to make a PR to add your project to this l - [Minecraft](https://github.com/raws/mattercraft) (Matterbridge link for Minecraft Server chat) - [pyCord](https://github.com/NikkyAI/pyCord) (crossplatform chatbot) - [Mattereddit](https://github.com/bonehurtingjuice/mattereddit) (Reddit chat support) +- [fbridge-asyncio](https://github.com/powerjungle/fbridge-asyncio) (Facebook messenger support) - [fbridge](https://github.com/VictorNine/fbridge) (Facebook messenger support) - [matterbabble](https://github.com/DeclanHoare/matterbabble) (Discourse support) - [MatterAMXX](https://forums.alliedmods.net/showthread.php?t=319430) (Counter-Strike, half-life and more via AMXX mod)