mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
add call api
This commit is contained in:
parent
9caf94d035
commit
eee218a3b6
3 changed files with 33 additions and 0 deletions
|
@ -773,6 +773,30 @@ JNIEXPORT void Java_com_b44t_messenger_DcContext_setWebxdcIntegration(JNIEnv *en
|
|||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcContext_placeOutgoingCall(JNIEnv *env, jobject obj, jint chat_id, jstring info)
|
||||
{
|
||||
CHAR_REF(info);
|
||||
jint msg_id = dc_place_outgoing_call(get_dc_context(env, obj), chat_id, infoPtr);
|
||||
CHAR_UNREF(info);
|
||||
return msg_id;
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcContext_acceptIncomingCall(JNIEnv *env, jobject obj, jint msg_id, jstring info)
|
||||
{
|
||||
CHAR_REF(info);
|
||||
jboolean ret = dc_accept_incoming_call(get_dc_context(env, obj), msg_id, infoPtr) != 0;
|
||||
CHAR_UNREF(info);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcContext_endCall(JNIEnv *env, jobject obj, jint msg_id)
|
||||
{
|
||||
return dc_end_call(get_dc_context(env, obj), msg_id) != 0;
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcContext_addDeviceMsg(JNIEnv *env, jobject obj, jstring label, jobject msg)
|
||||
{
|
||||
CHAR_REF(label);
|
||||
|
|
|
@ -31,6 +31,10 @@ public class DcContext {
|
|||
public final static int DC_EVENT_WEBXDC_INSTANCE_DELETED = 2121;
|
||||
public final static int DC_EVENT_WEBXDC_REALTIME_DATA = 2150;
|
||||
public final static int DC_EVENT_ACCOUNTS_BACKGROUND_FETCH_DONE = 2200;
|
||||
public final static int DC_EVENT_INCOMING_CALL = 2550;
|
||||
public final static int DC_EVENT_INCOMING_CALL_ACCEPTED = 2560;
|
||||
public final static int DC_EVENT_OUTGOING_CALL_ACCEPTED = 2570;
|
||||
public final static int DC_EVENT_CALL_ENDED = 2580;
|
||||
|
||||
public final static int DC_IMEX_EXPORT_SELF_KEYS = 1;
|
||||
public final static int DC_IMEX_IMPORT_SELF_KEYS = 2;
|
||||
|
@ -203,6 +207,9 @@ public class DcContext {
|
|||
public native String getWebxdcStatusUpdates(int msg_id, int last_known_serial);
|
||||
public native void setWebxdcIntegration (String file);
|
||||
public native int initWebxdcIntegration(int chat_id);
|
||||
public native int placeOutgoingCall (int chat_id, String place_call_info);
|
||||
public native boolean acceptIncomingCall (int msg_id, String accept_call_info);
|
||||
public native boolean endCall (int msg_id);
|
||||
public native int addDeviceMsg (String label, DcMsg msg);
|
||||
public native boolean wasDeviceMsgEverAdded(String label);
|
||||
public DcLot checkQr (String qr) { return new DcLot(checkQrCPtr(qr)); }
|
||||
|
|
|
@ -36,6 +36,8 @@ public class DcMsg {
|
|||
public final static int DC_INFO_PROTECTION_DISABLED = 12;
|
||||
public final static int DC_INFO_INVALID_UNENCRYPTED_MAIL = 13;
|
||||
public final static int DC_INFO_WEBXDC_INFO_MESSAGE = 32;
|
||||
public final static int DC_INFO_OUTGOING_CALL = 50;
|
||||
public final static int DC_INFO_INCOMING_CALL = 55;
|
||||
|
||||
public final static int DC_STATE_UNDEFINED = 0;
|
||||
public final static int DC_STATE_IN_FRESH = 10;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue