fix: unnamed open groups being processed by creating new threads after deletion

job db not marking successful/unsuccessful properly

handling send and receive better / in order
This commit is contained in:
jubb
2021-05-12 16:48:18 +10:00
parent 84fa3dfc86
commit edc1454609
5 changed files with 55 additions and 29 deletions

View File

@@ -581,7 +581,7 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
val database = DatabaseFactory.getThreadDatabase(context)
if (!openGroupID.isNullOrEmpty()) {
val recipient = Recipient.from(context, Address.fromSerialized(GroupUtil.getEncodedOpenGroupID(openGroupID.toByteArray())), false)
return database.getOrCreateThreadIdFor(recipient)
return database.getThreadIdIfExistsFor(recipient)
} else if (!groupPublicKey.isNullOrEmpty()) {
val recipient = Recipient.from(context, Address.fromSerialized(GroupUtil.doubleEncodeGroupID(groupPublicKey)), false)
return database.getOrCreateThreadIdFor(recipient)