Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: call rejection event #610

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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