mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-31 13:06:09 +00:00
feat: add background group creation and placeholder spinny progress
This commit is contained in:
@@ -198,3 +198,20 @@ Java_network_loki_messenger_libsession_1util_GroupKeysConfig_keys(JNIEnv *env, j
|
||||
}
|
||||
return our_stack;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_network_loki_messenger_libsession_1util_GroupKeysConfig_currentHashes(JNIEnv *env,
|
||||
jobject thiz) {
|
||||
auto ptr = ptrToKeys(env, thiz);
|
||||
auto existing = ptr->current_hashes();
|
||||
jclass stack = env->FindClass("java/util/Stack");
|
||||
jmethodID init = env->GetMethodID(stack, "<init>", "()V");
|
||||
jobject our_list = env->NewObject(stack, init);
|
||||
jmethodID push = env->GetMethodID(stack, "push", "(Ljava/lang/Object;)Ljava/lang/Object;");
|
||||
for (auto& hash : existing) {
|
||||
auto hash_bytes = env->NewStringUTF(hash.data());
|
||||
env->CallObjectMethod(our_list, push, hash_bytes);
|
||||
}
|
||||
return our_list;
|
||||
}
|
||||
@@ -292,7 +292,8 @@ class GroupMembersConfig(pointer: Long): ConfigBase(pointer), Closeable {
|
||||
}
|
||||
}
|
||||
|
||||
sealed class ConfigSig(pointer: Long) : Config(pointer)
|
||||
sealed class ConfigSig(pointer: Long) : Config(pointer) {
|
||||
}
|
||||
|
||||
class GroupKeysConfig(pointer: Long): ConfigSig(pointer) {
|
||||
companion object {
|
||||
@@ -322,6 +323,7 @@ class GroupKeysConfig(pointer: Long): ConfigSig(pointer) {
|
||||
external fun needsRekey(): Boolean
|
||||
external fun pendingKey(): ByteArray?
|
||||
external fun pendingConfig(): ByteArray?
|
||||
external fun currentHashes(): List<String>
|
||||
external fun rekey(info: GroupInfoConfig, members: GroupMembersConfig): ByteArray
|
||||
override fun close() {
|
||||
free()
|
||||
|
||||
Reference in New Issue
Block a user