Put back invite contacts job

This commit is contained in:
SessionHero01
2024-09-26 17:23:54 +10:00
parent 771d63e902
commit b9f5f940a1
5 changed files with 431 additions and 218 deletions

View File

@@ -277,14 +277,15 @@ extern "C"
JNIEXPORT jbyteArray JNICALL
Java_network_loki_messenger_libsession_1util_GroupKeysConfig_supplementFor(JNIEnv *env,
jobject thiz,
jstring user_session_id) {
jobjectArray j_user_session_ids) {
std::lock_guard lock{util::util_mutex_};
auto ptr = ptrToKeys(env, thiz);
auto string = env->GetStringUTFChars(user_session_id, nullptr);
auto supplement = ptr->key_supplement(string);
auto supplement_jbytearray = util::bytes_from_ustring(env, supplement);
env->ReleaseStringUTFChars(user_session_id, string);
return supplement_jbytearray;
std::vector<std::string> user_session_ids;
for (int i = 0, size = env->GetArrayLength(j_user_session_ids); i < size; i++) {
user_session_ids.push_back(util::string_from_jstring(env, (jstring)(env->GetObjectArrayElement(j_user_session_ids, i))));
}
auto supplement = ptr->key_supplement(user_session_ids);
return util::bytes_from_ustring(env, supplement);
}
extern "C"
JNIEXPORT jint JNICALL

View File

@@ -427,7 +427,7 @@ interface ReadableGroupKeysConfig {
fun dump(): ByteArray
fun needsRekey(): Boolean
fun pendingKey(): ByteArray?
fun supplementFor(userSessionId: String): ByteArray
fun supplementFor(userSessionIds: List<String>): ByteArray
fun pendingConfig(): ByteArray?
fun currentHashes(): List<String>
fun encrypt(plaintext: ByteArray): ByteArray
@@ -484,7 +484,11 @@ class GroupKeysConfig private constructor(pointer: Long): ConfigSig(pointer), Mu
membersPtr: Long): Boolean
external override fun needsRekey(): Boolean
external override fun pendingKey(): ByteArray?
external override fun supplementFor(userSessionId: String): ByteArray
private external fun supplementFor(userSessionIds: Array<String>): ByteArray
override fun supplementFor(userSessionIds: List<String>): ByteArray {
return supplementFor(userSessionIds.toTypedArray())
}
external override fun pendingConfig(): ByteArray?
external override fun currentHashes(): List<String>
external fun rekey(infoPtr: Long, membersPtr: Long): ByteArray