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

Matrix <-> Mattermost replies are not propagated #1819

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

Matrix <-> Mattermost replies are not propagated #1819

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

Comments

@Extravert-ir
Copy link

Extravert-ir commented May 1, 2022

Describe the bug
Reply messages between Matrix and Mattermost (both directions) are not being sent as replies, but as ordinary messages.

To Reproduce
Send a reply message in a room bridged between Matrix and Mattermost

Screenshots/debug logs
Sending 2 messages Matrix -> Mattermost

May 01 19:06:36 matrix matterbridge[827765]: time="2022-05-01T19:06:36Z" level=debug msg="== Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@extravert34:matrix.org", Type:"m.room.message", Timestamp:1651431994317, ID:"$ESQJnXcDYuyKAOjjAelorAbSr0WTiH1wuZs7tJDPRgQ", RoomID:"!XGEAMnOHqyMjtyguZz:reactos.org", Redacts:"", Unsigned:map[string]interface {}{}, Content:map[string]interface {}{"body":"message 1", "msgtype":"m.text", "org.matrix.msc1767.text":"message 1"}, PrevContent:map[string]interface {}(nil)}" func=handleEvent file="bridge/matrix/matrix.go:457" prefix=matrix
May 01 19:06:36 matrix matterbridge[827765]: time="2022-05-01T19:06:36Z" 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:06:36 matrix matterbridge[827765]: time="2022-05-01T19:06:36Z" 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/$ESQJnXcDYuyKAOjjAelorAbSr0WTiH1wuZs7tJDPRgQ code=400 wrapped=M_NOT_JSON: Content not JSON." func=handleEvent file="bridge/matrix/matrix.go:527" prefix=matrix
May 01 19:06:36 matrix matterbridge[827765]: time="2022-05-01T19:06:36Z" level=debug msg="=> Sending config.Message{Text:"message 1", 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, 6, 36, 532895041, time.Local), ID:"$ESQJnXcDYuyKAOjjAelorAbSr0WTiH1wuZs7tJDPRgQ", Extra:map[string][]interface {}(nil)} from matrix.reactos (#lang-ru:reactos.org) to mattermost.reactos (russian)" func=SendMessage file="gateway/gateway.go:482" prefix=gateway
May 01 19:06:36 matrix matterbridge[827765]: time="2022-05-01T19:06:36Z" level=debug msg="=> Receiving config.Message{Text:"message 1", 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, 6, 36, 532895041, time.Local), ID:"", Extra:map[string][]interface {}(nil)}" func=Send file="bridge/mattermost/mattermost.go:149" prefix=mattermost
May 01 19:06:36 matrix matterbridge[827765]: time="2022-05-01T19:06:36Z" level=debug msg="=> Send from matrix.reactos (#lang-ru:reactos.org) to mattermost.reactos (russian) took 110.815377ms" func=func1 file="gateway/gateway.go:491" prefix=gateway
May 01 19:06:36 matrix matterbridge[827765]: time="2022-05-01T19:06:36Z" level=debug msg="map[string]interface {}{"channel_display_name":"Russian / Русский", "channel_name":"russian", "channel_type":"O", "post":"{\"id\":\"cygym9sczf8td8pyq5ozxfku1a\",\"create_at\":1651431996615,\"update_at\":1651431996615,\"edit_at\":0,\"delete_at\":0,\"is_pinned\":false,\"user_id\":\"jzx7a8c9qfrdzf1d44gijerkbe\",\"channel_id\":\"3rgdko8m87gguf7mhd5gbje5ro\",\"root_id\":\"\",\"parent_id\":\"\",\"original_id\":\"\",\"message\":\"message 1\",\"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:06:36 matrix matterbridge[827765]: time="2022-05-01T19:06:36Z" level=debug msg="sent by matterbridge, ignoring" func=skipMessage file="bridge/mattermost/helpers.go:275" prefix=mattermost
May 01 19:06:36 matrix matterbridge[827765]: time="2022-05-01T19:06:36Z" level=debug msg="Skipped message: &matterclient.Message{Raw:(*model.WebSocketEvent)(0xc000986600), Post:(*model.Post)(0xc0005c2780), Team:"reactos", Channel:"russian", Username:"rosbridge", Text:"message 1", Type:"", UserID:"jzx7a8c9qfrdzf1d44gijerkbe"}" func=handleMatterClient file="bridge/mattermost/handlers.go:139" prefix=mattermost

May 01 19:06:42 matrix matterbridge[827765]: time="2022-05-01T19:06:42Z" level=debug msg="== Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@extravert34:matrix.org", Type:"m.room.message", Timestamp:1651432000599, ID:"$nEeZtyzPN7-05nW0hbz302ospv8LUqkNkBnTrCp7u1A", RoomID:"!XGEAMnOHqyMjtyguZz:reactos.org", Redacts:"", Unsigned:map[string]interface {}{}, Content:map[string]interface {}{"body":"> <@extravert34:matrix.org> message 1\n\nmessage 2", "format":"org.matrix.custom.html", "formatted_body":"<mx-reply><blockquote><a href=\"https://matrix.to/#/!XGEAMnOHqyMjtyguZz:reactos.org/$ESQJnXcDYuyKAOjjAelorAbSr0WTiH1wuZs7tJDPRgQ?via=reactos.org&via=matrix.org&via=t2bot.io\">In reply to</a> <a href=\"https://matrix.to/#/@extravert34:matrix.org\">@extravert34:matrix.org</a><br>message 1</blockquote></mx-reply>message 2", "m.relates_to":map[string]interface {}{"m.in_reply_to":map[string]interface {}{"event_id":"$ESQJnXcDYuyKAOjjAelorAbSr0WTiH1wuZs7tJDPRgQ"}}, "msgtype":"m.text", "org.matrix.msc1767.message":[]interface {}{map[string]interface {}{"body":"> <@extravert34:matrix.org> message 1\n\nmessage 2", "mimetype":"text/plain"}, map[string]interface {}{"body":"<mx-reply><blockquote><a href=\"https://matrix.to/#/!XGEAMnOHqyMjtyguZz:reactos.org/$ESQJnXcDYuyKAOjjAelorAbSr0WTiH1wuZs7tJDPRgQ?via=reactos.org&via=matrix.org&via=t2bot.io\">In reply to</a> <a href=\"https://matrix.to/#/@extravert34:matrix.org\">@extravert34:matrix.org</a><br>message 1</blockquote></mx-reply>message 2", "mimetype":"text/html"}}}, PrevContent:map[string]interface {}(nil)}" func=handleEvent file="bridge/matrix/matrix.go:457" prefix=matrix
May 01 19:06:42 matrix matterbridge[827765]: time="2022-05-01T19:06:42Z" level=debug msg="=> Sending config.Message{Text:"\nmessage 2", Channel:"#lang-ru:reactos.org", Username:"extravert34", UserID:"@extravert34:matrix.org", Avatar:"", Account:"matrix.reactos", Event:"", Protocol:"matrix", Gateway:"reactos-ru", ParentID:"$ESQJnXcDYuyKAOjjAelorAbSr0WTiH1wuZs7tJDPRgQ", Timestamp:time.Date(2022, time.May, 1, 19, 6, 42, 432762126, time.Local), ID:"$nEeZtyzPN7-05nW0hbz302ospv8LUqkNkBnTrCp7u1A", Extra:map[string][]interface {}(nil)} from matrix.reactos (#lang-ru:reactos.org) to mattermost.reactos (russian)" func=SendMessage file="gateway/gateway.go:482" prefix=gateway
May 01 19:06:42 matrix matterbridge[827765]: time="2022-05-01T19:06:42Z" level=debug msg="=> Receiving config.Message{Text:"\nmessage 2", 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:"msg-parent-not-found", Timestamp:time.Date(2022, time.May, 1, 19, 6, 42, 432762126, time.Local), ID:"", Extra:map[string][]interface {}(nil)}" func=Send file="bridge/mattermost/mattermost.go:149" prefix=mattermost
May 01 19:06:42 matrix matterbridge[827765]: time="2022-05-01T19:06:42Z" level=debug msg="=> Send from matrix.reactos (#lang-ru:reactos.org) to mattermost.reactos (russian) took 44.185733ms" func=func1 file="gateway/gateway.go:491" prefix=gateway
May 01 19:06:42 matrix matterbridge[827765]: time="2022-05-01T19:06:42Z" level=debug msg="map[string]interface {}{"channel_display_name":"Russian / Русский", "channel_name":"russian", "channel_type":"O", "post":"{\"id\":\"jx3u3jdfct8sdk8fxom8e9z9tr\",\"create_at\":1651432002448,\"update_at\":1651432002448,\"edit_at\":0,\"delete_at\":0,\"is_pinned\":false,\"user_id\":\"jzx7a8c9qfrdzf1d44gijerkbe\",\"channel_id\":\"3rgdko8m87gguf7mhd5gbje5ro\",\"root_id\":\"\",\"parent_id\":\"\",\"original_id\":\"\",\"message\":\"\\nmessage 2\",\"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:06:42 matrix matterbridge[827765]: time="2022-05-01T19:06:42Z" level=debug msg="sent by matterbridge, ignoring" func=skipMessage file="bridge/mattermost/helpers.go:275" prefix=mattermost
May 01 19:06:42 matrix matterbridge[827765]: time="2022-05-01T19:06:42Z" level=debug msg="Skipped message: &matterclient.Message{Raw:(*model.WebSocketEvent)(0xc000666360), Post:(*model.Post)(0xc0005c2a80), Team:"reactos", Channel:"russian", Username:"rosbridge", Text:"\nmessage 2", Type:"", UserID:"jzx7a8c9qfrdzf1d44gijerkbe"}" func=handleMatterClient file="bridge/mattermost/handlers.go:139" prefix=mattermost

Sending 2 messages Mattermost -> Matrix

May 01 19:34:19 matrix matterbridge[827765]: time="2022-05-01T19:34:19Z" level=debug msg="map[string]interface {}{"channel_display_name":"Russian / Русский", "channel_name":"russian", "channel_type":"O", "post":"{\"id\":\"f1e1j6psc7g5zqs89ueyq4co6o\",\"create_at\":1651433659204,\"update_at\":1651433659204,\"edit_at\":0,\"delete_at\":0,\"is_pinned\":false,\"user_id\":\"mj8hpbbofbrpbb5wxtotzu5szo\",\"channel_id\":\"3rgdko8m87gguf7mhd5gbje5ro\",\"root_id\":\"\",\"parent_id\":\"\",\"original_id\":\"\",\"message\":\"message 1\",\"type\":\"\",\"props\":{},\"hashtags\":\"\",\"pending_post_id\":\"mj8hpbbofbrpbb5wxtotzu5szo:1651433659067\",\"reply_count\":0,\"last_reply_at\":0,\"participants\":null,\"metadata\":{}}", "sender_name":"@extravert34", "set_online":true, "team_id":"n3mm5jpeopdfpc4c9jphr8d6kc"}" func=handleMatterClient file="bridge/mattermost/handlers.go:136" prefix=mattermost
May 01 19:34:19 matrix matterbridge[827765]: time="2022-05-01T19:34:19Z" level=debug msg="== Receiving event &matterclient.Message{Raw:(*model.WebSocketEvent)(0xc000667050), Post:(*model.Post)(0xc000459200), Team:"reactos", Channel:"russian", Username:"extravert34", Text:"message 1", Type:"", UserID:"mj8hpbbofbrpbb5wxtotzu5szo"}" func=handleMatterClient file="bridge/mattermost/handlers.go:153" prefix=mattermost
May 01 19:34:19 matrix matterbridge[827765]: time="2022-05-01T19:34:19Z" level=debug msg="<= Sending message from extravert34 on mattermost.reactos to gateway" func=handleMatter file="bridge/mattermost/handlers.go:122" prefix=mattermost
May 01 19:34:19 matrix matterbridge[827765]: time="2022-05-01T19:34:19Z" level=debug msg="<= Message is &config.Message{Text:"message 1", Channel:"russian", Username:"extravert34", UserID:"mj8hpbbofbrpbb5wxtotzu5szo", Avatar:"", Account:"mattermost.reactos", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), ID:"f1e1j6psc7g5zqs89ueyq4co6o", Extra:map[string][]interface {}{}}" func=handleMatter file="bridge/mattermost/handlers.go:123" prefix=mattermost
May 01 19:34:19 matrix matterbridge[827765]: time="2022-05-01T19:34:19Z" level=debug msg="=> Sending config.Message{Text:"message 1", Channel:"russian", Username:"extravert34", UserID:"mj8hpbbofbrpbb5wxtotzu5szo", Avatar:"", Account:"mattermost.reactos", Event:"", Protocol:"mattermost", Gateway:"reactos-ru", ParentID:"", Timestamp:time.Date(2022, time.May, 1, 19, 34, 19, 234496632, time.Local), ID:"f1e1j6psc7g5zqs89ueyq4co6o", Extra:map[string][]interface {}{}} from mattermost.reactos (russian) to matrix.reactos (#lang-ru:reactos.org)" func=SendMessage file="gateway/gateway.go:482" prefix=gateway
May 01 19:34:19 matrix matterbridge[827765]: time="2022-05-01T19:34:19Z" level=debug msg="=> Receiving config.Message{Text:"message 1", Channel:"#lang-ru:reactos.org", Username:"<extravert34> ", UserID:"mj8hpbbofbrpbb5wxtotzu5szo", Avatar:"", Account:"mattermost.reactos", Event:"", Protocol:"mattermost", Gateway:"reactos-ru", ParentID:"", Timestamp:time.Date(2022, time.May, 1, 19, 34, 19, 234496632, time.Local), ID:"", Extra:map[string][]interface {}{}}" func=Send file="bridge/matrix/matrix.go:144" prefix=matrix
May 01 19:34:19 matrix matterbridge[827765]: time="2022-05-01T19:34:19Z" level=debug msg="Channel #lang-ru:reactos.org maps to channel id !XGEAMnOHqyMjtyguZz:reactos.org" func=Send file="bridge/matrix/matrix.go:147" prefix=matrix
May 01 19:34:19 matrix matterbridge[827765]: time="2022-05-01T19:34:19Z" level=debug msg="mID matrix.reactos: $kndlO6NgqL_coDxBaSqZffYgk99Y5dHceRn2Pvg3Ark" func=SendMessage file="gateway/gateway.go:501" prefix=gateway
May 01 19:34:19 matrix matterbridge[827765]: time="2022-05-01T19:34:19Z" level=debug msg="=> Send from mattermost.reactos (russian) to matrix.reactos (#lang-ru:reactos.org) took 147.344985ms" func=func1 file="gateway/gateway.go:491" prefix=gateway
May 01 19:34:19 matrix matterbridge[827765]: time="2022-05-01T19:34:19Z" level=debug msg="== Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@rosbridge:reactos.org", Type:"m.room.message", Timestamp:1651433659252, ID:"$kndlO6NgqL_coDxBaSqZffYgk99Y5dHceRn2Pvg3Ark", RoomID:"!XGEAMnOHqyMjtyguZz:reactos.org", Redacts:"", Unsigned:map[string]interface {}{"age":143, "transaction_id":"go1651433659237504502"}, Content:map[string]interface {}{"body":"<extravert34> message 1", "format":"org.matrix.custom.html", "formatted_body":"&lt;extravert34&gt; message 1", "msgtype":"m.text"}, PrevContent:map[string]interface {}(nil)}" func=handleEvent file="bridge/matrix/matrix.go:457" prefix=matrix

