aboutsummaryrefslogtreecommitdiff
path: root/matrix
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2020-03-01 01:24:27 +0200
committerTulir Asokan <tulir@maunium.net>2020-03-01 01:24:27 +0200
commit3658e60d89dfd9f15cb89a4ed0b8e3bda4dec551 (patch)
tree1c60348f173d78ef5827f1294ce48c22ee305fa7 /matrix
parent6b29d90fb419a466b5f90fbae15c6db46ebc03fa (diff)
Update mautrix-go
Diffstat (limited to 'matrix')
-rw-r--r--matrix/matrix.go7
1 files changed, 0 insertions, 7 deletions
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