Skip to content

Commit daac3ea

Browse files
committed
docs: clarify CALL events
1 parent 1cc7ce6 commit daac3ea

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

deltachat-ffi/deltachat.h

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,8 +1233,9 @@ uint32_t dc_init_webxdc_integration (dc_context_t* context, uint32_t c
12331233
* callee's other devices receive #DC_EVENT_CALL_ENDED and have a "Cancelled Call",
12341234
*
12351235
* - callee is already in a call:
1236-
* in this case, UI may decide to show a notification instead of ringing.
1237-
* otherwise, this is same as timeout
1236+
* what to do depends on the capabilities of UI to handle calls.
1237+
* if UI cannot handle multiple calls, an easy approach would be to decline the new call automatically
1238+
* and make that visble to the user in the call, eg. by a notification
12381239
*
12391240
* - timeout:
12401241
* after 1 minute without action,
@@ -1252,6 +1253,13 @@ uint32_t dc_init_webxdc_integration (dc_context_t* context, uint32_t c
12521253
* - callee ends the call using dc_end_call():
12531254
* caller receives #DC_EVENT_CALL_ENDED
12541255
*
1256+
* Contact request handling:
1257+
*
1258+
* - placing or accepting calls implies accepting contact requests
1259+
*
1260+
* - ending a call does not accept a contact request;
1261+
* instead, the call will timeout on all affected devices.
1262+
*
12551263
* Note, that the events are for updating the call screen,
12561264
* possible status messages are added and updated as usual, including the known events.
12571265
* In the UI, the sorted chatlist is used as an overview about calls as well as messages.
@@ -1279,6 +1287,7 @@ uint32_t dc_place_outgoing_call (dc_context_t* context, uint32_t ch
12791287
* either #DC_EVENT_OUTGOING_CALL_ACCEPTED or #DC_EVENT_INCOMING_CALL_ACCEPTED.
12801288
*
12811289
* If the call is already accepted or ended, nothing happens.
1290+
* If the chat is a contact request, it is accepted implicitly.
12821291
*
12831292
* @memberof dc_context_t
12841293
* @param context The context object.
@@ -1299,7 +1308,12 @@ uint32_t dc_place_outgoing_call (dc_context_t* context, uint32_t ch
12991308
* Unaccepted calls ended by the callee are a "decline".
13001309
* If the call was accepted, this is a "hangup".
13011310
*
1302-
* All participant devices get informed about the ended call via #DC_EVENT_CALL_ENDED.
1311+
* All participant devices get informed about the ended call via #DC_EVENT_CALL_ENDED unless they are contact requests.
1312+
* For contact requests, the call times out on all other affected devices.
1313+
*
1314+
* If the message ID is wrong or does not exist for whatever reasons, nothing happends.
1315+
* However, for resilience, UI should anyways remove the call UI directly when calling
1316+
* this function and not rely on the event.
13031317
*
13041318
* If the call is already ended, nothing happens.
13051319
*
@@ -6725,7 +6739,8 @@ void dc_event_unref(dc_event_t* event);
67256739
*
67266740
* Together with this event,
67276741
* a message of type #DC_MSG_CALL is added to the corresponding chat;
6728-
* this message is announced and updated by the usual even as #DC_EVENT_MSGS_CHANGED.
6742+
* this message is announced and updated by the usual event as #DC_EVENT_MSGS_CHANGED,
6743+
* there is usually no need to take care of this message from any of the CALL events.
67296744
*
67306745
* If user takes action, dc_accept_incoming_call() or dc_end_call() should be called.
67316746
*
@@ -6741,8 +6756,7 @@ void dc_event_unref(dc_event_t* event);
67416756
* The callee accepted an incoming call on this or another device using dc_accept_incoming_call().
67426757
* The caller gets the event #DC_EVENT_OUTGOING_CALL_ACCEPTED at the same time.
67436758
*
6744-
* The event is sent unconditionally when the corresponding message is received.
6745-
* UI should only take action in case call UI was opened before, otherwise the event should be ignored.
6759+
* UI usually only takes action in case call UI was opened before, otherwise the event should be ignored.
67466760
*
67476761
* @param data1 (int) msg_id ID of the message referring to the call
67486762
*/
@@ -6751,20 +6765,18 @@ void dc_event_unref(dc_event_t* event);
67516765
/**
67526766
* A call placed using dc_place_outgoing_call() was accepted by the callee using dc_accept_incoming_call().
67536767
*
6754-
* The event is sent unconditionally when the corresponding message is received.
6755-
* UI should only take action in case call UI was opened before, otherwise the event should be ignored.
6768+
* UI usually only takes action in case call UI was opened before, otherwise the event should be ignored.
67566769
*
67576770
* @param data1 (int) msg_id ID of the message referring to the call
67586771
* @param data2 (char*) accept_call_info, text passed to dc_accept_incoming_call()
67596772
*/
67606773
#define DC_EVENT_OUTGOING_CALL_ACCEPTED 2570
67616774

67626775
/**
6763-
* An incoming or outgoing call was ended using dc_end_call().
6776+
* An incoming or outgoing call was ended using dc_end_call() on this or another device, by caller or callee.
67646777
* Moreover, the event is sent when the call was not accepted within 1 minute timeout.
67656778
*
6766-
* The event is sent unconditionally when the corresponding message is received.
6767-
* UI should only take action in case call UI was opened before, otherwise the event should be ignored.
6779+
* UI usually only takes action in case call UI was opened before, otherwise the event should be ignored.
67686780
*
67696781
* @param data1 (int) msg_id ID of the message referring to the call
67706782
*/

0 commit comments

Comments
 (0)