matterbridge
matterbridge copied to clipboard
Telegram -> Matrix shows an empty message if relay pictures or any files
Describe the bug An odd empty messages shows every time relying pictures or files from Telegram to Matrix
To Reproduce send picture on Telegram, and an empty message will shows before receiving the picture
Expected behavior The picture/file arrive without this odd empty message every time !!
Screenshots/debug logs https://i.imgur.com/KxZWmbA.png
Environment (please complete the following information): OS: Android Matterbridge version: matterbridge v1.23.2
EDIT: I tried with v1.24.0
-debug you can see [0020] the body is empty, and I don't know why is receiving an empty from telegram!!!
[0000] INFO main: [setupLogger:matterbridge.go:104] Enabling debug logg
ing.
[0000] INFO main: [main:matterbridge.go:44] Running version 1.23.2 73ec
02ab
[0000] INFO router: [Start:gateway/router.go:66] Parsing gateway gateway1
[0000] INFO router: [Start:gateway/router.go:75] Starting bridge: telegra
m.wdwed
[0000] INFO telegram: [Connect:bridge/telegram/telegram.go:44] Connecting
[0000] INFO telegram: [Connect:bridge/telegram/telegram.go:57] Connection s
ucceeded
[0000] INFO telegram: [joinChannels:bridge/bridge.go:77] telegram.wdwed: j
oining -1001302123456 (ID: -1001302123456telegram.wdwed)
[0000] INFO router: [Start:gateway/router.go:75] Starting bridge: matrix.
wdwed
[0000] INFO matrix: [Connect:bridge/matrix/matrix.go:77] Connecting https
://xxx.com
[0001] INFO matrix: [Connect:bridge/matrix/matrix.go:103] Connection succ
eeded
[0001] INFO matrix: [joinChannels:bridge/bridge.go:77] matrix.wdwed: joi
ning !CRhnldqEbdfROxGCRs:xxx.com (ID: !CRhnldqEbdfROxGCRs:xxx.commat
rix.wdwed)
[0002] INFO main: [main:matterbridge.go:68] Gateway(s) started succesfu
lly. Now relaying messages
[0018] DEBUG telegram: [handleRecv:bridge/telegram/handlers.go:121] == Recei
ving event: (*tgbotapi.Message)(nil)
[0019] DEBUG telegram: [HandleDownloadSize:bridge/helper/helper.go:156] Tryi
ng to download "file_44.jpg" with size 98534
[0019] DEBUG telegram: [HandleDownloadData:bridge/helper/helper.go:172] Down
load OK "file_44.jpg" 98534
[0019] DEBUG telegram: [handleRecv:bridge/telegram/handlers.go:173] <= Sendi
ng message from unknown on telegram.wdwed to gateway
[0019] DEBUG telegram: [handleRecv:bridge/telegram/handlers.go:174] <= Messa
ge is config.Message{Text:"", Channel:"-1001302123456", Username:"unknown", User
ID:"", Avatar:"", Account:"telegram.wdwed", Event:"", Protocol:"", Gateway:"",
ParentID:"", Timestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), ID:"
1561", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Nam
e:"file_44.jpg", Data:(*[]uint8)(0xc0008d03d8), Comment:"", URL:"", Size:0, Avat
ar:false, SHA:""}}}}
[0019] DEBUG gateway: [SendMessage:gateway/gateway.go:479] => Sending confi
g.Message{Text:"", Channel:"-1001302123456", Username:"unknown", UserID:"", Avat
ar:"", Account:"telegram.wdwed", Event:"", Protocol:"telegram", Gateway:"gatewa
y1", ParentID:"", Timestamp:time.Date(2022, time.January, 7, 13, 32, 43, 6727810
00, time.Local), ID:"1561", Extra:map[string][]interface {}{"file":[]interface {
}{config.FileInfo{Name:"file_44.jpg", Data:(*[]uint8)(0xc0008d03d8), Comment:"",
URL:"", Size:0, Avatar:false, SHA:""}}}} from telegram.wdwed (-1001302123456)
to matrix.wdwed (!CRhnldqEbdfROxGCRs:xxx.com)
[0019] DEBUG matrix: [Send:bridge/matrix/matrix.go:129] => Receiving confi
g.Message{Text:"", Channel:"!CRhnldqEbdfROxGCRs:xxx.com", Username:"", Use
rID:"", Avatar:"", Account:"telegram.wdwed", Event:"", Protocol:"telegram", Gat
eway:"gateway1", ParentID:"", Timestamp:time.Date(2022, time.January, 7, 13, 32,
43, 672781000, time.Local), ID:"", Extra:map[string][]interface {}{"file":[]int
erface {}{config.FileInfo{Name:"file_44.jpg", Data:(*[]uint8)(0xc0008d03d8), Com
ment:"", URL:"", Size:0, Avatar:false, SHA:""}}}}
[0019] DEBUG matrix: [Send:bridge/matrix/matrix.go:132] Channel !CRhnldqEb
dfROxGCRs:xxx.com maps to channel id !CRhnldqEbdfROxGCRs:xxx.com
[0020] DEBUG matrix: [handleUploadFile:bridge/matrix/matrix.go:509] upload
ing file: file_44.jpg image/jpeg
[0020] DEBUG matrix: [handleEvent:bridge/matrix/matrix.go:354] == Receivin
g event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@wdwedbridgebot:coffe
spot.com", Type:"m.room.message", Timestamp:1641591353985, ID:"$SRt4ZumGTXA2mUYG
Dw3JIEzNExRf9nMbEr3SD_VsqMQ", RoomID:"!CRhnldqEbdfROxGCRs:xxx.com", Redact
s:"", Unsigned:map[string]interface {}{"age":180, "transaction_id":"go1641591163
689785500"}, Content:map[string]interface {}{"body":"", "format":"org.matrix.cus
tom.html", "formatted_body":"", "msgtype":"m.text"}, PrevContent:map[string]inte
rface {}(nil)}
[0022] DEBUG matrix: [handleUploadFile:bridge/matrix/matrix.go:536] sendIm
age mxc://xxx.com/VQAuHkQvLOtGQpFPnMDUPKYk
[0022] DEBUG matrix: [handleUploadFile:bridge/matrix/matrix.go:582] result
: &gomatrix.RespMediaUpload{ContentURI:"mxc://xxx.com/VQAuHkQvLOtGQpFPnMDU
PKYk"}
[0022] DEBUG gateway: [func1:gateway/gateway.go:488] => Send from telegram.
wdwed (-1001302123456) to matrix.wdwed (!CRhnldqEbdfROxGCRs:xxx.com) too
k 2.8799864s
[0023] DEBUG matrix: [handleEvent:bridge/matrix/matrix.go:354] == Receivin
g event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@wdwedbridgebot:coffe
spot.com", Type:"m.room.message", Timestamp:1641591356483, ID:"$MJIogMG2xooMZ6vj
q6nV6cOEq8jwm4oFv6Bg1INJGoA", RoomID:"!CRhnldqEbdfROxGCRs:xxx.com", Redact
s:"", Unsigned:map[string]interface {}{"age":243, "transaction_id":"go1641591166
152762900"}, Content:map[string]interface {}{"body":"file_44.jpg", "info":map[st
ring]interface {}{"thumbnail_info":map[string]interface {}{}}, "msgtype":"m.imag
e", "url":"mxc://xxx.com/VQAuHkQvLOtGQpFPnMDUPKYk"}, PrevContent:map[strin
g]interface {}(nil)}
[0048] DEBUG matrix: [handleEvent:bridge/matrix/matrix.go:354] == Receivin
g event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@wdwed:xxx.com"
, Type:"m.room.redaction", Timestamp:1641591381892, ID:"$N8gtPMovYX55dz_yyo4NIvQ
CarkhNk_Nig11qCYBYFc", RoomID:"!CRhnldqEbdfROxGCRs:xxx.com", Redacts:"$MJI
ogMG2xooMZ6vjq6nV6cOEq8jwm4oFv6Bg1INJGoA", Unsigned:map[string]interface {}{"age
":195}, Content:map[string]interface {}{}, PrevContent:map[string]interface {}(n
il)}
[0056] DEBUG matrix: [handleEvent:bridge/matrix/matrix.go:354] == Receivin
g event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@wdwed:xxx.com"
, Type:"m.room.redaction", Timestamp:1641591389860, ID:"$Y5j1wapTqcjK9kaISbpWFxG
KaN0UeQ56nm4rX30e0lo", RoomID:"!CRhnldqEbdfROxGCRs:xxx.com", Redacts:"$SRt
4ZumGTXA2mUYGDw3JIEzNExRf9nMbEr3SD_VsqMQ", Unsigned:map[string]interface {}{"age
":114}, Content:map[string]interface {}{}, PrevContent:map[string]interface {}(n
il)}
@reckel-jm Hi, do you think you can help with this?