mirror of https://github.com/mautrix/go.git
Remove historical field in power levels
parent
8c3bd77229
commit
b2ea5d80b2
|
@ -27,11 +27,10 @@ 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"`
|
||||
HistoricalPtr *int `json:"historical,omitempty"`
|
||||
InvitePtr *int `json:"invite,omitempty"`
|
||||
KickPtr *int `json:"kick,omitempty"`
|
||||
BanPtr *int `json:"ban,omitempty"`
|
||||
RedactPtr *int `json:"redact,omitempty"`
|
||||
}
|
||||
|
||||
func copyPtr(ptr *int) *int {
|
||||
|
@ -66,11 +65,10 @@ func (pl *PowerLevelsEventContent) Clone() *PowerLevelsEventContent {
|
|||
|
||||
Notifications: pl.Notifications.Clone(),
|
||||
|
||||
InvitePtr: copyPtr(pl.InvitePtr),
|
||||
KickPtr: copyPtr(pl.KickPtr),
|
||||
BanPtr: copyPtr(pl.BanPtr),
|
||||
RedactPtr: copyPtr(pl.RedactPtr),
|
||||
HistoricalPtr: copyPtr(pl.HistoricalPtr),
|
||||
InvitePtr: copyPtr(pl.InvitePtr),
|
||||
KickPtr: copyPtr(pl.KickPtr),
|
||||
BanPtr: copyPtr(pl.BanPtr),
|
||||
RedactPtr: copyPtr(pl.RedactPtr),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -122,13 +120,6 @@ 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…
Reference in New Issue