refactor: naming consistent with library

This commit is contained in:
0x330a 2023-01-16 15:47:06 +11:00
parent 2855d88e55
commit 0729bdab20
No known key found for this signature in database
GPG Key ID: 267811D6E6A2698C
4 changed files with 6 additions and 6 deletions

@ -1 +1 @@
Subproject commit 3060122d0f1d1a6bc7bd22f7799280ce298568e2
Subproject commit 65cc4d6b0afaa6d12a9887c8814b16da5dc45863

View File

@ -56,7 +56,7 @@ class InstrumentedTests {
assertNull(contacts.get(definitelyRealId))
// Should be an uninitialized contact apart from ID
val c = contacts.getOrCreate(definitelyRealId)
val c = contacts.getOrConstruct(definitelyRealId)
assertEquals(definitelyRealId, c.id)
assertNull(c.name)
assertNull(c.nickname)
@ -97,7 +97,7 @@ class InstrumentedTests {
assertFalse(contacts2.needsDump())
val anotherId = "051111111111111111111111111111111111111111111111111111111111111111"
val c2 = contacts2.getOrCreate(anotherId)
val c2 = contacts2.getOrConstruct(anotherId)
contacts2.set(c2)
val push2 = contacts2.push()
assertEquals(2, push2.seqNo)

View File

@ -16,8 +16,8 @@ Java_network_loki_messenger_libsession_1util_Contacts_get(JNIEnv *env, jobject t
extern "C"
JNIEXPORT jobject JNICALL
Java_network_loki_messenger_libsession_1util_Contacts_getOrCreate(JNIEnv *env, jobject thiz,
jstring session_id) {
Java_network_loki_messenger_libsession_1util_Contacts_getOrConstruct(JNIEnv *env, jobject thiz,
jstring session_id) {
auto contacts = ptrToContacts(env, thiz);
auto session_id_chars = env->GetStringUTFChars(session_id, nullptr);
auto contact = contacts->get_or_construct(session_id_chars);

View File

@ -43,7 +43,7 @@ class Contacts(pointer: Long) : ConfigBase(pointer) {
}
external fun get(sessionId: String): Contact?
external fun getOrCreate(sessionId: String): Contact
external fun getOrConstruct(sessionId: String): Contact
external fun all(): List<Contact>
external fun set(contact: Contact)
external fun erase(sessionId: String): Boolean