May 01 19:34:30 matrix matterbridge[827765]: time="2022-05-01T19:34:30Z" level=debug msg="map[string]interface {}{"channel_display_name":"Russian / Русский", "channel_name":"russian", "channel_type":"O", "post":"{\"id\":\"pckpuhnzcf8t3kr1zexo1bczbo\",\"create_at\":1651433670524,\"update_at\":1651433670524,\"edit_at\":0,\"delete_at\":0,\"is_pinned\":false,\"user_id\":\"mj8hpbbofbrpbb5wxtotzu5szo\",\"channel_id\":\"3rgdko8m87gguf7mhd5gbje5ro\",\"root_id\":\"f1e1j6psc7g5zqs89ueyq4co6o\",\"parent_id\":\"f1e1j6psc7g5zqs89ueyq4co6o\",\"original_id\":\"\",\"message\":\"message 2\",\"type\":\"\",\"props\":{},\"hashtags\":\"\",\"pending_post_id\":\"mj8hpbbofbrpbb5wxtotzu5szo:1651433670359\",\"reply_count\":1,\"last_reply_at\":0,\"participants\":null,\"metadata\":{}}", "sender_name":"@extravert34", "set_online":true, "team_id":"n3mm5jpeopdfpc4c9jphr8d6kc"}" func=handleMatterClient file="bridge/mattermost/handlers.go:136" prefix=mattermost
May 01 19:34:30 matrix matterbridge[827765]: time="2022-05-01T19:34:30Z" level=debug msg="== Receiving event &matterclient.Message{Raw:(*model.WebSocketEvent)(0xc0007d8000), Post:(*model.Post)(0xc000458900), Team:"reactos", Channel:"russian", Username:"extravert34", Text:"message 2", Type:"", UserID:"mj8hpbbofbrpbb5wxtotzu5szo"}" func=handleMatterClient file="bridge/mattermost/handlers.go:153" prefix=mattermost
May 01 19:34:30 matrix matterbridge[827765]: time="2022-05-01T19:34:30Z" level=debug msg="<= Sending message from extravert34 on mattermost.reactos to gateway" func=handleMatter file="bridge/mattermost/handlers.go:122" prefix=mattermost
May 01 19:34:30 matrix matterbridge[827765]: time="2022-05-01T19:34:30Z" level=debug msg="<= Message is &config.Message{Text:"message 2", Channel:"russian", Username:"extravert34", UserID:"mj8hpbbofbrpbb5wxtotzu5szo", Avatar:"", Account:"mattermost.reactos", Event:"", Protocol:"", Gateway:"", ParentID:"f1e1j6psc7g5zqs89ueyq4co6o", Timestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), ID:"pckpuhnzcf8t3kr1zexo1bczbo", Extra:map[string][]interface {}{}}" func=handleMatter file="bridge/mattermost/handlers.go:123" prefix=mattermost
May 01 19:34:30 matrix matterbridge[827765]: time="2022-05-01T19:34:30Z" level=debug msg="=> Sending config.Message{Text:"message 2", Channel:"russian", Username:"extravert34", UserID:"mj8hpbbofbrpbb5wxtotzu5szo", Avatar:"", Account:"mattermost.reactos", Event:"", Protocol:"mattermost", Gateway:"reactos-ru", ParentID:"f1e1j6psc7g5zqs89ueyq4co6o", Timestamp:time.Date(2022, time.May, 1, 19, 34, 30, 602090199, time.Local), ID:"pckpuhnzcf8t3kr1zexo1bczbo", Extra:map[string][]interface {}{}} from mattermost.reactos (russian) to matrix.reactos (#lang-ru:reactos.org)" func=SendMessage file="gateway/gateway.go:482" prefix=gateway
May 01 19:34:30 matrix matterbridge[827765]: time="2022-05-01T19:34:30Z" level=debug msg="=> Receiving config.Message{Text:"message 2", Channel:"#lang-ru:reactos.org", Username:"<extravert34> ", UserID:"mj8hpbbofbrpbb5wxtotzu5szo", Avatar:"", Account:"mattermost.reactos", Event:"", Protocol:"mattermost", Gateway:"reactos-ru", ParentID:"msg-parent-not-found", Timestamp:time.Date(2022, time.May, 1, 19, 34, 30, 602090199, time.Local), ID:"", Extra:map[string][]interface {}{}}" func=Send file="bridge/matrix/matrix.go:144" prefix=matrix
May 01 19:34:30 matrix matterbridge[827765]: time="2022-05-01T19:34:30Z" level=debug msg="Channel #lang-ru:reactos.org maps to channel id !XGEAMnOHqyMjtyguZz:reactos.org" func=Send file="bridge/matrix/matrix.go:147" prefix=matrix
May 01 19:34:30 matrix matterbridge[827765]: time="2022-05-01T19:34:30Z" level=debug msg="mID matrix.reactos: $QYWo_sfejMh_ypSNtmxnYutqfSrc-h1Oymu8waMnB8w" func=SendMessage file="gateway/gateway.go:501" prefix=gateway
May 01 19:34:30 matrix matterbridge[827765]: time="2022-05-01T19:34:30Z" level=debug msg="=> Send from mattermost.reactos (russian) to matrix.reactos (#lang-ru:reactos.org) took 111.499701ms" func=func1 file="gateway/gateway.go:491" prefix=gateway
May 01 19:34:30 matrix matterbridge[827765]: time="2022-05-01T19:34:30Z" level=debug msg="== Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@rosbridge:reactos.org", Type:"m.room.message", Timestamp:1651433670621, ID:"$QYWo_sfejMh_ypSNtmxnYutqfSrc-h1Oymu8waMnB8w", RoomID:"!XGEAMnOHqyMjtyguZz:reactos.org", Redacts:"", Unsigned:map[string]interface {}{"age":107, "transaction_id":"go1651433670603816824"}, Content:map[string]interface {}{"body":"<extravert34> message 2", "format":"org.matrix.custom.html", "formatted_body":"&lt;extravert34&gt; message 2", "msgtype":"m.text"}, PrevContent:map[string]interface {}(nil)}" func=handleEvent file="bridge/matrix/matrix.go:457" prefix=matrix

