mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Ensure default chat folder exists.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package org.thoughtcrime.securesms.logsubmit
|
||||
|
||||
import android.content.Context
|
||||
import org.thoughtcrime.securesms.components.settings.app.chats.folders.ChatFolderRecord
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
|
||||
/**
|
||||
* Prints out chat folders settings
|
||||
*/
|
||||
class LogSectionChatFolders : LogSection {
|
||||
override fun getTitle(): String = "CHAT FOLDERS"
|
||||
|
||||
override fun getContent(context: Context): CharSequence {
|
||||
val output = StringBuilder()
|
||||
|
||||
if (Recipient.isSelfSet) {
|
||||
val count = SignalDatabase.chatFolders.getFolderCount()
|
||||
val hasDefault = SignalDatabase.chatFolders.getCurrentChatFolders().any { folder -> folder.folderType == ChatFolderRecord.FolderType.ALL }
|
||||
output.append("Has default all chats : ${hasDefault}\n")
|
||||
output.append("Number of folders (undeleted) : ${count}\n")
|
||||
} else {
|
||||
output.append("< Self is not set yet >\n")
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
}
|
||||
@@ -88,6 +88,7 @@ public class SubmitDebugLogRepository {
|
||||
add(new LogSectionKeyPreferences());
|
||||
add(new LogSectionStories());
|
||||
add(new LogSectionBadges());
|
||||
add(new LogSectionChatFolders());
|
||||
add(new LogSectionRemoteBackups());
|
||||
add(new LogSectionPermissions());
|
||||
add(new LogSectionTrace());
|
||||
|
||||
Reference in New Issue
Block a user