diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-05-06 23:40:50 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-05-06 23:40:50 +0300 |
commit | 2b07b80e64e0c1ebe1673a5a534398f1fb8ad086 (patch) | |
tree | 46ac9ff26431a158d3f5a06c2c45ec12c00ba3b1 | |
parent | 03826346d9bbe44f32e868e18d0367949b518361 (diff) |
Parse event content when getting single event from server
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 2 | ||||
-rw-r--r-- | matrix/matrix.go | 7 |
3 files changed, 8 insertions, 3 deletions
@@ -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 ) @@ -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. |