Environment (please complete the following information):

  • 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

add PreserveThreading=true to [matrix.reactos] and [mattermost.reactos]

@42wim 42wim removed the bug label May 1, 2022
@42wim
Copy link
Owner

42wim commented May 1, 2022

closing as this should fix your issue :)

@42wim 42wim closed this as completed May 1, 2022
@Extravert-ir
Copy link
Author

Thanks! With PreserveThreading=true in both sections, it now works Mattermost -> Matrix direction, but not the opposite one.
I've checked on 1.25 as well

@42wim 42wim reopened this May 1, 2022
@42wim
Copy link
Owner

42wim commented May 1, 2022

Can you paste debug logs again now PreserveThreading=true is enabled ? For matrix -> mattermost

@Extravert-ir
Copy link
Author

Here you are:


May 01 20:18:30 matrix matterbridge[829019]: time="2022-05-01T20:18:30Z" level=debug msg="== Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@extravert34:matrix.org", Type:"m.room.message", Timestamp:1651436309204, ID:"$G06b1jPigqWx5Ooj4FArTzfal5lo7yNqhu8MythWJdI", RoomID:"!XGEAMnOHqyMjtyguZz:reactos.org", Redacts:"", Unsigned:map[string]interface {}{}, Content:map[string]interface {}{"body":"message 1", "msgtype":"m.text", "org.matrix.msc1767.text":"message 1"}, PrevContent:map[string]interface {}(nil)}" func=handleEvent file="bridge/matrix/matrix.go:457" prefix=matrix
May 01 20:18:30 matrix matterbridge[829019]: time="2022-05-01T20:18:30Z" 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 20:18:30 matrix matterbridge[829019]: time="2022-05-01T20:18:30Z" level=debug msg="=> Sending config.Message{Text:"message 1", 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, 20, 18, 30, 266440827, time.Local), ID:"$G06b1jPigqWx5Ooj4FArTzfal5lo7yNqhu8MythWJdI", Extra:map[string][]interface {}(nil)} from matrix.reactos (#lang-ru:reactos.org) to mattermost.reactos (russian)" func=SendMessage file="gateway/gateway.go:499" prefix=gateway
May 01 20:18:30 matrix matterbridge[829019]: time="2022-05-01T20:18:30Z" level=debug msg="=> Receiving config.Message{Text:"message 1", 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, 20, 18, 30, 266440827, time.Local), ID:"", Extra:map[string][]interface {}(nil)}" func=Send file="bridge/mattermost/mattermost.go:149" prefix=mattermost
May 01 20:18:30 matrix matterbridge[829019]: time="2022-05-01T20:18:30Z" 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/$G06b1jPigqWx5Ooj4FArTzfal5lo7yNqhu8MythWJdI code=400 wrapped=M_NOT_JSON: Content not JSON." func=handleEvent file="bridge/matrix/matrix.go:527" prefix=matrix
May 01 20:18:30 matrix matterbridge[829019]: time="2022-05-01T20:18:30Z" level=debug msg="=> Send from matrix.reactos (#lang-ru:reactos.org) to mattermost.reactos (russian) took 104.095366ms" func=func1 file="gateway/gateway.go:508" prefix=gateway
May 01 20:18:30 matrix matterbridge[829019]: time="2022-05-01T20:18:30Z" level=debug msg="map[string]interface {}{"channel_display_name":"Russian / Русский", "channel_name":"russian", "channel_type":"O", "post":"{\"id\":\"x883khchypdrm8sj1car9oquzh\",\"create_at\":1651436310340,\"update_at\":1651436310340,\"edit_at\":0,\"delete_at\":0,\"is_pinned\":false,\"user_id\":\"jzx7a8c9qfrdzf1d44gijerkbe\",\"channel_id\":\"3rgdko8m87gguf7mhd5gbje5ro\",\"root_id\":\"\",\"parent_id\":\"\",\"original_id\":\"\",\"message\":\"message 1\",\"type\":\"\",\"props\":{\"from_webhook\":\"true\",\"matterbridge_c9neccen53pmblp9mghg\":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 20:18:30 matrix matterbridge[829019]: time="2022-05-01T20:18:30Z" level=debug msg="sent by matterbridge, ignoring" func=skipMessage file="bridge/mattermost/helpers.go:275" prefix=mattermost
May 01 20:18:30 matrix matterbridge[829019]: time="2022-05-01T20:18:30Z" level=debug msg="Skipped message: &matterclient.Message{Raw:(*model.WebSocketEvent)(0xc000a7e060), Post:(*model.Post)(0xc000fec900), Team:"reactos", Channel:"russian", Username:"rosbridge", Text:"message 1", Type:"", UserID:"jzx7a8c9qfrdzf1d44gijerkbe"}" func=handleMatterClient file="bridge/mattermost/handlers.go:139" prefix=mattermost

May 01 20:18:39 matrix matterbridge[829019]: time="2022-05-01T20:18:39Z" level=debug msg="== Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@extravert34:matrix.org", Type:"m.room.message", Timestamp:1651436318241, ID:"$4BQHajyqSiIOeUFF6t_0XMpqfIFuQ4E5pi7dyA26_uE", RoomID:"!XGEAMnOHqyMjtyguZz:reactos.org", Redacts:"", Unsigned:map[string]interface {}{}, Content:map[string]interface {}{"body":"> <@extravert34:matrix.org> message 1\n\nmessage 2", "format":"org.matrix.custom.html", "formatted_body":"<mx-reply><blockquote><a href=\"https://matrix.to/#/!XGEAMnOHqyMjtyguZz:reactos.org/$G06b1jPigqWx5Ooj4FArTzfal5lo7yNqhu8MythWJdI?via=reactos.org&via=matrix.org&via=t2bot.io\">In reply to</a> <a href=\"https://matrix.to/#/@extravert34:matrix.org\">@extravert34:matrix.org</a><br>message 1</blockquote></mx-reply>message 2", "m.relates_to":map[string]interface {}{"m.in_reply_to":map[string]interface {}{"event_id":"$G06b1jPigqWx5Ooj4FArTzfal5lo7yNqhu8MythWJdI"}}, "msgtype":"m.text", "org.matrix.msc1767.message":[]interface {}{map[string]interface {}{"body":"> <@extravert34:matrix.org> message 1\n\nmessage 2", "mimetype":"text/plain"}, map[string]interface {}{"body":"<mx-reply><blockquote><a href=\"https://matrix.to/#/!XGEAMnOHqyMjtyguZz:reactos.org/$G06b1jPigqWx5Ooj4FArTzfal5lo7yNqhu8MythWJdI?via=reactos.org&via=matrix.org&via=t2bot.io\">In reply to</a> <a href=\"https://matrix.to/#/@extravert34:matrix.org\">@extravert34:matrix.org</a><br>message 1</blockquote></mx-reply>message 2", "mimetype":"text/html"}}}, PrevContent:map[string]interface {}(nil)}" func=handleEvent file="bridge/matrix/matrix.go:457" prefix=matrix
May 01 20:18:42 matrix matterbridge[829019]: time="2022-05-01T20:18:42Z" level=debug msg="=> Sending config.Message{Text:"\nmessage 2", Channel:"#lang-ru:reactos.org", Username:"extravert34", UserID:"@extravert34:matrix.org", Avatar:"", Account:"matrix.reactos", Event:"", Protocol:"matrix", Gateway:"reactos-ru", ParentID:"$G06b1jPigqWx5Ooj4FArTzfal5lo7yNqhu8MythWJdI", Timestamp:time.Date(2022, time.May, 1, 20, 18, 42, 313111358, time.Local), ID:"$4BQHajyqSiIOeUFF6t_0XMpqfIFuQ4E5pi7dyA26_uE", Extra:map[string][]interface {}(nil)} from matrix.reactos (#lang-ru:reactos.org) to mattermost.reactos (russian)" func=SendMessage file="gateway/gateway.go:499" prefix=gateway
May 01 20:18:42 matrix matterbridge[829019]: time="2022-05-01T20:18:42Z" level=debug msg="=> Receiving config.Message{Text:"\nmessage 2", 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:"matrix $G06b1jPigqWx5Ooj4FArTzfal5lo7yNqhu8MythWJdI", Timestamp:time.Date(2022, time.May, 1, 20, 18, 42, 313111358, time.Local), ID:"", Extra:map[string][]interface {}(nil)}" func=Send file="bridge/mattermost/mattermost.go:149" prefix=mattermost
May 01 20:18:42 matrix matterbridge[829019]: time="2022-05-01T20:18:42Z" level=debug msg="=> Send from matrix.reactos (#lang-ru:reactos.org) to mattermost.reactos (russian) took 40.344835ms" func=func1 file="gateway/gateway.go:508" prefix=gateway
May 01 20:18:42 matrix matterbridge[829019]: time="2022-05-01T20:18:42Z" level=debug msg="map[string]interface {}{"channel_display_name":"Russian / Русский", "channel_name":"russian", "channel_type":"O", "post":"{\"id\":\"iz8ubzwtjpf6zd1jiyzubq7b9h\",\"create_at\":1651436322325,\"update_at\":1651436322325,\"edit_at\":0,\"delete_at\":0,\"is_pinned\":false,\"user_id\":\"jzx7a8c9qfrdzf1d44gijerkbe\",\"channel_id\":\"3rgdko8m87gguf7mhd5gbje5ro\",\"root_id\":\"\",\"parent_id\":\"\",\"original_id\":\"\",\"message\":\"\\nmessage 2\",\"type\":\"\",\"props\":{\"from_webhook\":\"true\",\"matterbridge_c9neccen53pmblp9mghg\":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 20:18:42 matrix matterbridge[829019]: time="2022-05-01T20:18:42Z" level=debug msg="sent by matterbridge, ignoring" func=skipMessage file="bridge/mattermost/helpers.go:275" prefix=mattermost
May 01 20:18:42 matrix matterbridge[829019]: time="2022-05-01T20:18:42Z" level=debug msg="Skipped message: &matterclient.Message{Raw:(*model.WebSocketEvent)(0xc0014e2de0), Post:(*model.Post)(0xc000683380), Team:"reactos", Channel:"russian", Username:"rosbridge", Text:"\nmessage 2", Type:"", UserID:"jzx7a8c9qfrdzf1d44gijerkbe"}" func=handleMatterClient file="bridge/mattermost/handlers.go:139" prefix=mattermost

@42wim
Copy link
Owner

42wim commented May 1, 2022

I was wondering why you got this issue, but I just noticed you're using mattermost webhooks
They don't support replies - https://mattermost.uservoice.com/forums/306457-general/suggestions/31914865-ability-to-reply-to-message-with-webhook

@42wim 42wim closed this as completed May 1, 2022
@binarymaster
Copy link

but I just noticed you're using mattermost webhooks, They don't support replies

One of previous Matterbridge versions (don't remember which one) inserted a quote of a message it was replied to on Matrix side.

@42wim
Copy link
Owner

42wim commented May 1, 2022

Hm, no afaik matterbridge never did that for mattermost (for some other protocols this exist).
The webhook really is inferior over the login/password as it's very limited in features.

@binarymaster
Copy link

Hm, no afaik matterbridge never did that for mattermost

Check this:

  • on Matrix side:
    image
  • on Mattermost side:
    image

It was configured the same way (webhooks) as it's right now.

@42wim
Copy link
Owner

42wim commented May 1, 2022

Aha, yes this was because matrix was actually sending the quote which was changed by this commit (9a8ce9b)

I've fixed it for discord in #1791
I shall do this for mattermost too

42wim added a commit that referenced this issue May 1, 2022
Matrix quotes replies and as of matterbridge 1.24.0 we strip those as this causes
issues with bridges support threading and have PreserveThreading enabled.

Introduced via 9a8ce9b

But if you for example use mattermost or discord with webhooks you'll need to enable
this if you want something that looks like a reply from matrix.
See issues:
- #1819
- #1780
42wim added a commit that referenced this issue May 1, 2022
Matrix quotes replies and as of matterbridge 1.24.0 we strip those as this causes
issues with bridges support threading and have PreserveThreading enabled.

Introduced via 9a8ce9b

But if you for example use mattermost or discord with webhooks you'll need to enable
this if you want something that looks like a reply from matrix.
See issues:
- #1819
- #1780
@42wim
Copy link
Owner

42wim commented May 1, 2022

@binarymaster It's fixed in a PR, you can try it by
go install github.com/42wim/matterbridge@2db081142b3121e4feaf1fe2278cc5222f46360f and add a KeepQuotedReply=true option to your [matrix] configuration. Also make sure to set PreserveThreading=false (the default) for receiving bridges.

go install will build the binary in ~/go/bin/ by default

42wim added a commit that referenced this issue May 6, 2022
Matrix quotes replies and as of matterbridge 1.24.0 we strip those as this causes
issues with bridges support threading and have PreserveThreading enabled.

Introduced via 9a8ce9b

But if you for example use mattermost or discord with webhooks you'll need to enable
this if you want something that looks like a reply from matrix.
See issues:
- #1819
- #1780
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

3 participants