@@ -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, e.g. 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
+ * Therefore, and for resilience, UI should remove the call UI directly when calling
1316
+ * this function and not only on the event.
1303
1317
*
1304
1318
* If the call is already ended, nothing happens.
1305
1319
*
@@ -5714,6 +5728,18 @@ int64_t dc_lot_get_timestamp (const dc_lot_t* lot);
5714
5728
5715
5729
/**
5716
5730
* Message indicating an incoming or outgoing call.
5731
+ *
5732
+ * These messages are created by dc_place_outgoing_call()
5733
+ * and should be rendered by UI similar to text messages,
5734
+ * maybe with some "phone icon" at the side.
5735
+ *
5736
+ * The message text is updated as needed
5737
+ * and UI will be informed via #DC_EVENT_MSGS_CHANGED as usual.
5738
+ *
5739
+ * Do not start ringing when seeing this message;
5740
+ * the mesage may belong e.g. to an old missed call.
5741
+ *
5742
+ * Instead, ringing should start on the event #DC_EVENT_INCOMING_CALL
5717
5743
*/
5718
5744
#define DC_MSG_CALL 71
5719
5745
@@ -6725,7 +6751,8 @@ void dc_event_unref(dc_event_t* event);
6725
6751
*
6726
6752
* Together with this event,
6727
6753
* 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.
6754
+ * this message is announced and updated by the usual event as #DC_EVENT_MSGS_CHANGED,
6755
+ * there is usually no need to take care of this message from any of the CALL events.
6729
6756
*
6730
6757
* If user takes action, dc_accept_incoming_call() or dc_end_call() should be called.
6731
6758
*
@@ -6741,8 +6768,7 @@ void dc_event_unref(dc_event_t* event);
6741
6768
* The callee accepted an incoming call on this or another device using dc_accept_incoming_call().
6742
6769
* The caller gets the event #DC_EVENT_OUTGOING_CALL_ACCEPTED at the same time.
6743
6770
*
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.
6771
+ * UI usually only takes action in case call UI was opened before, otherwise the event should be ignored.
6746
6772
*
6747
6773
* @param data1 (int) msg_id ID of the message referring to the call
6748
6774
*/
@@ -6751,20 +6777,18 @@ void dc_event_unref(dc_event_t* event);
6751
6777
/**
6752
6778
* A call placed using dc_place_outgoing_call() was accepted by the callee using dc_accept_incoming_call().
6753
6779
*
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.
6780
+ * UI usually only takes action in case call UI was opened before, otherwise the event should be ignored.
6756
6781
*
6757
6782
* @param data1 (int) msg_id ID of the message referring to the call
6758
6783
* @param data2 (char*) accept_call_info, text passed to dc_accept_incoming_call()
6759
6784
*/
6760
6785
#define DC_EVENT_OUTGOING_CALL_ACCEPTED 2570
6761
6786
6762
6787
/**
6763
- * An incoming or outgoing call was ended using dc_end_call().
6788
+ * An incoming or outgoing call was ended using dc_end_call() on this or another device, by caller or callee .
6764
6789
* Moreover, the event is sent when the call was not accepted within 1 minute timeout.
6765
6790
*
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.
6791
+ * UI usually only takes action in case call UI was opened before, otherwise the event should be ignored.
6768
6792
*
6769
6793
* @param data1 (int) msg_id ID of the message referring to the call
6770
6794
*/
0 commit comments