Skip to content

Commit

Permalink
events: add call rejection event (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengshunli authored Sep 24, 2024
1 parent b295fbe commit 94acb10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions call.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ func (cli *Client) handleCallEvent(node *waBinary.Node) {
Reason: cag.String("reason"),
Data: &child,
})
case "reject":
cli.dispatchEvent(&events.CallReject{
BasicCallMeta: basicMeta,
Data: &child,
})
default:
cli.dispatchEvent(&events.UnknownCallEvent{Node: node})
}
Expand Down
6 changes: 6 additions & 0 deletions types/events/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ type CallTerminate struct {
Data *waBinary.Node
}

// CallReject is sent when the other party rejects the call on WhatsApp.
type CallReject struct {
types.BasicCallMeta
Data *waBinary.Node
}

// UnknownCallEvent is emitted when a call element with unknown content is received.
type UnknownCallEvent struct {
Node *waBinary.Node
Expand Down

0 comments on commit 94acb10

Please sign in to comment.