mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-29 04:55:15 +00:00
refactor: naming consistent with library
This commit is contained in:
parent
2855d88e55
commit
0729bdab20
@ -1 +1 @@
|
|||||||
Subproject commit 3060122d0f1d1a6bc7bd22f7799280ce298568e2
|
Subproject commit 65cc4d6b0afaa6d12a9887c8814b16da5dc45863
|
@ -56,7 +56,7 @@ class InstrumentedTests {
|
|||||||
assertNull(contacts.get(definitelyRealId))
|
assertNull(contacts.get(definitelyRealId))
|
||||||
|
|
||||||
// Should be an uninitialized contact apart from ID
|
// Should be an uninitialized contact apart from ID
|
||||||
val c = contacts.getOrCreate(definitelyRealId)
|
val c = contacts.getOrConstruct(definitelyRealId)
|
||||||
assertEquals(definitelyRealId, c.id)
|
assertEquals(definitelyRealId, c.id)
|
||||||
assertNull(c.name)
|
assertNull(c.name)
|
||||||
assertNull(c.nickname)
|
assertNull(c.nickname)
|
||||||
@ -97,7 +97,7 @@ class InstrumentedTests {
|
|||||||
assertFalse(contacts2.needsDump())
|
assertFalse(contacts2.needsDump())
|
||||||
|
|
||||||
val anotherId = "051111111111111111111111111111111111111111111111111111111111111111"
|
val anotherId = "051111111111111111111111111111111111111111111111111111111111111111"
|
||||||
val c2 = contacts2.getOrCreate(anotherId)
|
val c2 = contacts2.getOrConstruct(anotherId)
|
||||||
contacts2.set(c2)
|
contacts2.set(c2)
|
||||||
val push2 = contacts2.push()
|
val push2 = contacts2.push()
|
||||||
assertEquals(2, push2.seqNo)
|
assertEquals(2, push2.seqNo)
|
||||||
|
@ -16,8 +16,8 @@ Java_network_loki_messenger_libsession_1util_Contacts_get(JNIEnv *env, jobject t
|
|||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT jobject JNICALL
|
JNIEXPORT jobject JNICALL
|
||||||
Java_network_loki_messenger_libsession_1util_Contacts_getOrCreate(JNIEnv *env, jobject thiz,
|
Java_network_loki_messenger_libsession_1util_Contacts_getOrConstruct(JNIEnv *env, jobject thiz,
|
||||||
jstring session_id) {
|
jstring session_id) {
|
||||||
auto contacts = ptrToContacts(env, thiz);
|
auto contacts = ptrToContacts(env, thiz);
|
||||||
auto session_id_chars = env->GetStringUTFChars(session_id, nullptr);
|
auto session_id_chars = env->GetStringUTFChars(session_id, nullptr);
|
||||||
auto contact = contacts->get_or_construct(session_id_chars);
|
auto contact = contacts->get_or_construct(session_id_chars);
|
||||||
|
@ -43,7 +43,7 @@ class Contacts(pointer: Long) : ConfigBase(pointer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
external fun get(sessionId: String): Contact?
|
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 all(): List<Contact>
|
||||||
external fun set(contact: Contact)
|
external fun set(contact: Contact)
|
||||||
external fun erase(sessionId: String): Boolean
|
external fun erase(sessionId: String): Boolean
|
||||||
|
Loading…
Reference in New Issue
Block a user