feat: adding additional config base implementations

This commit is contained in:
0x330a 2022-11-30 12:11:12 +11:00
parent ad00aeac4a
commit e784fa79d0
No known key found for this signature in database
GPG Key ID: 267811D6E6A2698C
3 changed files with 9 additions and 1 deletions

View File

@ -36,6 +36,7 @@ class ExampleInstrumentedTest {
val nameFromNative = userProfile.getName() val nameFromNative = userProfile.getName()
assertEquals(newName, nameFromNative) assertEquals(newName, nameFromNative)
println("Name received by JNI call: $nameFromNative") println("Name received by JNI call: $nameFromNative")
assertTrue(userProfile.dirty())
userProfile.free() userProfile.free()
} }

View File

@ -52,3 +52,10 @@ Java_network_loki_messenger_libsession_1util_UserProfile_free(JNIEnv *env, jobje
auto profile = ptrToProfile(env, obj); auto profile = ptrToProfile(env, obj);
delete profile; delete profile;
} }
extern "C"
JNIEXPORT jboolean JNICALL
Java_network_loki_messenger_libsession_1util_ConfigBase_dirty(JNIEnv *env, jobject thiz) {
auto* configBase = ptrToConfigBase(env, thiz);
return configBase->is_dirty();
}

View File

@ -7,9 +7,9 @@ sealed class ConfigBase(protected val /* yucky */ pointer: Long) {
System.loadLibrary("session_util") System.loadLibrary("session_util")
} }
} }
external fun dirty(): Boolean
} }
class UserProfile(pointer: Long): ConfigBase(pointer) { class UserProfile(pointer: Long): ConfigBase(pointer) {
companion object { companion object {
init { init {