feat: Add EventType::CallMissed and emit it for missed calls (#7840)

Before, only `CallEnded` was emitted for missed calls, or, if a call arrives already being stale,
`IncomingMsg`. Now:
- `CallMissed` is emitted in addition to `CallEnded`.
- `IncomingMsg` is replaced with `CallMissed` for stale calls.
Having only one event type for missed calls should simplify handling them in the apps.

This doesn't emit `CallMissed` for those who aren't allowed to call us. Also, don't emit `CallEnded`
if the caller isn't allowed to call us and the call wasn't accepted, as there's no previous
`IncomingCall` event in this case.
This commit is contained in:
iequidoo
2026-03-04 20:12:47 -03:00
parent ef718bb869
commit 79c45e338c
6 changed files with 194 additions and 51 deletions

View File

@@ -6701,6 +6701,16 @@ void dc_event_unref(dc_event_t* event);
*/
#define DC_EVENT_CALL_ENDED 2580
/**
* An incoming call was missed. Only emitted if the caller is allowed to call us. This happens when:
* - A call timed out (not accepted by us on time).
* - A call was canceled by the caller.
* - A stale call message was received, i.e. it is older than the timeout.
*
* This should trigger a UI notification.
*/
#define DC_EVENT_CALL_MISSED 2590
/**
* Transport relay added/deleted or default has changed.
* UI should update the list.