Skip to content

Commit 15c6f78

Browse files
committed
add new API function
1 parent 66ae973 commit 15c6f78

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/MainActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3411,6 +3411,8 @@ static void allocate_video_buffer_1(int frame_width_px1, int frame_height_px1, l
34113411

34123412
public static native int tox_group_leave(long group_number, String part_message);
34133413

3414+
public static native int tox_group_disconnect(long group_number);
3415+
34143416
public static native long tox_group_self_get_peer_id(long group_number);
34153417

34163418
public static native int tox_group_self_set_name(long group_number, @NonNull String my_peer_name);

jni-c-toxcore/jni-c-toxcore.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6461,6 +6461,32 @@ Java_com_zoffcc_applications_trifa_MainActivity_tox_1group_1leave(JNIEnv *env, j
64616461
#endif
64626462
}
64636463

6464+
JNIEXPORT jint JNICALL
6465+
Java_com_zoffcc_applications_trifa_MainActivity_tox_1group_1disconnect(JNIEnv *env, jobject thiz,
6466+
jlong group_number)
6467+
{
6468+
#ifndef HAVE_TOX_NGC
6469+
return (jint)-99;
6470+
#else
6471+
if(tox_global == NULL)
6472+
{
6473+
return (jint)-99;
6474+
}
6475+
6476+
Tox_Err_Group_Disconnect error;
6477+
bool res = tox_group_disconnect(tox_global, (uint32_t)group_number, &error);
6478+
6479+
if(res == false)
6480+
{
6481+
return (jint)-1;
6482+
}
6483+
else
6484+
{
6485+
return (jint)0;
6486+
}
6487+
#endif
6488+
}
6489+
64646490
JNIEXPORT jint JNICALL
64656491
Java_com_zoffcc_applications_trifa_MainActivity_tox_1group_1self_1set_1name(JNIEnv *env, jobject thiz,
64666492
jlong group_number, jstring name)

0 commit comments

Comments
 (0)