diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-11-14 01:19:52 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-11-14 01:19:52 +0200 |
commit | 2fc3378b717f40f37f3a188b68407887242d9c06 (patch) | |
tree | 1af07de3a528c517ad3dd51b9601986dbccd96e1 /vendor/maunium.net/go/mautrix | |
parent | 912bf309d1f102f8f10c96c718784f01901dad4d (diff) |
Fix go vet
Diffstat (limited to 'vendor/maunium.net/go/mautrix')
-rw-r--r-- | vendor/maunium.net/go/mautrix/events.go | 9 |
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 |