ops-jrz1/modules/patches/matterbridge-api-websocket-max-message.patch
Dan ae16db4898 Refresh musiclink integration docs and tooling
Use local musiclink flake input with Go 1.24.

Add matterbridge patch, routing docs, and deploy check script.
2026-01-21 22:52:39 -08:00

50 lines
1.3 KiB
Diff

diff --git a/bridge/api/api.go b/bridge/api/api.go
--- a/bridge/api/api.go
+++ b/bridge/api/api.go
@@ -40,6 +40,7 @@
e.HidePort = true
b.mrouter = melody.New()
+ b.mrouter.Config.MaxMessageSize = 64 * 1024
b.mrouter.HandleMessage(func(s *melody.Session, msg []byte) {
message := config.Message{}
err := json.Unmarshal(msg, &message)
diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go
--- a/bridge/matrix/matrix.go
+++ b/bridge/matrix/matrix.go
@@ -363,7 +363,14 @@
)
err = b.retry(func() error {
- resp, err = b.mc.SendText(channel, body)
+ content := map[string]interface{}{
+ "msgtype": "m.text",
+ "body": body,
+ }
+ if msg.Protocol == "api" {
+ content["com.beeper.linkpreviews"] = []interface{}{}
+ }
+ resp, err = b.mc.SendMessageEvent(channel, "m.room.message", content)
return err
})
@@ -381,7 +388,16 @@
)
err = b.retry(func() error {
- resp, err = b.mc.SendFormattedText(channel, body, formattedBody)
+ content := map[string]interface{}{
+ "msgtype": "m.text",
+ "body": body,
+ "format": "org.matrix.custom.html",
+ "formatted_body": formattedBody,
+ }
+ if msg.Protocol == "api" {
+ content["com.beeper.linkpreviews"] = []interface{}{}
+ }
+ resp, err = b.mc.SendMessageEvent(channel, "m.room.message", content)
return err
})