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

Mattermost: SendMessage failed: Unsupported start tag #2101

Open
sanpii opened this issue Nov 9, 2023 · 2 comments
Open

Mattermost: SendMessage failed: Unsupported start tag #2101

sanpii opened this issue Nov 9, 2023 · 2 comments
Labels

Comments

@sanpii
Copy link

sanpii commented Nov 9, 2023

Describe the bug
A message sends on mattermost 9 is not send to telegram.

To Reproduce
Steps to reproduce the behavior:

  • Sending a message from mattermost to telegram

Expected behavior
The message should appear on telegram.

Screenshots/debug logs

[0016] DEBUG mattermost:   [handleMatter:bridge/mattermost/handlers.go:88] <= Sending message from Sanpï on mattermost.pm to gateway
[0016] DEBUG mattermost:   [handleMatter:bridge/mattermost/handlers.go:89] <= Message is &config.Message{Text:"test", Channel:"mm-channel", Username:"Sanpï", UserID:"1234", Avatar:"", Account:"mattermost.pm", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), ID:"1234", Extra:map[string][]interface {}{}}
[0016] DEBUG gateway:      [SendMessage:gateway/gateway.go:499] => Sending config.Message{Text:"test", Channel:"mm-channel", Username:"Sanpï", UserID:"1234", Avatar:"", Account:"mattermost.pm", Event:"", Protocol:"mattermost", Gateway:"gw-name", ParentID:"", Timestamp:time.Date(2023, time.November, 9, 22, 10, 28, 707318557, time.Local), ID:"1234", Extra:map[string][]interface {}{}} from mattermost.pm (mm-channel) to telegram.secure (t-channel-id)
[0016] DEBUG telegram:     [Send:bridge/telegram/telegram.go:90] => Receiving config.Message{Text:"test", Channel:"t-channel-id", Username:"[mattermost] <Sanpï> ", UserID:"1234", Avatar:"", Account:"mattermost.pm", Event:"", Protocol:"mattermost", Gateway:"gw-name", ParentID:"", Timestamp:time.Date(2023, time.November, 9, 22, 10, 28, 707318557, time.Local), ID:"", Extra:map[string][]interface {}{}}
[0016] DEBUG telegram:     [TGGetParseMode:bridge/telegram/telegram.go:82] Using mode HTML - nick only
[0016] DEBUG gateway:      [func1:gateway/gateway.go:508] => Send from mattermost.pm (mm-channel) to telegram.secure (t-channel-id) took 5.785779ms
[0016] ERROR gateway:      [handleMessage:gateway/handlers.go:228] SendMessage failed: Bad Request: can't parse entities: Unsupported start tag "sanpï" at byte offset 13

Environment (please complete the following information):

  • OS: Ubuntu 20.04.6 LTS
  • Matterbridge version: 1.26.0 6dafebc7
  • Mattermost version: 9.1.1-0

Additional context

It’s the first time I use matterbrigde, maybe I missed something, but the bridge works fine from telegram to mattermost.

[general]
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "

[mattermost]

[mattermost.pm]
Server="example.org:443"
Team="team"
Login="login"
Password="password"
PrefixMessagesWithNick=true
PreserveThreading=true

[telegram]

[telegram.secure]
Token="token"
MessageFormat="HTMLNick"

[[gateway]]
name="gw-name"
enable=true

[[gateway.inout]]
account="telegram.secure"
channel="t-channel-id"

[[gateway.inout]]
account="mattermost.pm"
channel="mm-channel"
@sanpii sanpii added the bug label Nov 9, 2023
@laztname
Copy link

same here

[628103] ERROR gateway: SendMessage failed: Bad Request: can't parse entities: Unsupported start tag "laztname" at byte offset 0

@sanpii
Copy link
Author

sanpii commented Feb 20, 2024

I fixed the initial issue by removing MessageFormat="HTMLNick". The </> characters in RemoteNickFormat cause invalid html.

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

2 participants