mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 18:30:20 +01:00
Update chat folder settings display.
This commit is contained in:
committed by
Greyson Parrelli
parent
c291d84738
commit
9e955e94d9
@@ -4,6 +4,7 @@ import android.content.ContentValues
|
||||
import android.content.Context
|
||||
import androidx.core.content.contentValuesOf
|
||||
import org.signal.core.util.SqlUtil
|
||||
import org.signal.core.util.count
|
||||
import org.signal.core.util.delete
|
||||
import org.signal.core.util.groupBy
|
||||
import org.signal.core.util.insertInto
|
||||
@@ -232,6 +233,18 @@ class ChatFolderTables(context: Context?, databaseHelper: SignalDatabase?) : Dat
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of user-made folders
|
||||
*/
|
||||
fun getFolderCount(): Int {
|
||||
return readableDatabase
|
||||
.count()
|
||||
.from(ChatFolderTable.TABLE_NAME)
|
||||
.where("${ChatFolderTable.FOLDER_TYPE} != ${ChatFolderRecord.FolderType.ALL.value}")
|
||||
.run()
|
||||
.readToSingleInt()
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a chat folder and its corresponding included/excluded chats
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user