mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
Add MSC2716's historical field to power level content
This commit is contained in:
parent
bd6990e249
commit
89d0d57059
1 changed files with 12 additions and 4 deletions
|
|
@ -25,10 +25,11 @@ type PowerLevelsEventContent struct {
|
|||
|
||||
StateDefaultPtr *int `json:"state_default,omitempty"`
|
||||
|
||||
InvitePtr *int `json:"invite,omitempty"`
|
||||
KickPtr *int `json:"kick,omitempty"`
|
||||
BanPtr *int `json:"ban,omitempty"`
|
||||
RedactPtr *int `json:"redact,omitempty"`
|
||||
InvitePtr *int `json:"invite,omitempty"`
|
||||
KickPtr *int `json:"kick,omitempty"`
|
||||
BanPtr *int `json:"ban,omitempty"`
|
||||
RedactPtr *int `json:"redact,omitempty"`
|
||||
HistoricalPtr *int `json:"historical,omitempty"`
|
||||
}
|
||||
|
||||
func (pl *PowerLevelsEventContent) Invite() int {
|
||||
|
|
@ -59,6 +60,13 @@ func (pl *PowerLevelsEventContent) Redact() int {
|
|||
return 50
|
||||
}
|
||||
|
||||
func (pl *PowerLevelsEventContent) Historical() int {
|
||||
if pl.HistoricalPtr != nil {
|
||||
return *pl.HistoricalPtr
|
||||
}
|
||||
return 100
|
||||
}
|
||||
|
||||
func (pl *PowerLevelsEventContent) StateDefault() int {
|
||||
if pl.StateDefaultPtr != nil {
|
||||
return *pl.StateDefaultPtr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue