Parse event content when getting single event from server

This commit is contained in:
Tulir Asokan 2020-05-06 23:40:50 +03:00
parent 03826346d9
commit 2b07b80e64
3 changed files with 8 additions and 3 deletions

2
go.mod
View File

@ -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
)

2
go.sum
View File

@ -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=

View File

@ -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.