From 249b2d64b0139c89f45d9a94512a001ae9ffa800 Mon Sep 17 00:00:00 2001 From: zoff99 Date: Wed, 13 Nov 2024 18:50:06 +0100 Subject: [PATCH] sync JNI code --- jni-c-toxcore/jni-c-toxcore.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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)