diff --git a/android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/MainActivity.java b/android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/MainActivity.java index 41b09a6f4..b9292dfe7 100644 --- a/android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/MainActivity.java +++ b/android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/MainActivity.java @@ -3411,6 +3411,8 @@ static void allocate_video_buffer_1(int frame_width_px1, int frame_height_px1, l public static native int tox_group_leave(long group_number, String part_message); + public static native int tox_group_disconnect(long group_number); + public static native long tox_group_self_get_peer_id(long group_number); public static native int tox_group_self_set_name(long group_number, @NonNull String my_peer_name); diff --git a/jni-c-toxcore/jni-c-toxcore.c b/jni-c-toxcore/jni-c-toxcore.c index cd03b3b2a..d21df0463 100644 --- a/jni-c-toxcore/jni-c-toxcore.c +++ b/jni-c-toxcore/jni-c-toxcore.c @@ -6461,6 +6461,32 @@ Java_com_zoffcc_applications_trifa_MainActivity_tox_1group_1leave(JNIEnv *env, j #endif } +JNIEXPORT jint JNICALL +Java_com_zoffcc_applications_trifa_MainActivity_tox_1group_1disconnect(JNIEnv *env, jobject thiz, + jlong group_number) +{ +#ifndef HAVE_TOX_NGC + return (jint)-99; +#else + if(tox_global == NULL) + { + return (jint)-99; + } + + Tox_Err_Group_Disconnect error; + bool res = tox_group_disconnect(tox_global, (uint32_t)group_number, &error); + + if(res == false) + { + return (jint)-1; + } + else + { + return (jint)0; + } +#endif +} + JNIEXPORT jint JNICALL Java_com_zoffcc_applications_trifa_MainActivity_tox_1group_1self_1set_1name(JNIEnv *env, jobject thiz, jlong group_number, jstring name)