Skip to content

feat: add RejectCall to decline incoming calls - #200

Open
marketingstudio-it wants to merge 1 commit into
krypton-byte:masterfrom
marketingstudio-it:feat/reject-call
Open

feat: add RejectCall to decline incoming calls#200
marketingstudio-it wants to merge 1 commit into
krypton-byte:masterfrom
marketingstudio-it:feat/reject-call

Conversation

@marketingstudio-it

Copy link
Copy Markdown

What

Exposes whatsmeow's Client.RejectCall so an incoming call can be declined/terminated from Python (sync + async clients).

Everything below the FFI boundary already supported this — only the binding and the Python wrappers were missing.

Changes

  • goneonize/main.go: //export RejectCall (mirrors SetGroupName), calling whatsmeow (*Client).RejectCall(ctx, callFrom, callID).
  • neonize/_binder.py: declare the RejectCall FFI symbol (c-string return).
  • neonize/client.py: NewClient.reject_call(call_from, call_id).
  • neonize/aioze/client.py: async NewAClient.reject_call(call_from, call_id).

call_from is the caller's JID from the CallOffer event; works for both a phone-number JID and a hosted @lid JID. Returns

Exposes whatsmeow's Client.RejectCall so an incoming WhatsApp call can be
declined/terminated from Python. Everything below the FFI boundary already
supported it; only the binding + wrappers were missing.

- goneonize/main.go: //export RejectCall (mirrors SetGroupName), calling
  whatsmeow (*Client).RejectCall(ctx, callFrom, callID).
- neonize/_binder.py: declare the RejectCall FFI symbol (c-string return).
- neonize/client.py: NewClient.reject_call(call_from, call_id).
- neonize/aioze/client.py: async NewClient.reject_call(call_from, call_id).

call_from is the caller's JID from the CallOffer event; it works for both a
phone-number JID and a hosted @lid JID. Returns an empty string on success,
otherwise the whatsmeow error text (same convention as set_group_name).

Usage:
    @client.event(CallOffer)
    def on_call(client, call):
        client.reject_call(call.basicCallMeta.callCreator, call.basicCallMeta.callID)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant