mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
event: ensure MSC1767 audio has empty waveform
This commit is contained in:
parent
6b055b1475
commit
4098a3726e
1 changed files with 13 additions and 0 deletions
|
|
@ -1,8 +1,21 @@
|
|||
package event
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
type MSC1767Audio struct {
|
||||
Duration int `json:"duration"`
|
||||
Waveform []int `json:"waveform"`
|
||||
}
|
||||
|
||||
type serializableMSC1767Audio MSC1767Audio
|
||||
|
||||
func (ma *MSC1767Audio) MarshalJSON() ([]byte, error) {
|
||||
if ma.Waveform == nil {
|
||||
ma.Waveform = []int{}
|
||||
}
|
||||
return json.Marshal((*serializableMSC1767Audio)(ma))
|
||||
}
|
||||
|
||||
type MSC3245Voice struct{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue