mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Fix chat folder to not show mute option if there isn't any chat.
This commit is contained in:
committed by
Cody Henthorne
parent
cf0dfdceb1
commit
a66031cfce
@@ -19,6 +19,7 @@ object ChatFolderContextMenu {
|
||||
rootView: ViewGroup = anchorView.rootView as ViewGroup,
|
||||
folderType: ChatFolderRecord.FolderType,
|
||||
unreadCount: Int,
|
||||
isEmpty: Boolean,
|
||||
isMuted: Boolean,
|
||||
onEdit: () -> Unit = {},
|
||||
onMuteAll: () -> Unit = {},
|
||||
@@ -32,6 +33,7 @@ object ChatFolderContextMenu {
|
||||
rootView = rootView,
|
||||
folderType = folderType,
|
||||
unreadCount = unreadCount,
|
||||
isEmpty = isEmpty,
|
||||
isMuted = isMuted,
|
||||
callbacks = object : Callbacks {
|
||||
override fun onEdit() = onEdit()
|
||||
@@ -48,6 +50,7 @@ object ChatFolderContextMenu {
|
||||
anchorView: View,
|
||||
rootView: ViewGroup,
|
||||
unreadCount: Int,
|
||||
isEmpty: Boolean,
|
||||
isMuted: Boolean,
|
||||
folderType: ChatFolderRecord.FolderType,
|
||||
callbacks: Callbacks
|
||||
@@ -61,13 +64,13 @@ object ChatFolderContextMenu {
|
||||
)
|
||||
}
|
||||
|
||||
if (isMuted) {
|
||||
if (isMuted && !isEmpty) {
|
||||
add(
|
||||
ActionItem(R.drawable.symbol_bell_24, context.getString(R.string.ChatFoldersFragment__unmute_all)) {
|
||||
callbacks.onUnmuteAll()
|
||||
}
|
||||
)
|
||||
} else {
|
||||
} else if (!isEmpty) {
|
||||
add(
|
||||
ActionItem(R.drawable.symbol_bell_slash_24, context.getString(R.string.ChatFoldersFragment__mute_all)) {
|
||||
callbacks.onMuteAll()
|
||||
|
||||
@@ -13,8 +13,8 @@ object ChatFoldersRepository {
|
||||
return SignalDatabase.chatFolders.getCurrentChatFolders()
|
||||
}
|
||||
|
||||
fun getUnreadCountAndMutedStatusForFolders(folders: List<ChatFolderRecord>): HashMap<Long, Pair<Int, Boolean>> {
|
||||
return SignalDatabase.chatFolders.getUnreadCountAndMutedStatusForFolders(folders)
|
||||
fun getUnreadCountAndEmptyAndMutedStatusForFolders(folders: List<ChatFolderRecord>): HashMap<Long, Triple<Int, Boolean, Boolean>> {
|
||||
return SignalDatabase.chatFolders.getUnreadCountAndEmptyAndMutedStatusForFolders(folders)
|
||||
}
|
||||
|
||||
fun createFolder(folder: ChatFolderRecord, includedRecipients: Set<Recipient>, excludedRecipients: Set<Recipient>) {
|
||||
|
||||
Reference in New Issue
Block a user