From 3658e60d89dfd9f15cb89a4ed0b8e3bda4dec551 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 1 Mar 2020 01:24:27 +0200 Subject: [PATCH] Update mautrix-go --- go.mod | 2 +- go.sum | 2 ++ matrix/matrix.go | 7 ------- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 8a05444..5aa5d97 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( golang.org/x/net v0.0.0-20200202094626-16171245cfb2 gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 gopkg.in/yaml.v2 v2.2.8 - maunium.net/go/mautrix v0.1.0-alpha.3.0.20200229230354-be576ef8fcb1 + maunium.net/go/mautrix v0.1.0-alpha.3.0.20200229232321-dfc638ec809a maunium.net/go/mauview v0.0.0-20200220222850-39f1414676d9 maunium.net/go/tcell v1.1.2-0.20200218183045-87c4a25c5b09 ) diff --git a/go.sum b/go.sum index 83984ec..eb3008d 100644 --- a/go.sum +++ b/go.sum @@ -90,6 +90,8 @@ maunium.net/go/mautrix v0.1.0-alpha.3.0.20200229222711-57beb97fdccb h1:b9cMiQ85H maunium.net/go/mautrix v0.1.0-alpha.3.0.20200229222711-57beb97fdccb/go.mod h1:g10T1fh2Q2HkJWycVs93eBXdWpqD67f1YVQhNxdIDr4= maunium.net/go/mautrix v0.1.0-alpha.3.0.20200229230354-be576ef8fcb1 h1:2XQfQNWeNhhEXrb2HgOpTi26o7qq17lQCwSl6wDz2WM= maunium.net/go/mautrix v0.1.0-alpha.3.0.20200229230354-be576ef8fcb1/go.mod h1:g10T1fh2Q2HkJWycVs93eBXdWpqD67f1YVQhNxdIDr4= +maunium.net/go/mautrix v0.1.0-alpha.3.0.20200229232321-dfc638ec809a h1:/n9qM9C2c3YUz4S8K2apTxpm2xdZ+7cxGsFi9GJdSfc= +maunium.net/go/mautrix v0.1.0-alpha.3.0.20200229232321-dfc638ec809a/go.mod h1:g10T1fh2Q2HkJWycVs93eBXdWpqD67f1YVQhNxdIDr4= maunium.net/go/mauview v0.0.0-20200218183549-88ecb1321176 h1:KoTm7ASEzFIZ1SvPWuWYzpkeA+wiR1fuUu4l7TCHcE0= maunium.net/go/mauview v0.0.0-20200218183549-88ecb1321176/go.mod h1:jwg3Ow7akzsCX3q38pZAfmEC5gGN8gXwMyyjy/yZVMg= maunium.net/go/mauview v0.0.0-20200218231215-04d01c601d5b h1:Bfov5IkJQpkqDexiFioHIZpx4XL7AILDA1GwLVdqtBw= diff --git a/matrix/matrix.go b/matrix/matrix.go index 940a519..8cf2e96 100644 --- a/matrix/matrix.go +++ b/matrix/matrix.go @@ -729,17 +729,10 @@ func (c *Container) MarkRead(roomID, eventID string) { _, _ = c.client.MakeRequest("POST", urlPath, struct{}{}, nil) } -var mentionRegex = regexp.MustCompile("\\[(.+?)]\\(https://matrix.to/#/@.+?:.+?\\)") -var roomRegex = regexp.MustCompile("\\[.+?]\\(https://matrix.to/#/(#.+?:[^/]+?)\\)") - func (c *Container) PrepareMarkdownMessage(roomID string, msgtype mautrix.MessageType, text string, rel *ifc.Relation) *event.Event { content := format.RenderMarkdown(text) content.MsgType = msgtype - // Remove markdown link stuff from plaintext mentions and room links - content.Body = mentionRegex.ReplaceAllString(content.Body, "$1") - content.Body = roomRegex.ReplaceAllString(content.Body, "$1") - if rel != nil && rel.Type == mautrix.RelReplace { contentCopy := content content.NewContent = &contentCopy