refactor: use existing lookup for objects in wrappers so they don't overwrite missing values

This commit is contained in:
0x330a 2023-03-08 18:04:26 +11:00
parent 3642aaa511
commit 0b4cff71e3
11 changed files with 63 additions and 84 deletions

View File

@ -2,37 +2,20 @@ package org.thoughtcrime.securesms.database
import android.content.Context
import android.net.Uri
import network.loki.messenger.libsession_util.ConfigBase
import network.loki.messenger.libsession_util.Contacts
import network.loki.messenger.libsession_util.ConversationVolatileConfig
import network.loki.messenger.libsession_util.UserGroupsConfig
import network.loki.messenger.libsession_util.UserProfile
import network.loki.messenger.libsession_util.*
import network.loki.messenger.libsession_util.util.Conversation
import network.loki.messenger.libsession_util.util.GroupInfo
import network.loki.messenger.libsession_util.util.UserPic
import org.session.libsession.avatars.AvatarHelper
import org.session.libsession.database.StorageProtocol
import org.session.libsession.messaging.BlindedIdMapping
import org.session.libsession.messaging.calls.CallMessageType
import org.session.libsession.messaging.contacts.Contact
import org.session.libsession.messaging.jobs.AttachmentUploadJob
import org.session.libsession.messaging.jobs.ConfigurationSyncJob
import org.session.libsession.messaging.jobs.GroupAvatarDownloadJob
import org.session.libsession.messaging.jobs.Job
import org.session.libsession.messaging.jobs.JobQueue
import org.session.libsession.messaging.jobs.MessageReceiveJob
import org.session.libsession.messaging.jobs.MessageSendJob
import org.session.libsession.messaging.jobs.*
import org.session.libsession.messaging.messages.Destination
import org.session.libsession.messaging.messages.Message
import org.session.libsession.messaging.messages.control.ConfigurationMessage
import org.session.libsession.messaging.messages.control.MessageRequestResponse
import org.session.libsession.messaging.messages.signal.IncomingEncryptedMessage
import org.session.libsession.messaging.messages.signal.IncomingGroupMessage
import org.session.libsession.messaging.messages.signal.IncomingMediaMessage
import org.session.libsession.messaging.messages.signal.IncomingTextMessage
import org.session.libsession.messaging.messages.signal.OutgoingGroupMediaMessage
import org.session.libsession.messaging.messages.signal.OutgoingMediaMessage
import org.session.libsession.messaging.messages.signal.OutgoingTextMessage
import org.session.libsession.messaging.messages.signal.*
import org.session.libsession.messaging.messages.visible.Attachment
import org.session.libsession.messaging.messages.visible.Profile
import org.session.libsession.messaging.messages.visible.Reaction
@ -49,13 +32,8 @@ import org.session.libsession.messaging.utilities.SessionId
import org.session.libsession.messaging.utilities.SodiumUtilities
import org.session.libsession.messaging.utilities.UpdateMessageData
import org.session.libsession.snode.OnionRequestAPI
import org.session.libsession.utilities.Address
import org.session.libsession.utilities.*
import org.session.libsession.utilities.Address.Companion.fromSerialized
import org.session.libsession.utilities.GroupRecord
import org.session.libsession.utilities.GroupUtil
import org.session.libsession.utilities.ProfileKeyUtil
import org.session.libsession.utilities.SSKEnvironment
import org.session.libsession.utilities.TextSecurePreferences
import org.session.libsession.utilities.recipients.Recipient
import org.session.libsignal.crypto.ecc.ECKeyPair
import org.session.libsignal.messages.SignalServiceAttachmentPointer
@ -71,6 +49,7 @@ import org.thoughtcrime.securesms.database.model.MessageId
import org.thoughtcrime.securesms.database.model.ReactionRecord
import org.thoughtcrime.securesms.dependencies.ConfigFactory
import org.thoughtcrime.securesms.dependencies.DatabaseComponent
import org.thoughtcrime.securesms.groups.GroupManager
import org.thoughtcrime.securesms.groups.OpenGroupManager
import org.thoughtcrime.securesms.jobs.RetrieveProfileAvatarJob
import org.thoughtcrime.securesms.mms.PartAuthority
@ -382,20 +361,26 @@ class Storage(context: Context, helper: SQLCipherOpenHelper, private val configF
private fun updateUserGroups(userGroups: UserGroupsConfig) {
val threadDb = DatabaseComponent.get(context).threadDatabase()
val (communities, lgc) = userGroups.all().partition { it is GroupInfo.CommunityGroupInfo }
val communities = userGroups.allCommunityInfo()
val lgc = userGroups.allLegacyGroupInfo()
val allOpenGroups = getAllOpenGroups()
val toDelete = allOpenGroups.filter { it.value.joinURL !in communities.map { (it as GroupInfo.CommunityGroupInfo).community.fullUrl() } }
val existingOpenGroups: Map<Long, OpenGroup> = allOpenGroups.filterKeys { it !in toDelete.keys }
val toDeleteCommunities = allOpenGroups.filter { it.value.joinURL !in communities.map { it.community.fullUrl() } }
val existingOpenGroups: Map<Long, OpenGroup> = allOpenGroups.filterKeys { it !in toDeleteCommunities.keys }
val existingJoinUrls = existingOpenGroups.values.map { it.joinURL }
val existingClosedGroups = getAllGroups()
val lgcIds = lgc.map { it.sessionId }
val toDeleteClosedGroups = existingClosedGroups.filter { group ->
GroupUtil.doubleDecodeGroupId(group.encodedId) !in lgcIds
}
// delete the ones which are not listed in the config
toDelete.values.forEach { openGroup ->
toDeleteCommunities.values.forEach { openGroup ->
OpenGroupManager.delete(openGroup.server, openGroup.room, context)
}
// GroupManager.deleteGroup()
for (groupInfo in communities) {
if (groupInfo !is GroupInfo.CommunityGroupInfo) continue
val groupBaseCommunity = groupInfo.community
if (groupBaseCommunity.fullUrl() !in existingJoinUrls) {
// add it
@ -408,7 +393,6 @@ class Storage(context: Context, helper: SQLCipherOpenHelper, private val configF
}
for (group in lgc) {
if (group !is GroupInfo.LegacyGroupInfo) continue
val existingGroup = existingClosedGroups.firstOrNull { GroupUtil.doubleDecodeGroupId(it.encodedId) == group.sessionId }
val existingThread = existingGroup?.let { getThreadId(existingGroup.encodedId) }
if (existingGroup != null) {

@ -1 +1 @@
Subproject commit f76fee84d76bf0437e57a5e4ae15ba76a31e0ca6
Subproject commit 5241878bb20a9232b011f709adb87d1e6e7496b4

View File

@ -2,11 +2,7 @@ package network.loki.messenger.libsession_util
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import network.loki.messenger.libsession_util.util.Contact
import network.loki.messenger.libsession_util.util.Conversation
import network.loki.messenger.libsession_util.util.KeyPair
import network.loki.messenger.libsession_util.util.Sodium
import network.loki.messenger.libsession_util.util.UserPic
import network.loki.messenger.libsession_util.util.*
import org.hamcrest.CoreMatchers.not
import org.hamcrest.MatcherAssert.assertThat
import org.junit.Assert.*
@ -295,7 +291,6 @@ class InstrumentedTests {
// userProfile device polls and merges
userProfile.merge("fakehash5" to newSeqMerge.config)
val userConfigMerge = userProfile.push()
assertEquals(4, userConfigMerge.seqNo)
@ -364,41 +359,41 @@ class InstrumentedTests {
@Test
fun test_open_group_urls() {
val (base1, room1, pk1) = Conversation.Community.parseFullUrl(
val (base1, room1, pk1) = BaseCommunityInfo.parseFullUrl(
"https://example.com/" +
"someroom?public_key=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
)!!
val (base2, room2, pk2) = Conversation.Community.parseFullUrl(
val (base2, room2, pk2) = BaseCommunityInfo.parseFullUrl(
"HTTPS://EXAMPLE.COM/" +
"someroom?public_key=0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
)!!
val (base3, room3, pk3) = Conversation.Community.parseFullUrl(
val (base3, room3, pk3) = BaseCommunityInfo.parseFullUrl(
"HTTPS://EXAMPLE.COM/r/" +
"someroom?public_key=0123456789aBcdEF0123456789abCDEF0123456789ABCdef0123456789ABCDEF"
)!!
val (base4, room4, pk4) = Conversation.Community.parseFullUrl(
val (base4, room4, pk4) = BaseCommunityInfo.parseFullUrl(
"http://example.com/r/" +
"someroom?public_key=0123456789aBcdEF0123456789abCDEF0123456789ABCdef0123456789ABCDEF"
)!!
val (base5, room5, pk5) = Conversation.Community.parseFullUrl(
val (base5, room5, pk5) = BaseCommunityInfo.parseFullUrl(
"HTTPS://EXAMPLE.com:443/r/" +
"someroom?public_key=0123456789aBcdEF0123456789abCDEF0123456789ABCdef0123456789ABCDEF"
)!!
val (base6, room6, pk6) = Conversation.Community.parseFullUrl(
val (base6, room6, pk6) = BaseCommunityInfo.parseFullUrl(
"HTTP://EXAMPLE.com:80/r/" +
"someroom?public_key=0123456789aBcdEF0123456789abCDEF0123456789ABCdef0123456789ABCDEF"
)!!
val (base7, room7, pk7) = Conversation.Community.parseFullUrl(
val (base7, room7, pk7) = BaseCommunityInfo.parseFullUrl(
"http://example.com:80/r/" +
"someroom?public_key=ASNFZ4mrze8BI0VniavN7wEjRWeJq83vASNFZ4mrze8"
)!!
val (base8, room8, pk8) = Conversation.Community.parseFullUrl(
val (base8, room8, pk8) = BaseCommunityInfo.parseFullUrl(
"http://example.com:80/r/" +
"someroom?public_key=yrtwk3hjixg66yjdeiuauk6p7hy1gtm8tgih55abrpnsxnpm3zzo"
)!!

View File

@ -14,6 +14,8 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_BUILD_TYPE Debug)
# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds them for you.

View File

@ -30,7 +30,7 @@ JNIEXPORT void JNICALL
Java_network_loki_messenger_libsession_1util_Contacts_set(JNIEnv *env, jobject thiz,
jobject contact) {
auto contacts = ptrToContacts(env, thiz);
auto contact_info = deserialize_contact(env, contact);
auto contact_info = deserialize_contact(env, contact, contacts);
contacts->set(contact_info);
}

View File

@ -27,7 +27,7 @@ inline jobject serialize_contact(JNIEnv *env, session::config::contact_info info
return returnObj;
}
inline session::config::contact_info deserialize_contact(JNIEnv *env, jobject info) {
inline session::config::contact_info deserialize_contact(JNIEnv *env, jobject info, session::config::Contacts *conf) {
jclass contactClass = env->FindClass("network/loki/messenger/libsession_util/util/Contact");
jfieldID getId, getName, getNick, getApproved, getApprovedMe, getBlocked, getUserPic, getPriority;
@ -66,7 +66,7 @@ inline session::config::contact_info deserialize_contact(JNIEnv *env, jobject in
auto name_bytes = name ? env->GetStringUTFChars(name, nullptr) : nullptr;
auto nickname_bytes = nickname ? env->GetStringUTFChars(nickname, nullptr) : nullptr;
auto contact_info = session::config::contact_info(session_id_bytes);
auto contact_info = conf->get_or_construct(session_id_bytes);
if (name_bytes) {
contact_info.name = name_bytes;
}
@ -78,6 +78,8 @@ inline session::config::contact_info deserialize_contact(JNIEnv *env, jobject in
contact_info.blocked = blocked;
if (!url.empty() && !key.empty()) {
contact_info.profile_picture = session::config::profile_pic(url, key);
} else {
contact_info.profile_picture = session::config::profile_pic();
}
env->ReleaseStringUTFChars(session_id, session_id_bytes);

View File

@ -102,13 +102,13 @@ Java_network_loki_messenger_libsession_1util_ConversationVolatileConfig_set(JNIE
jclass to_store_class = env->GetObjectClass(to_store);
if (env->IsSameObject(to_store_class, one_to_one)) {
// store as 1to1
convos->set(deserialize_one_to_one(env, to_store));
convos->set(deserialize_one_to_one(env, to_store, convos));
} else if (env->IsSameObject(to_store_class,open_group)) {
// store as open_group
convos->set(deserialize_community(env, to_store));
convos->set(deserialize_community(env, to_store, convos));
} else if (env->IsSameObject(to_store_class,legacy_closed_group)) {
// store as legacy_closed_group
convos->set(deserialize_legacy_closed_group(env, to_store));
convos->set(deserialize_legacy_closed_group(env, to_store, convos));
}
}
extern "C"
@ -194,7 +194,7 @@ Java_network_loki_messenger_libsession_1util_ConversationVolatileConfig_eraseCom
jobject thiz,
jobject open_group) {
auto convos = ptrToConvoInfo(env, thiz);
auto deserialized = deserialize_community(env, open_group);
auto deserialized = deserialize_community(env, open_group, convos);
return convos->erase(deserialized);
}
extern "C"
@ -249,7 +249,7 @@ Java_network_loki_messenger_libsession_1util_ConversationVolatileConfig_erase(JN
jobject thiz,
jobject conversation) {
auto convos = ptrToConvoInfo(env, thiz);
auto deserialized = deserialize_any(env, conversation);
auto deserialized = deserialize_any(env, conversation, convos);
if (!deserialized.has_value()) return false;
return convos->erase(*deserialized);
}

View File

@ -53,7 +53,7 @@ inline jobject serialize_any(JNIEnv *env, session::config::convo::any any) {
return nullptr;
}
inline session::config::convo::one_to_one deserialize_one_to_one(JNIEnv *env, jobject info) {
inline session::config::convo::one_to_one deserialize_one_to_one(JNIEnv *env, jobject info, session::config::ConvoInfoVolatile *conf) {
auto clazz = env->FindClass("network/loki/messenger/libsession_util/util/Conversation$OneToOne");
auto id_getter = env->GetFieldID(clazz, "sessionId", "Ljava/lang/String;");
auto last_read_getter = env->GetFieldID(clazz, "lastRead", "J");
@ -61,14 +61,14 @@ inline session::config::convo::one_to_one deserialize_one_to_one(JNIEnv *env, jo
jstring id = static_cast<jstring>(env->GetObjectField(info, id_getter));
auto id_chars = env->GetStringUTFChars(id, nullptr);
std::string id_string = std::string{id_chars};
auto deserialized = session::config::convo::one_to_one{id_string};
auto deserialized = conf->get_or_construct_1to1(id_string);
deserialized.last_read = env->GetLongField(info, last_read_getter);
deserialized.unread = env->GetBooleanField(info, unread_getter);
env->ReleaseStringUTFChars(id, id_chars);
return deserialized;
}
inline session::config::convo::community deserialize_community(JNIEnv *env, jobject info) {
inline session::config::convo::community deserialize_community(JNIEnv *env, jobject info, session::config::ConvoInfoVolatile *conf) {
auto clazz = env->FindClass("network/loki/messenger/libsession_util/util/Conversation$Community");
auto base_community_getter = env->GetFieldID(clazz, "baseCommunityInfo", "Lnetwork/loki/messenger/libsession_util/util/BaseCommunityInfo;");
auto last_read_getter = env->GetFieldID(clazz, "lastRead", "J");
@ -77,11 +77,11 @@ inline session::config::convo::community deserialize_community(JNIEnv *env, jobj
auto base_community_info = env->GetObjectField(info, base_community_getter);
auto base_community_deserialized = util::deserialize_base_community(env, base_community_info);
auto deserialized = session::config::convo::community{
auto deserialized = conf->get_or_construct_community(
base_community_deserialized.base_url(),
base_community_deserialized.room(),
base_community_deserialized.pubkey()
};
);
deserialized.last_read = env->GetLongField(info, last_read_getter);
deserialized.unread = env->GetBooleanField(info, unread_getter);
@ -89,7 +89,7 @@ inline session::config::convo::community deserialize_community(JNIEnv *env, jobj
return deserialized;
}
inline session::config::convo::legacy_group deserialize_legacy_closed_group(JNIEnv *env, jobject info) {
inline session::config::convo::legacy_group deserialize_legacy_closed_group(JNIEnv *env, jobject info, session::config::ConvoInfoVolatile *conf) {
auto clazz = env->FindClass("network/loki/messenger/libsession_util/util/Conversation$LegacyGroup");
auto group_id_getter = env->GetFieldID(clazz, "groupId", "Ljava/lang/String;");
auto last_read_getter = env->GetFieldID(clazz, "lastRead", "J");
@ -97,24 +97,24 @@ inline session::config::convo::legacy_group deserialize_legacy_closed_group(JNIE
auto group_id = static_cast<jstring>(env->GetObjectField(info, group_id_getter));
auto group_id_bytes = env->GetStringUTFChars(group_id, nullptr);
auto group_id_string = std::string{group_id_bytes};
auto deserialized = session::config::convo::legacy_group(group_id_string);
auto deserialized = conf->get_or_construct_legacy_group(group_id_string);
deserialized.last_read = env->GetLongField(info, last_read_getter);
deserialized.unread = env->GetBooleanField(info, unread_getter);
env->ReleaseStringUTFChars(group_id, group_id_bytes);
return deserialized;
}
inline std::optional<session::config::convo::any> deserialize_any(JNIEnv *env, jobject convo) {
inline std::optional<session::config::convo::any> deserialize_any(JNIEnv *env, jobject convo, session::config::ConvoInfoVolatile *conf) {
auto oto_class = env->FindClass("network/loki/messenger/libsession_util/util/Conversation$OneToOne");
auto og_class = env->FindClass("network/loki/messenger/libsession_util/util/Conversation$Community");
auto lgc_class = env->FindClass("network/loki/messenger/libsession_util/util/Conversation$LegacyGroup");
auto object_class = env->GetObjectClass(convo);
if (env->IsSameObject(object_class, oto_class)) {
return session::config::convo::any{deserialize_one_to_one(env, convo)};
return session::config::convo::any{deserialize_one_to_one(env, convo, conf)};
} else if (env->IsSameObject(object_class, og_class)) {
return session::config::convo::any{deserialize_community(env, convo)};
return session::config::convo::any{deserialize_community(env, convo, conf)};
} else if (env->IsSameObject(object_class, lgc_class)) {
return session::config::convo::any{deserialize_legacy_closed_group(env, convo)};
return session::config::convo::any{deserialize_legacy_closed_group(env, convo, conf)};
}
return std::nullopt;
}

View File

@ -118,10 +118,10 @@ Java_network_loki_messenger_libsession_1util_UserGroupsConfig_set__Lnetwork_loki
auto communityInfo = env->FindClass("network/loki/messenger/libsession_util/util/GroupInfo$CommunityGroupInfo");
auto legacyInfo = env->FindClass("network/loki/messenger/libsession_util/util/GroupInfo$LegacyGroupInfo");
if (env->GetObjectClass(group_info) == communityInfo) {
auto deserialized = deserialize_community_info(env, group_info);
auto deserialized = deserialize_community_info(env, group_info, conf);
conf->set(deserialized);
} else if (env->GetObjectClass(group_info) == legacyInfo) {
auto deserialized = deserialize_legacy_group_info(env, group_info);
auto deserialized = deserialize_legacy_group_info(env, group_info, conf);
conf->set(deserialized);
}
}
@ -131,7 +131,7 @@ JNIEXPORT void JNICALL
Java_network_loki_messenger_libsession_1util_UserGroupsConfig_set__Lnetwork_loki_messenger_libsession_1util_util_GroupInfo_CommunityGroupInfo_2(
JNIEnv *env, jobject thiz, jobject community_info) {
auto conf = ptrToUserGroups(env, thiz);
auto deserialized = deserialize_community_info(env, community_info);
auto deserialized = deserialize_community_info(env, community_info, conf);
conf->set(deserialized);
}
@ -140,7 +140,7 @@ JNIEXPORT void JNICALL
Java_network_loki_messenger_libsession_1util_UserGroupsConfig_set__Lnetwork_loki_messenger_libsession_1util_util_GroupInfo_LegacyGroupInfo_2(
JNIEnv *env, jobject thiz, jobject legacy_group_info) {
auto conf = ptrToUserGroups(env, thiz);
auto deserialized = deserialize_legacy_group_info(env, legacy_group_info);
auto deserialized = deserialize_legacy_group_info(env, legacy_group_info, conf);
conf->set(deserialized);
}
#pragma clang diagnostic pop
@ -149,7 +149,7 @@ JNIEXPORT void JNICALL
Java_network_loki_messenger_libsession_1util_UserGroupsConfig_erase__Lnetwork_loki_messenger_libsession_1util_util_GroupInfo_CommunityGroupInfo_2(
JNIEnv *env, jobject thiz, jobject community_info) {
auto conf = ptrToUserGroups(env, thiz);
auto deserialized = deserialize_community_info(env, community_info);
auto deserialized = deserialize_community_info(env, community_info, conf);
conf->erase(deserialized);
}
@ -158,7 +158,7 @@ JNIEXPORT void JNICALL
Java_network_loki_messenger_libsession_1util_UserGroupsConfig_erase__Lnetwork_loki_messenger_libsession_1util_util_GroupInfo_LegacyGroupInfo_2(
JNIEnv *env, jobject thiz, jobject legacy_group_info) {
auto conf = ptrToUserGroups(env, thiz);
auto deserialized = deserialize_legacy_group_info(env, legacy_group_info);
auto deserialized = deserialize_legacy_group_info(env, legacy_group_info, conf);
conf->erase(deserialized);
}

View File

@ -1,3 +1,4 @@
#ifndef SESSION_ANDROID_USER_GROUPS_H
#define SESSION_ANDROID_USER_GROUPS_H
@ -41,7 +42,7 @@ inline void deserialize_members_into(JNIEnv *env, jobject members_map, session::
}
}
inline session::config::legacy_group_info deserialize_legacy_group_info(JNIEnv *env, jobject info) {
inline session::config::legacy_group_info deserialize_legacy_group_info(JNIEnv *env, jobject info, session::config::UserGroups* conf) {
auto clazz = env->FindClass("network/loki/messenger/libsession_util/util/GroupInfo$LegacyGroupInfo");
auto id_field = env->GetFieldID(clazz, "sessionId", "Ljava/lang/String;");
auto name_field = env->GetFieldID(clazz, "name", "Ljava/lang/String;");
@ -63,7 +64,7 @@ inline session::config::legacy_group_info deserialize_legacy_group_info(JNIEnv *
auto enc_pub_key_bytes = util::ustring_from_bytes(env, enc_pub_key);
auto enc_sec_key_bytes = util::ustring_from_bytes(env, enc_sec_key);
auto info_deserialized = session::config::legacy_group_info(id_bytes);
auto info_deserialized = conf->get_or_construct_legacy_group(id_bytes);
info_deserialized.priority = priority;
deserialize_members_into(env, members_map, info_deserialized);
@ -71,19 +72,21 @@ inline session::config::legacy_group_info deserialize_legacy_group_info(JNIEnv *
info_deserialized.hidden = hidden;
info_deserialized.enc_pubkey = enc_pub_key_bytes;
info_deserialized.enc_seckey = enc_sec_key_bytes;
// TODO: this
// info_deserialized.disappearing_timer
env->ReleaseStringUTFChars(id, id_bytes);
env->ReleaseStringUTFChars(name, name_bytes);
return info_deserialized;
}
inline session::config::community_info deserialize_community_info(JNIEnv *env, jobject info) {
inline session::config::community_info deserialize_community_info(JNIEnv *env, jobject info, session::config::UserGroups* conf) {
auto clazz = env->FindClass("network/loki/messenger/libsession_util/util/GroupInfo$CommunityGroupInfo");
auto base_info = env->GetFieldID(clazz, "community", "Lnetwork/loki/messenger/libsession_util/util/BaseCommunityInfo;");
auto priority = env->GetFieldID(clazz, "priority", "I");
jobject base_community_info = env->GetObjectField(info, base_info);
auto deserialized_base_info = util::deserialize_base_community(env, base_community_info);
int deserialized_priority = env->GetIntField(info, priority);
auto community_info = session::config::community_info(deserialized_base_info.base_url(), deserialized_base_info.room(), deserialized_base_info.pubkey_hex());
auto community_info = conf->get_or_construct_community(deserialized_base_info.base_url(), deserialized_base_info.room(), deserialized_base_info.pubkey_hex());
community_info.priority = deserialized_priority;
return community_info;
}

View File

@ -15,14 +15,7 @@ sealed class Conversation {
val baseCommunityInfo: BaseCommunityInfo,
override var lastRead: Long,
override var unread: Boolean
) : Conversation() {
companion object {
init {
System.loadLibrary("session_util")
}
external fun parseFullUrl(fullUrl: String): Triple<String, String, ByteArray>?
}
}
) : Conversation()
data class LegacyGroup(
val groupId: String,