aboutsummaryrefslogtreecommitdiff
path: root/vendor/maunium.net/go/mautrix
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-11-14 01:19:52 +0200
committerTulir Asokan <tulir@maunium.net>2018-11-14 01:19:52 +0200
commit2fc3378b717f40f37f3a188b68407887242d9c06 (patch)
tree1af07de3a528c517ad3dd51b9601986dbccd96e1 /vendor/maunium.net/go/mautrix
parent912bf309d1f102f8f10c96c718784f01901dad4d (diff)
Fix go vet
Diffstat (limited to 'vendor/maunium.net/go/mautrix')
-rw-r--r--vendor/maunium.net/go/mautrix/events.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/maunium.net/go/mautrix/events.go b/vendor/maunium.net/go/mautrix/events.go
index 7151c27..efd3795 100644
--- a/vendor/maunium.net/go/mautrix/events.go
+++ b/vendor/maunium.net/go/mautrix/events.go
@@ -197,7 +197,7 @@ type Content struct {
RelatesTo *RelatesTo `json:"m.relates_to,omitempty"`
Command *MatchedCommand `json:"m.command,omitempty"`
- PowerLevels
+ *PowerLevels
Member
Aliases []string `json:"aliases,omitempty"`
Alias string `json:"alias,omitempty"`
@@ -234,6 +234,13 @@ func (content *Content) GetRelatesTo() *RelatesTo {
return content.RelatesTo
}
+func (content *Content) GetPowerLevels() *PowerLevels {
+ if content.PowerLevels == nil {
+ content.PowerLevels = &PowerLevels{}
+ }
+ return content.PowerLevels
+}
+
func (content *Content) UnmarshalPowerLevels() (pl PowerLevels, err error) {
err = json.Unmarshal(content.VeryRaw, &pl)
return