mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/portal: validate capabilities when updating disappearing timer
This commit is contained in:
parent
bca8b0528c
commit
c3a422347c
3 changed files with 16 additions and 0 deletions
|
|
@ -76,6 +76,13 @@ type DisappearingTimerCapability struct {
|
|||
OmitEmptyTimer bool `json:"omit_empty_timer,omitempty"`
|
||||
}
|
||||
|
||||
func (dtc *DisappearingTimerCapability) Supports(content *BeeperDisappearingTimer) bool {
|
||||
if dtc == nil || content.Type == DisappearingTypeNone {
|
||||
return true
|
||||
}
|
||||
return slices.Contains(dtc.Types, content.Type) && slices.Contains(dtc.Timers, content.Timer)
|
||||
}
|
||||
|
||||
type CapabilityMsgType = MessageType
|
||||
|
||||
// Message types which are used for event capability signaling, but aren't real values for the msgtype field.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue