Skip to content

Commit

Permalink
event: ensure MSC1767 audio has empty waveform
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Sep 8, 2024
1 parent 6b055b1 commit 4098a37
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions event/audio.go
Original file line number Diff line number Diff line change
@@ -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{}

0 comments on commit 4098a37

Please sign in to comment.