mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-12 04:07:43 +00:00
fix: no duplicate group left messages, more efficient closed group polling
This commit is contained in:
@@ -372,6 +372,10 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
||||
DatabaseFactory.getGroupDatabase(context).create(groupId, title, members, avatar, relay, admins, formationTimestamp)
|
||||
}
|
||||
|
||||
override fun isGroupActive(groupPublicKey: String): Boolean {
|
||||
return DatabaseFactory.getGroupDatabase(context).getGroup(GroupUtil.doubleEncodeGroupID(groupPublicKey)).orNull()?.isActive == true
|
||||
}
|
||||
|
||||
override fun setActive(groupID: String, value: Boolean) {
|
||||
DatabaseFactory.getGroupDatabase(context).setActive(groupID, value)
|
||||
}
|
||||
@@ -433,6 +437,12 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
||||
return DatabaseFactory.getLokiAPIDatabase(context).getAllClosedGroupPublicKeys()
|
||||
}
|
||||
|
||||
override fun getAllActiveClosedGroupPublicKeys(): Set<String> {
|
||||
return DatabaseFactory.getLokiAPIDatabase(context).getAllClosedGroupPublicKeys().filter {
|
||||
getGroup(GroupUtil.doubleEncodeGroupID(it))?.isActive == true
|
||||
}.toSet()
|
||||
}
|
||||
|
||||
override fun addClosedGroupPublicKey(groupPublicKey: String) {
|
||||
DatabaseFactory.getLokiAPIDatabase(context).addClosedGroupPublicKey(groupPublicKey)
|
||||
}
|
||||
|
Reference in New Issue
Block a user