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

Images are not shown when sent from Matrix to Mattermost #1820

Closed
Extravert-ir opened this issue May 1, 2022 · 3 comments
Closed

Images are not shown when sent from Matrix to Mattermost #1820

Extravert-ir opened this issue May 1, 2022 · 3 comments

Comments

@Extravert-ir
Copy link

Extravert-ir commented May 1, 2022

Describe the bug
When sending an image from Matrix to Mattermost, the message format is broken

Screenshots/debug logs
Matrix side:
Screenshot_20220501_224319
Mattermost side:
Screenshot_20220501_224340
Debug log:

May 01 19:14:34 matrix matterbridge[827765]: time="2022-05-01T19:14:34Z" level=debug msg="== Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@extravert34:matrix.org", Type:"m.room.message", Timestamp:1651432474313, ID:"$aQKG7ezDqoC1Uz822dzjD8mYkcqazvRn5rRTqAvWJ-k", RoomID:"!XGEAMnOHqyMjtyguZz:reactos.org", Redacts:"", Unsigned:map[string]interface {}{}, Content:map[string]interface {}{"body":"RosBE-matrix.png", "info":map[string]interface {}{"h":64, "mimetype":"image/png", "size":7518, "w":64, "xyz.amorgan.blurhash":"UGGvP85d00D4D4h}~p%M00^J#$-3~V-;4=Rp"}, "msgtype":"m.image", "url":"mxc://matrix.org/rmADGAzPKuCCXEZvYtnpoUJg"}, PrevContent:map[string]interface {}(nil)}" func=handleEvent file="bridge/matrix/matrix.go:457" prefix=matrix
May 01 19:14:35 matrix matterbridge[827765]: time="2022-05-01T19:14:35Z" level=debug msg="Trying to download "RosBE-matrix.png" with size 7518" func=HandleDownloadSize file="bridge/helper/helper.go:156" prefix=matrix
May 01 19:14:35 matrix matterbridge[827765]: time="2022-05-01T19:14:35Z" level=debug msg="Download OK "RosBE-matrix.png" 7518" func=HandleDownloadData2 file="bridge/helper/helper.go:177" prefix=matrix
May 01 19:14:35 matrix matterbridge[827765]: time="2022-05-01T19:14:35Z" level=debug msg="<= Sending message from @extravert34:matrix.org on matrix.reactos to gateway" func=handleEvent file="bridge/matrix/matrix.go:522" prefix=matrix
May 01 19:14:35 matrix matterbridge[827765]: time="2022-05-01T19:14:35Z" level=debug msg="=> Sending config.Message{Text:"RosBE-matrix.png", Channel:"#lang-ru:reactos.org", Username:"extravert34", UserID:"@extravert34:matrix.org", Avatar:"", Account:"matrix.reactos", Event:"", Protocol:"matrix", Gateway:"reactos-ru", ParentID:"", Timestamp:time.Date(2022, time.May, 1, 19, 14, 35, 961442170, time.Local), ID:"$aQKG7ezDqoC1Uz822dzjD8mYkcqazvRn5rRTqAvWJ-k", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"RosBE-matrix.png", Data:(*[]uint8)(0xc0013482a0), Comment:"", URL:"https://matrix.reactos.org/_matrix/media/v1/download/matrix.org/rmADGAzPKuCCXEZvYtnpoUJg", Size:0, Avatar:false, SHA:"", NativeID:""}}}} from matrix.reactos (#lang-ru:reactos.org) to mattermost.reactos (russian)" func=SendMessage file="gateway/gateway.go:482" prefix=gateway
May 01 19:14:35 matrix matterbridge[827765]: time="2022-05-01T19:14:35Z" level=debug msg="=> Receiving config.Message{Text:"RosBE-matrix.png", Channel:"russian", Username:"extravert34 (Matrix)", UserID:"@extravert34:matrix.org", Avatar:"https://chat.reactos.org/res/icons/freenode.png", Account:"matrix.reactos", Event:"", Protocol:"matrix", Gateway:"reactos-ru", ParentID:"", Timestamp:time.Date(2022, time.May, 1, 19, 14, 35, 961442170, time.Local), ID:"", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"RosBE-matrix.png", Data:(*[]uint8)(0xc0013482a0), Comment:"", URL:"https://matrix.reactos.org/_matrix/media/v1/download/matrix.org/rmADGAzPKuCCXEZvYtnpoUJg", Size:0, Avatar:false, SHA:"", NativeID:""}}}}" func=Send file="bridge/mattermost/mattermost.go:149" prefix=mattermost
May 01 19:14:35 matrix matterbridge[827765]: time="2022-05-01T19:14:35Z" level=error msg="couldn't mark message as read contents=[123 34 101 114 114 99 111 100 101 34 58 34 77 95 78 79 84 95 74 83 79 78 34 44 34 101 114 114 111 114 34 58 34 67 111 110 116 101 110 116 32 110 111 116 32 74 83 79 78 46 34 125] msg=Failed to POST JSON to /_matrix/client/r0/rooms/!XGEAMnOHqyMjtyguZz:reactos.org/receipt/m.read/$aQKG7ezDqoC1Uz822dzjD8mYkcqazvRn5rRTqAvWJ-k code=400 wrapped=M_NOT_JSON: Content not JSON." func=handleEvent file="bridge/matrix/matrix.go:527" prefix=matrix
May 01 19:14:36 matrix matterbridge[827765]: time="2022-05-01T19:14:36Z" level=debug msg="=> Send from matrix.reactos (#lang-ru:reactos.org) to mattermost.reactos (russian) took 96.418997ms" func=func1 file="gateway/gateway.go:491" prefix=gateway
May 01 19:14:36 matrix matterbridge[827765]: time="2022-05-01T19:14:36Z" level=debug msg="map[string]interface {}{"channel_display_name":"Russian / Русский", "channel_name":"russian", "channel_type":"O", "post":"{\"id\":\"7g36bysadtdbxny3m6cnzr9fao\",\"create_at\":1651432476025,\"update_at\":1651432476025,\"edit_at\":0,\"delete_at\":0,\"is_pinned\":false,\"user_id\":\"jzx7a8c9qfrdzf1d44gijerkbe\",\"channel_id\":\"3rgdko8m87gguf7mhd5gbje5ro\",\"root_id\":\"\",\"parent_id\":\"\",\"original_id\":\"\",\"message\":\"RosBE-matrix.pnghttps://matrix.reactos.org/_matrix/media/v1/download/matrix.org/rmADGAzPKuCCXEZvYtnpoUJg\",\"type\":\"\",\"props\":{\"from_webhook\":\"true\",\"matterbridge_c9nd8len53pm5ubcmpp0\":true,\"override_icon_url\":\"https://chat.reactos.org/res/icons/freenode.png\",\"override_username\":\"extravert34 (Matrix)\",\"webhook_display_name\":\"Matterbridge\"},\"hashtags\":\"\",\"pending_post_id\":\"\",\"reply_count\":0,\"last_reply_at\":0,\"participants\":null,\"metadata\":{}}", "sender_name":"extravert34 (Matrix)", "set_online":true, "team_id":"n3mm5jpeopdfpc4c9jphr8d6kc"}" func=handleMatterClient file="bridge/mattermost/handlers.go:136" prefix=mattermost
May 01 19:14:36 matrix matterbridge[827765]: time="2022-05-01T19:14:36Z" level=debug msg="sent by matterbridge, ignoring" func=skipMessage file="bridge/mattermost/helpers.go:275" prefix=mattermost
May 01 19:14:36 matrix matterbridge[827765]: time="2022-05-01T19:14:36Z" level=debug msg="Skipped message: &matterclient.Message{Raw:(*model.WebSocketEvent)(0xc000720d20), Post:(*model.Post)(0xc000459080), Team:"reactos", Channel:"russian", Username:"rosbridge", Text:"RosBE-matrix.pnghttps://matrix.reactos.org/_matrix/media/v1/download/matrix.org/rmADGAzPKuCCXEZvYtnpoUJg", Type:"", UserID:"jzx7a8c9qfrdzf1d44gijerkbe"}" func=handleMatterClient file="bridge/mattermost/handlers.go:139" prefix=mattermost

Environment:

  • OS: Ubuntu 20.04
  • Matterbridge version: 1.24.0 65c7ac8
  • Mattermost version: 5.37.2

Additional context
Config file:

[general]
  MediaDownloadSize=52428800

[matrix]
  [matrix.reactos]
  Server="https://matrix.reactos.org"
  Login="rosbridge"
  Password="..."
  RemoteNickFormat="<{NICK}> "

[mattermost]
  [mattermost.reactos]
  Server="chat.reactos.org"
  Team="reactos"
  Login="RosBridge"
  Password="..."
  WebhookURL="..."
  IconURL="..."
  RemoteNickFormat="{NICK} (Matrix)"

[[gateway]]
name="reactos"
enable=true
inout = [
  { account="matrix.reactos", channel="#talk:reactos.org" },
  { account="mattermost.reactos", channel="town-square" }
]
@42wim
Copy link
Owner

42wim commented May 1, 2022

Can you try with latest version 1.25.0 ?

@Extravert-ir
Copy link
Author

Updated, same effect

@42wim 42wim closed this as completed in 888c8b9 May 1, 2022
@42wim
Copy link
Owner

42wim commented May 1, 2022

Should be fixed now but you're probably not going to use it because of webhook limitations :)

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

2 participants