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

The Matterbridge process is failing to transcribe correctly the embedded URL in the original Telegram posts #1525

Closed
NedXR opened this issue Jun 18, 2021 · 4 comments

Comments

@NedXR
Copy link

NedXR commented Jun 18, 2021

Describe the bug
The Matterbridge process is failing to transcribe correctly the embedded URL in the original Telegram posts.
Looks like the URL is simply transferred within the post's text and the Markdown 'envelope' is missed, so that the URL is no longer a hyperlink. It looks messy and won't be usable as a link, unless you know and copy/paste the appropriate text string, etc. If you use the text Markdown in the Telegram post, it won't show correctly - just the actual URL. But, on transfer to Mattermost, the Markdown text-link shows correctly (as you'd expect).
If you use the Telegram hyperlink CTRL+K function, the text-link shows OK in Telegram, but you get problems on Mattermost. Apparently, the text following the Telegram hyperlink gets added to the URL and, if you click it, you get a 404 Error.
Is there any chance that the Matterbridge API (or whatever) can be modified? If not, then users must be warned of distortion, etc.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
Is there any chance that the Matterbridge API (or whatever) can be modified? If not, then users must be warned of distortion, etc.

Screenshots/debug logs
If applicable, add screenshots to help explain your problem.
Use logs from running matterbridge -debug if possible.
Cymru_Chat_Markdown_Test_01_18Jun21
Rebellion_Broadcast_Telegram_vs_Matterbridge_17Jun21

Environment (please complete the following information):

  • OS: [e.g. linux] - unsure as the issue was reported by someone else
  • Matterbridge version: output of matterbridge -version - again unsure sorry
  • If self compiled: output of git rev-parse HEAD - I don't know what this means.

Additional context
Please add your configuration file (be sure to exclude or anonymize private data (tokens/passwords))

@NedXR NedXR added the bug label Jun 18, 2021
@42wim
Copy link
Owner

42wim commented Jun 24, 2021

Hi, thanks for the screenshots, they help, but I really need a debug log and the matterbridge version before I can help.
(I don't have telegram myself so I rely on the debug logs)

@pasith3e
Copy link

Hi,

the same Problem also occurs when relaying from Telegram to Whatsapp.
The URL is probably transcribed so no Link Preview is displayed.
Version used is: 1.22.3 e45bbe4 on Linux 64Bit
Debug Log:

[0037]  INFO whatsapp:     [Login:bridge/whatsapp/whatsapp.go:147] Logged into session: whatsapp.Session{ClientId:"XXXXXXXXXXXXXXXX", ClientToken:"XXXXXXXXXXXXXXXX", ServerToken:"XXXXXXXXXXXXXXXX", EncKey:[]uint8{XXXXXXXXXXXXXXXX}, Wid:"XXXXXXXXXXXXXXXX"}

[0037]  INFO whatsapp:     [Login:bridge/whatsapp/whatsapp.go:148] Connection: &whatsapp.Conn{ws:(*whatsapp.websocketWrapper)(0xc0006c6030), listener:(*whatsapp.listenerWrapper)(0xc0006d4160), connected:true, loggedIn:true, wg:(*sync.WaitGroup)(0xcXXXXXXXXXXXXXXXX), session:(*whatsapp.Session)(0xXXXXXXXXXXXXXXXX), sessionLock:0x0, handler:[]whatsapp.Handler{(*bwhatsapp.Bwhatsapp)(0xc00023a810)}, msgCount:3, msgTimeout:20000000000, Info:(*whatsapp.Info)(0xc000160000), Store:(*whatsapp.Store)(0xc000401770), ServerLastSeen:time.Time{wall:0x4a62f80, ext:63766000475, loc:(*time.Location)(0x339b760)}, timeTag:"695", longClientName:"github.com/Rhymen/go-whatsapp", shortClientName:"go-whatsapp", clientVersion:"0.1.0", loginSessionLock:sync.RWMutex{w:sync.Mutex{state:0, sema:0x0}, writerSem:0x0, readerSem:0x0, readerCount:0, readerWait:0}, Proxy:(func(*http.Request) (*url.URL, error))(nil), writerLock:sync.RWMutex{w:sync.Mutex{state:0, sema:0x0}, writerSem:0x0, readerSem:0x0, readerCount:0, readerWait:0}}

[0038] ERROR whatsapp:     [HandleError:bridge/whatsapp/handlers.go:40] message type not implemented

[0038]  INFO whatsapp:     [joinChannels:bridge/bridge.go:77] whatsapp.mywhatsapp: joining [email protected] (ID: [email protected])

[0038] DEBUG whatsapp:     [func1:bridge/whatsapp/whatsapp.go:112] Getting user avatars..

[0038]  INFO router:       [Start:gateway/router.go:75] Starting bridge: telegram.mytelegram 

[0038]  INFO telegram:     [Connect:bridge/telegram/telegram.go:46] Connecting

[0038]  INFO telegram:     [Connect:bridge/telegram/telegram.go:59] Connection succeeded

[0038]  INFO telegram:     [joinChannels:bridge/bridge.go:77] telegram.mytelegram: joining -XXXXXXXXXXXXXXXX (ID: -XXXXXXXXXXXXXXXXtelegram.mytelegram)

[0038]  INFO main:         [main:matterbridge.go:70] Gateway(s) started succesfully. Now relaying messages

[0057] DEBUG whatsapp:     [func1:bridge/whatsapp/whatsapp.go:125] Finished getting avatars..

[0069] DEBUG telegram:     [handleRecv:bridge/telegram/handlers.go:121] == Receiving event: &tgbotapi.Message{MessageID:122, From:(*tgbotapi.User)(0xXXXXXXXXXXXXXXXX), Date:1630403743, Chat:(*tgbotapi.Chat)(0xXXXXXXXXXXXXXXXX), ForwardFrom:(*tgbotapi.User)(nil), ForwardFromChat:(*tgbotapi.Chat)(nil), ForwardFromMessageID:0, ForwardDate:0, ReplyToMessage:(*tgbotapi.Message)(nil), EditDate:0, Text:"Aaaaa\nhttps://www.cnn.com/2021/08/31/politics/americas-afghan-war-is-over-joe-biden-legacy/index.html", Entities:(*[]tgbotapi.MessageEntity)(0xXXXXXXXXXXXXXXXX), CaptionEntities:(*[]tgbotapi.MessageEntity)(nil), Audio:(*tgbotapi.Audio)(nil), Document:(*tgbotapi.Document)(nil), Animation:(*tgbotapi.ChatAnimation)(nil), Game:(*tgbotapi.Game)(nil), Photo:(*[]tgbotapi.PhotoSize)(nil), Sticker:(*tgbotapi.Sticker)(nil), Video:(*tgbotapi.Video)(nil), VideoNote:(*tgbotapi.VideoNote)(nil), Voice:(*tgbotapi.Voice)(nil), Caption:"", Contact:(*tgbotapi.Contact)(nil), Location:(*tgbotapi.Location)(nil), Venue:(*tgbotapi.Venue)(nil), NewChatMembers:(*[]tgbotapi.User)(nil), LeftChatMember:(*tgbotapi.User)(nil), NewChatTitle:"", NewChatPhoto:(*[]tgbotapi.PhotoSize)(nil), DeleteChatPhoto:false, GroupChatCreated:false, SuperGroupChatCreated:false, ChannelChatCreated:false, MigrateToChatID:0, MigrateFromChatID:0, PinnedMessage:(*tgbotapi.Message)(nil), Invoice:(*tgbotapi.Invoice)(nil), SuccessfulPayment:(*tgbotapi.SuccessfulPayment)(nil), PassportData:(*tgbotapi.PassportData)(nil)}

[0069] DEBUG telegram:     [handleRecv:bridge/telegram/handlers.go:173] <= Sending message from XXXXXXXXXXXXXXXX on telegram.mytelegram to gateway

[0069] DEBUG telegram:     [handleRecv:bridge/telegram/handlers.go:174] <= Message is config.Message{Text:"Aaaaa\nhttps://www.cnn.com/2021/08/31/politics/americas-afghan-war-is-over-joe-biden-legacy/index.html", Channel:"-XXXXXXXXXXXXXXXX", Username:"XXXXXXXXXXXXXXXX", UserID:"XXXXXXXXXXXXXXXX", Avatar:"", Account:"telegram.mytelegram", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}, ID:"122", Extra:map[string][]interface {}{}}

