event: ensure MSC1767 audio has empty waveform
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run

This commit is contained in:
Tulir Asokan 2024-09-08 13:47:49 +03:00
commit 4098a3726e

View file

@ -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{}