event: add omitempty for mod policy entity
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled

Only one of hash and entity should be set
This commit is contained in:
Tulir Asokan 2025-05-27 18:04:52 +03:00
commit f5746ee0f6

View file

@ -231,7 +231,7 @@ func (ph *PolicyHashes) DecodeSHA256() *[32]byte {
// ModPolicyContent represents the content of a m.room.rule.user, m.room.rule.room, and m.room.rule.server state event.
// https://spec.matrix.org/v1.2/client-server-api/#moderation-policy-lists
type ModPolicyContent struct {
Entity string `json:"entity"`
Entity string `json:"entity,omitempty"`
Reason string `json:"reason"`
Recommendation PolicyRecommendation `json:"recommendation"`
UnstableHashes *PolicyHashes `json:"org.matrix.msc4205.hashes,omitempty"`