Skip to content
Snippets Groups Projects

Add field RoundUrl to all send reporters in bindings

Merged Josh Brooks requested to merge XX-4126/BindingsRoundUrl into release
1 unresolved thread
8 files
+ 94
65
Compare changes
  • Side-by-side
  • Inline
Files
8
+ 14
6
@@ -44,9 +44,11 @@ type ChannelDef struct {
// BroadcastMessage is the bindings representation of a broadcast message.
//
// Example JSON:
// {"RoundID":42,
// BroadcastMessage Example JSON:
// {
// "RoundID":42,
// "EphID":[0,0,0,0,0,0,24,61],
// "RoundURL":"https://dashboard.xx.network/rounds/25?xxmessenger=true",
// "Payload":"SGVsbG8sIGJyb2FkY2FzdCBmcmllbmRzIQ=="
// }
type BroadcastMessage struct {
@@ -57,13 +59,16 @@ type BroadcastMessage struct {
// BroadcastReport is the bindings representation of the info on how a broadcast
// message was sent
//
// Example JSON:
// {"RoundID":42,
// "EphID":[0,0,0,0,0,0,24,61]
// BroadcastReport Example JSON:
// {
// "Rounds": [25, 26, 29],
// "EphID":[0,0,0,0,0,0,24,61],
// "RoundURL":"https://dashboard.xx.network/rounds/25?xxmessenger=true"
// }
type BroadcastReport struct {
RoundsList
EphID ephemeral.Id
RoundURL string
EphID ephemeral.Id
}
// BroadcastListener is the public function type bindings can use to listen for
@@ -131,6 +136,7 @@ func (c *Channel) Listen(l BroadcastListener, method int) error {
l.Callback(json.Marshal(&BroadcastMessage{
BroadcastReport: BroadcastReport{
RoundsList: makeRoundsList(round.ID),
RoundURL: getRoundURL(round.ID),
EphID: receptionID.EphId,
},
Payload: payload,
@@ -153,6 +159,7 @@ func (c *Channel) Broadcast(payload []byte) ([]byte, error) {
}
return json.Marshal(BroadcastReport{
RoundsList: makeRoundsList(rid),
RoundURL: getRoundURL(rid),
EphID: eid,
})
}
@@ -174,6 +181,7 @@ func (c *Channel) BroadcastAsymmetric(payload, pk []byte) ([]byte, error) {
}
return json.Marshal(BroadcastReport{
RoundsList: makeRoundsList(rid),
RoundURL: getRoundURL(rid),
EphID: eid,
})
}
Loading