@@ -1233,8 +1233,9 @@ uint32_t dc_init_webxdc_integration (dc_context_t* context, uint32_t c
1233
1233
* callee's other devices receive #DC_EVENT_CALL_ENDED and have a "Cancelled Call",
1234
1234
*
1235
1235
* - 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
1238
1239
*
1239
1240
* - timeout:
1240
1241
* after 1 minute without action,
@@ -1252,6 +1253,13 @@ uint32_t dc_init_webxdc_integration (dc_context_t* context, uint32_t c
1252
1253
* - callee ends the call using dc_end_call():
1253
1254
* caller receives #DC_EVENT_CALL_ENDED
1254
1255
*
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
+ *
1255
1263
* Note, that the events are for updating the call screen,
1256
1264
* possible status messages are added and updated as usual, including the known events.
1257
1265
* 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
1279
1287
* either #DC_EVENT_OUTGOING_CALL_ACCEPTED or #DC_EVENT_INCOMING_CALL_ACCEPTED.
1280
1288
*
1281
1289
* If the call is already accepted or ended, nothing happens.
1290
+ * If the chat is a contact request, it is accepted implicitly.
1282
1291
*
1283
1292
* @memberof dc_context_t
1284
1293
* @param context The context object.
@@ -1299,7 +1308,12 @@ uint32_t dc_place_outgoing_call (dc_context_t* context, uint32_t ch
1299
1308
* Unaccepted calls ended by the callee are a "decline".
1300
1309
* If the call was accepted, this is a "hangup".
1301
1310
*
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.
1303
1317
*
1304
1318
* If the call is already ended, nothing happens.
1305
1319
*
@@ -6725,7 +6739,8 @@ void dc_event_unref(dc_event_t* event);
6725
6739
*
6726
6740
* Together with this event,
6727
6741
* 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.
6729
6744
*
6730
6745
* If user takes action, dc_accept_incoming_call() or dc_end_call() should be called.
6731
6746
*
@@ -6741,8 +6756,7 @@ void dc_event_unref(dc_event_t* event);
6741
6756
* The callee accepted an incoming call on this or another device using dc_accept_incoming_call().
6742
6757
* The caller gets the event #DC_EVENT_OUTGOING_CALL_ACCEPTED at the same time.
6743
6758
*
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.
6746
6760
*
6747
6761
* @param data1 (int) msg_id ID of the message referring to the call
6748
6762
*/
@@ -6751,20 +6765,18 @@ void dc_event_unref(dc_event_t* event);
6751
6765
/**
6752
6766
* A call placed using dc_place_outgoing_call() was accepted by the callee using dc_accept_incoming_call().
6753
6767
*
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.
6756
6769
*
6757
6770
* @param data1 (int) msg_id ID of the message referring to the call
6758
6771
* @param data2 (char*) accept_call_info, text passed to dc_accept_incoming_call()
6759
6772
*/
6760
6773
#define DC_EVENT_OUTGOING_CALL_ACCEPTED 2570
6761
6774
6762
6775
/**
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 .
6764
6777
* Moreover, the event is sent when the call was not accepted within 1 minute timeout.
6765
6778
*
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.
6768
6780
*
6769
6781
* @param data1 (int) msg_id ID of the message referring to the call
6770
6782
*/
0 commit comments