Skip to content

Commit 2790e25

Browse files
committed
federation/pdu: omit empty auth&prev events
1 parent 3b1ece9 commit 2790e25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

federation/pdu/pdu.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ package pdu
1111
import (
1212
"bytes"
1313
"crypto/ed25519"
14+
"encoding/json"
1415
"encoding/json/jsontext"
15-
"encoding/json/v2"
1616
"errors"
1717
"fmt"
1818
"strings"
@@ -60,12 +60,12 @@ type InternalMeta struct {
6060
}
6161

6262
type PDU struct {
63-
AuthEvents []id.EventID `json:"auth_events"`
63+
AuthEvents []id.EventID `json:"auth_events,omitzero"`
6464
Content jsontext.Value `json:"content"`
6565
Depth int64 `json:"depth"`
6666
Hashes *Hashes `json:"hashes,omitzero"`
6767
OriginServerTS int64 `json:"origin_server_ts"`
68-
PrevEvents []id.EventID `json:"prev_events"`
68+
PrevEvents []id.EventID `json:"prev_events,omitzero"`
6969
Redacts *id.EventID `json:"redacts,omitzero"`
7070
RoomID id.RoomID `json:"room_id,omitzero"` // not present for room v12+ create events
7171
Sender id.UserID `json:"sender"`

0 commit comments

Comments
 (0)