From 842aab13243b0c14f20ae8a3a1d8501a33920501 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 4 Apr 2020 01:03:17 +0300 Subject: Add toggles for disabling markdown and HTML --- matrix/matrix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'matrix') diff --git a/matrix/matrix.go b/matrix/matrix.go index 226df6c..e7fbcc3 100644 --- a/matrix/matrix.go +++ b/matrix/matrix.go @@ -392,7 +392,7 @@ func (c *Container) HandlePreferences(source EventSource, evt *mautrix.Event) { func (c *Container) SendPreferencesToMatrix() { defer debug.Recover() debug.Print("Sending updated preferences:", c.config.Preferences) - u := c.client.BuildURL("user", c.config.UserID, "account_data", "net.maunium.gomuks.preferences") + u := c.client.BuildURL("user", c.config.UserID, "account_data", AccountDataGomuksPreferences.Type) _, err := c.client.MakeRequest("PUT", u, &c.config.Preferences, nil) if err != nil { debug.Print("Failed to update preferences:", err) @@ -739,7 +739,7 @@ func (c *Container) PrepareMarkdownMessage(roomID string, msgtype mautrix.Messag MsgType: msgtype, } } else { - content = format.RenderMarkdown(text) + content = format.RenderMarkdown(text, !c.config.Preferences.DisableMarkdown, !c.config.Preferences.DisableHTML) content.MsgType = msgtype } -- cgit v1.2.3