mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 02:55:23 +00:00
fix: new community doesn't break persisting config if the .add request fails
This commit is contained in:
parent
f19be7d6ab
commit
05f8dc6d43
@ -551,8 +551,12 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
|
||||
val groupBaseCommunity = groupInfo.community
|
||||
if (groupBaseCommunity.fullUrl() !in existingJoinUrls) {
|
||||
// add it
|
||||
try {
|
||||
val (threadId, _) = OpenGroupManager.add(groupBaseCommunity.baseUrl, groupBaseCommunity.room, groupBaseCommunity.pubKeyHex, context)
|
||||
threadDb.setPinned(threadId, groupInfo.priority == PRIORITY_PINNED)
|
||||
} catch (e: Exception) {
|
||||
Log.e("Loki", "Failed to get Open Group Info on syncing config",e)
|
||||
}
|
||||
} else {
|
||||
val (threadId, _) = existingCommunities.entries.first { (_, v) -> v.joinURL == groupInfo.community.fullUrl() }
|
||||
threadDb.setPinned(threadId, groupInfo.priority == PRIORITY_PINNED)
|
||||
|
Loading…
Reference in New Issue
Block a user