aboutsummaryrefslogtreecommitdiff
path: root/ui/messages
diff options
context:
space:
mode:
Diffstat (limited to 'ui/messages')
-rw-r--r--ui/messages/base.go5
-rw-r--r--ui/messages/parser.go1
2 files changed, 3 insertions, 3 deletions
diff --git a/ui/messages/base.go b/ui/messages/base.go
index 567e614..b54691e 100644
--- a/ui/messages/base.go
+++ b/ui/messages/base.go
@@ -17,7 +17,6 @@
package messages
import (
- "encoding/json"
"fmt"
"time"
@@ -55,7 +54,7 @@ type UIMessage struct {
IsHighlight bool
IsService bool
Edited bool
- Source json.RawMessage
+ Event *event.Event
ReplyTo *UIMessage
Renderer MessageRenderer
}
@@ -82,7 +81,7 @@ func newUIMessage(evt *event.Event, displayname string, renderer MessageRenderer
IsHighlight: false,
IsService: false,
Edited: len(evt.Gomuks.Edits) > 0,
- Source: evt.Content.VeryRaw,
+ Event: evt,
Renderer: renderer,
}
}
diff --git a/ui/messages/parser.go b/ui/messages/parser.go
index e1c0053..53d30e3 100644
--- a/ui/messages/parser.go
+++ b/ui/messages/parser.go
@@ -128,6 +128,7 @@ func ParseMessage(matrix ifc.MatrixContainer, room *rooms.Room, evt *event.Event
evt.Content.RemoveReplyFallback()
}
if len(evt.Gomuks.Edits) > 0 {
+ evt = evt.SomewhatDangerousCopy()
evt.Content = *evt.Gomuks.Edits[len(evt.Gomuks.Edits)-1].Content.NewContent
}
switch evt.Content.MsgType {