Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward from a telegram group with image, only shares image #1649

Closed
soloam opened this issue Dec 6, 2021 · 1 comment
Closed

Forward from a telegram group with image, only shares image #1649

soloam opened this issue Dec 6, 2021 · 1 comment
Labels

Comments

@soloam
Copy link
Contributor

soloam commented Dec 6, 2021

Describe the bug
When I forward a message from a group (message with text and image) to another with the bridge, it only forwards to discord (only tested in discord) the image, not the text

To Reproduce
Add a gateway with discord and telegram, forward to a telegram group a message with text and image, and the message will be send by the matterbridge to discord, but only the image

Expected behavior
send both text and image

Screenshots/debug logs

Telegram:
image

Discord:
image

Environment (please complete the following information):

  • OS: freebsd
  • Matterbridge version: 1.23.2 73ec02a
@soloam soloam added the bug label Dec 6, 2021
@soloam
Copy link
Contributor Author

soloam commented Dec 7, 2021

I did a debug, and the this is the result:

[0474] DEBUG telegram:     [handleRecv:bridge/telegram/handlers.go:174] <= Message is config.Message{Text:"Forwarded from unknown: ", Channel:"-000000000", Username:"UseName", UserID:"000000000", Avatar:"", Account:"telegram.mytelegram", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), ID:"16", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_2.jpg", Data:(*[]uint8)(0xc0004702e8), Comment:"✔️ Xiaomi Mijia Mi Smart Standing Fan 2 Lite Fan |EU| 🇪🇺️\n🥇 Price: $52.49 (47.05€)\n🔥 The lowest price (in this store)! 🔥 Best before: 61.49 USD\n❇️ #Aliexpress Direct link ✂️ https://bit.ly/3ouSJed\n✏️ PROMOTION CODE ⭕️ 12DEC7\n\n✅ Similar products: https://bit.ly/3EAZGA4\n✅ Coupons: http://bit.ly/2I1VXQb", URL:"", Size:0, Avatar:false, SHA:""}}}}
[0474] DEBUG gateway:      [SendMessage:gateway/gateway.go:479] => Sending config.Message{Text:"Forwarded from unknown: ", Channel:"-000000000", Username:"UseName", UserID:"000000000", Avatar:"", Account:"telegram.mytelegram", Event:"", Protocol:"telegram", Gateway:"mygateway_test", ParentID:"", Timestamp:time.Date(2021, time.December, 7, 13, 47, 3, 279095466, time.Local), ID:"16", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_2.jpg", Data:(*[]uint8)(0xc0004702e8), Comment:"✔️ Xiaomi Mijia Mi Smart Standing Fan 2 Lite Fan |EU| 🇪🇺️\n🥇 Price: $52.49 (47.05€)\n🔥 The lowest price (in this store)! 🔥 Best before: 61.49 USD\n❇️ #Aliexpress Direct link ✂️ https://bit.ly/3ouSJed\n✏️ PROMOTION CODE ⭕️ 12DEC7\n\n✅ Similar products: https://bit.ly/3EAZGA4\n✅ Coupons: http://bit.ly/2I1VXQb", URL:"", Size:0, Avatar:false, SHA:""}}}} from telegram.mytelegram (-000000000) to discord.mydiscord (ID:000000000000000000)
[0474] DEBUG discord:      [Send:bridge/discord/discord.go:235] => Receiving config.Message{Text:"Forwarded from unknown: ", Channel:"ID:000000000000000000", Username:"[telegram] <UseName> ", UserID:"000000000", Avatar:"", Account:"telegram.mytelegram", Event:"", Protocol:"telegram", Gateway:"mygateway_test", ParentID:"", Timestamp:time.Date(2021, time.December, 7, 13, 47, 3, 279095466, time.Local), ID:"", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_2.jpg", Data:(*[]uint8)(0xc0004702e8), Comment:"✔️ Xiaomi Mijia Mi Smart Standing Fan 2 Lite Fan |EU| 🇪🇺️\n🥇 Price: $52.49 (47.05€)\n🔥 The lowest price (in this store)! 🔥 Best before: 61.49 USD\n❇️ #Aliexpress Direct link ✂️ https://bit.ly/3ouSJed\n✏️ PROMOTION CODE ⭕️ 12DEC7\n\n✅ Similar products: https://bit.ly/3EAZGA4\n✅ Coupons: http://bit.ly/2I1VXQb", URL:"", Size:0, Avatar:false, SHA:""}}}}
[0474] DEBUG discord:      [handleEventWebhook:bridge/discord/webhook.go:139] Processing webhook sending for message &config.Message{Text:"Forwarded from unknown: ", Channel:"ID:000000000000000000", Username:"[telegram] <UseName> ", UserID:"000000000", Avatar:"", Account:"telegram.mytelegram", Event:"", Protocol:"telegram", Gateway:"mygateway_test", ParentID:"", Timestamp:time.Date(2021, time.December, 7, 13, 47, 3, 279095466, time.Local), ID:"", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_2.jpg", Data:(*[]uint8)(0xc0004702e8), Comment:"✔️ Xiaomi Mijia Mi Smart Standing Fan 2 Lite Fan |EU| 🇪🇺️\n🥇 Price: $52.49 (47.05€)\n🔥 The lowest price (in this store)! 🔥 Best before: 61.49 USD\n❇️ #Aliexpress Direct link ✂️ https://bit.ly/3ouSJed\n✏️ PROMOTION CODE ⭕️ 12DEC7\n\n✅ Similar products: https://bit.ly/3EAZGA4\n✅ Coupons: http://bit.ly/2I1VXQb", URL:"", Size:0, Avatar:false, SHA:""}}}}
[0474] DEBUG gateway:      [SendMessage:gateway/gateway.go:498] mID discord.mydiscord: 00000000000000000
[0474] DEBUG gateway:      [func1:gateway/gateway.go:488] => Send from telegram.mytelegram (-000000000) to discord.mydiscord (ID:000000000000000000) took 704.280405ms

It looks like the text is in telegram comment! This should be forwarded as message

soloam added a commit to soloam/matterbridge that referenced this issue Dec 7, 2021
This is a change to handle comments in telegram messages!

Some messages in telegram have comments added to the message! This normally is the description in images or links. This changes appends the comment to the message if available.

This should fix the issue in 42wim#1649
42wim added a commit that referenced this issue Dec 12, 2021
* Add's comments to message in telegram messages

This is a change to handle comments in telegram messages!

Some messages in telegram have comments added to the message! This normally is the description in images or links. This changes appends the comment to the message if available.

This should fix the issue in #1649

* [fix] discord: send comments in extras

Co-authored-by: Wim <wim@42.be>
@soloam soloam closed this as completed Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant