mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 15:05:56 +00:00
Fixed open of locked chats filter with shortcuts to open near filters.
This commit is contained in:
@@ -49,6 +49,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
#include "data/data_chat_filters.h"
|
#include "data/data_chat_filters.h"
|
||||||
#include "data/data_replies_list.h"
|
#include "data/data_replies_list.h"
|
||||||
#include "data/data_peer_values.h"
|
#include "data/data_peer_values.h"
|
||||||
|
#include "data/data_premium_limits.h"
|
||||||
#include "data/data_web_page.h"
|
#include "data/data_web_page.h"
|
||||||
#include "passport/passport_form_controller.h"
|
#include "passport/passport_form_controller.h"
|
||||||
#include "chat_helpers/tabbed_selector.h"
|
#include "chat_helpers/tabbed_selector.h"
|
||||||
@@ -3249,7 +3250,8 @@ bool CheckAndJumpToNearChatsFilter(
|
|||||||
bool isNext,
|
bool isNext,
|
||||||
bool jump) {
|
bool jump) {
|
||||||
const auto id = controller->activeChatsFilterCurrent();
|
const auto id = controller->activeChatsFilterCurrent();
|
||||||
const auto list = &controller->session().data().chatsFilters().list();
|
const auto session = &controller->session();
|
||||||
|
const auto list = &session->data().chatsFilters().list();
|
||||||
const auto index = int(ranges::find(
|
const auto index = int(ranges::find(
|
||||||
*list,
|
*list,
|
||||||
id,
|
id,
|
||||||
@@ -3262,6 +3264,9 @@ bool CheckAndJumpToNearChatsFilter(
|
|||||||
if (changed >= int(list->size()) || changed < 0) {
|
if (changed >= int(list->size()) || changed < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (changed > Data::PremiumLimits(session).dialogFiltersCurrent()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (jump) {
|
if (jump) {
|
||||||
controller->setActiveChatsFilter((changed >= 0)
|
controller->setActiveChatsFilter((changed >= 0)
|
||||||
? (*list)[changed].id()
|
? (*list)[changed].id()
|
||||||
|
Reference in New Issue
Block a user