Skip to content

Commit

Permalink
add new API function
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Nov 13, 2024
1 parent 66ae973 commit 15c6f78
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
26 changes: 26 additions & 0 deletions jni-c-toxcore/jni-c-toxcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 15c6f78

Please sign in to comment.