mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-17 22:57:11 +02:00
fix: hide "All chats" folder
Co-authored-by: c0re100 <corehusky@gmail.com>
This commit is contained in:
parent
8f01baa9d1
commit
ef54775afa
3 changed files with 29 additions and 2 deletions
|
@ -62,6 +62,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "styles/style_info.h"
|
||||
#include "styles/style_menu_icons.h"
|
||||
|
||||
// AyuGram includes
|
||||
#include "ayu/ayu_settings.h"
|
||||
#include "data/data_chat_filters.h"
|
||||
|
||||
|
||||
namespace HistoryView {
|
||||
namespace {
|
||||
|
||||
|
@ -703,7 +708,14 @@ void TopBarWidget::infoClicked() {
|
|||
|
||||
void TopBarWidget::backClicked() {
|
||||
if (_activeChat.key.folder()) {
|
||||
_controller->closeFolder();
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
if (settings->hideAllChatsFolder) {
|
||||
const auto filters = &_controller->session().data().chatsFilters();
|
||||
const auto lookup_id = filters->lookupId(_controller->session().premium() ? 0 : 1);
|
||||
_controller->setActiveChatsFilter(lookup_id);
|
||||
} else {
|
||||
_controller->closeFolder();
|
||||
}
|
||||
} else if (_activeChat.section == Section::ChatsList
|
||||
&& _activeChat.key.history()
|
||||
&& _activeChat.key.history()->isForum()) {
|
||||
|
|
|
@ -249,6 +249,12 @@ void FiltersMenu::refresh() {
|
|||
// After the filters are refreshed, the scroll is reset,
|
||||
// so we have to restore it.
|
||||
_scroll.scrollToY(oldTop);
|
||||
|
||||
// Fix active chat folder when hide all chats is enabled.
|
||||
if (settings->hideAllChatsFolder) {
|
||||
const auto lookup_id = filters->lookupId(premium() ? 0 : 1);
|
||||
_session->setActiveChatsFilter(lookup_id);
|
||||
}
|
||||
}
|
||||
|
||||
void FiltersMenu::setupList() {
|
||||
|
|
|
@ -90,6 +90,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "styles/style_dialogs.h"
|
||||
#include "styles/style_layers.h" // st::boxLabel
|
||||
|
||||
// AyuGram includes
|
||||
#include "ayu/ayu_settings.h"
|
||||
|
||||
|
||||
namespace Window {
|
||||
namespace {
|
||||
|
||||
|
@ -1145,7 +1149,12 @@ void SessionController::activateFirstChatsFilter() {
|
|||
return;
|
||||
}
|
||||
_filtersActivated = true;
|
||||
setActiveChatsFilter(session().data().chatsFilters().defaultId());
|
||||
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
if (!settings->hideAllChatsFolder)
|
||||
{
|
||||
setActiveChatsFilter(session().data().chatsFilters().defaultId());
|
||||
}
|
||||
}
|
||||
|
||||
bool SessionController::uniqueChatsInSearchResults() const {
|
||||
|
|
Loading…
Add table
Reference in a new issue