[0069] DEBUG gateway:      [SendMessage:gateway/gateway.go:479] => Sending config.Message{Text:"Aaaaa\nhttps://www.cnn.com/2021/08/31/politics/americas-afghan-war-is-over-joe-biden-legacy/index.html", Channel:"-XXXXXXXXXXXXXXXX", Username:"XXXXXXXXXXXXXXXX", UserID:"XXXXXXXXXXXXXXXX", Avatar:"", Account:"telegram.mytelegram", Event:"", Protocol:"telegram", Gateway:"gateway 1", ParentID:"", Timestamp:time.Time{wall:0xc0439d07f95fb9dc, ext:69656824138, loc:(*time.Location)(0x339b760)}, ID:"122", Extra:map[string][]interface {}{}} from telegram.mytelegram (-XXXXXXXXXXXXXXXX) to whatsapp.mywhatsapp ([email protected])

[0069] DEBUG whatsapp:     [Send:bridge/whatsapp/whatsapp.go:277] => Receiving config.Message{Text:"Aaaaa\nhttps://www.cnn.com/2021/08/31/politics/americas-afghan-war-is-over-joe-biden-legacy/index.html", Channel:"[email protected]", Username:"", UserID:"XXXXXXXXXXXXXXXX", Avatar:"", Account:"telegram.mytelegram", Event:"", Protocol:"telegram", Gateway:"gateway 1", ParentID:"", Timestamp:time.Time{wall:0xc0439d07f95fb9dc, ext:69656824138, loc:(*time.Location)(0x339b760)}, ID:"", Extra:map[string][]interface {}{}}

[0069] DEBUG whatsapp:     [Send:bridge/whatsapp/whatsapp.go:324] => Sending config.Message{Text:"Aaaaa\nhttps://www.cnn.com/2021/08/31/politics/americas-afghan-war-is-over-joe-biden-legacy/index.html", Channel:"[email protected]", Username:"", UserID:"XXXXXXXXXXXXXXXX", Avatar:"", Account:"telegram.mytelegram", Event:"", Protocol:"telegram", Gateway:"gateway 1", ParentID:"", Timestamp:time.Time{wall:0xc0439d07f95fb9dc, ext:69656824138, loc:(*time.Location)(0x339b760)}, ID:"", Extra:map[string][]interface {}{}}

[0070] DEBUG gateway:      [SendMessage:gateway/gateway.go:498] mID whatsapp.mywhatsapp: XXXXXXXXXXXXXXXX

[0070] DEBUG gateway:      [func1:gateway/gateway.go:488] => Send from telegram.mytelegram (-XXXXXXXXXXXXXXXX) to whatsapp.mywhatsapp ([email protected]) took 585.619877ms

@liqsliu
Copy link

liqsliu commented Oct 13, 2021

Screenshot_20211013-115245
Screenshot_20211013-101841

@42wim
Copy link
Owner

42wim commented Mar 31, 2022

Fixed by #1765

@42wim 42wim closed this as completed Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants