From 2b07b80e64e0c1ebe1673a5a534398f1fb8ad086 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 6 May 2020 23:40:50 +0300 Subject: Parse event content when getting single event from server --- go.mod | 2 +- go.sum | 2 ++ matrix/matrix.go | 7 +++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c7be98c..38bfbf6 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( golang.org/x/net v0.0.0-20200505041828-1ed23360d12c gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 gopkg.in/yaml.v2 v2.2.8 - maunium.net/go/mautrix v0.3.1 + maunium.net/go/mautrix v0.3.2 maunium.net/go/mauview v0.1.1 maunium.net/go/tcell v0.2.0 ) diff --git a/go.sum b/go.sum index 5dab1eb..cd4d758 100644 --- a/go.sum +++ b/go.sum @@ -93,6 +93,8 @@ maunium.net/go/mautrix v0.3.0 h1:Ij8O3JY5zL/8TqXYSYm0YGe2RFO3HgG/BAfdy9CFFo8= maunium.net/go/mautrix v0.3.0/go.mod h1:SkGZzch8CvU2qKtNpYxtzZ0sQxfVEJ3IsVVLSUBUx9Y= maunium.net/go/mautrix v0.3.1 h1:zDhN4PYdWavbssA+9JVoCsUmu/u0LtdHeE647oh3W8c= maunium.net/go/mautrix v0.3.1/go.mod h1:SkGZzch8CvU2qKtNpYxtzZ0sQxfVEJ3IsVVLSUBUx9Y= +maunium.net/go/mautrix v0.3.2 h1:YLTj8euBTxb118XOryghWpsE/aieFI4lG6jCpCmw5HA= +maunium.net/go/mautrix v0.3.2/go.mod h1:SkGZzch8CvU2qKtNpYxtzZ0sQxfVEJ3IsVVLSUBUx9Y= maunium.net/go/mauview v0.1.0 h1:x2WdkKI2zdriJuPAB0CKlwmnHGE7W9xfM5z6RgG+IIg= maunium.net/go/mauview v0.1.0/go.mod h1:og9WbzmWe9SNYNyOFlCv8qa9zMcOvG2nzRJ5vYyud9U= maunium.net/go/mauview v0.1.1 h1:wfTXyPx3LGAGpTskh+UbBv/QItUWnEpaneHmywoYnfY= diff --git a/matrix/matrix.go b/matrix/matrix.go index 82ba006..7918aeb 100644 --- a/matrix/matrix.go +++ b/matrix/matrix.go @@ -1024,9 +1024,12 @@ func (c *Container) GetEvent(room *rooms.Room, eventID id.EventID) (*muksevt.Eve if err != nil { return nil, err } - evt = muksevt.Wrap(mxEvent) + err = mxEvent.Content.ParseRaw(mxEvent.Type) + if err != nil { + return nil, err + } debug.Printf("Loaded event %s from server", eventID) - return evt, nil + return muksevt.Wrap(mxEvent), nil } // GetOrCreateRoom gets the room instance stored in the session. -- cgit v1.2.3