aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--matrix/history.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/matrix/history.go b/matrix/history.go
index 8a80569..07a6c90 100644
--- a/matrix/history.go
+++ b/matrix/history.go
@@ -265,9 +265,18 @@ func btoi(b []byte) uint64 {
return binary.BigEndian.Uint64(b)
}
+func stripRaw(evt *muksevt.Event) {
+ evtCopy := *evt.Event
+ evtCopy.Content = event.Content{
+ Parsed: evt.Content.Parsed,
+ }
+ evt.Event = &evtCopy
+}
+
func marshalEvent(evt *muksevt.Event) ([]byte, error) {
+ stripRaw(evt)
var buf bytes.Buffer
- enc := gzip.NewWriter(&buf)
+ enc, _ := gzip.NewWriterLevel(&buf, gzip.BestSpeed)
if err := gob.NewEncoder(enc).Encode(evt); err != nil {
_ = enc.Close()
return nil, err