Skip to content

Commit f220c9c

Browse files
committed
fix bug for jvm. we need to convert the perr pubkey string to binary buffer first
1 parent c6f5007 commit f220c9c

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8525,9 +8525,20 @@ Java_com_zoffcc_applications_trifa_MainActivity_tox_1group_1send_1private_1messa
85258525
const jsize plength = (*env)->GetArrayLength(env, stringJbytes);
85268526
jbyte* pBytes = (*env)->GetByteArrayElements(env, stringJbytes, NULL);
85278527

8528-
dbg(9, "tox_group_send_private_message_by_peerpubkey:DEBUG:group_number=%d type=%d pBytes1=%s pBytes=%s", (int)group_number, type, pBytes1, pBytes);
85298528

8530-
res = tox_group_send_private_message_by_peerpubkey(tox_global, (uint32_t)group_number, (const uint8_t *)pBytes1, (int)type,
8529+
unsigned char peer_public_key_bin[TOX_PUBLIC_KEY_SIZE];
8530+
char *peer_public_key_string2 = NULL;
8531+
const char *s = NULL;
8532+
8533+
peer_public_key_string2 = strdup(pBytes1);
8534+
toxpk_hex_to_bin(peer_public_key_bin, peer_public_key_string2);
8535+
8536+
if(peer_public_key_string2)
8537+
{
8538+
free(peer_public_key_string2);
8539+
}
8540+
8541+
res = tox_group_send_private_message_by_peerpubkey(tox_global, (uint32_t)group_number, (const uint8_t *)peer_public_key_bin, (int)type,
85318542
(const uint8_t *)pBytes,
85328543
(size_t)plength, &error);
85338544

0 commit comments

Comments
 (0)