Keep separate MTP::Config's for separate accounts.

This commit is contained in:
John Preston
2020-06-17 13:36:25 +04:00
parent 63cdda2df7
commit 357caf8007
142 changed files with 1901 additions and 1263 deletions
+2 -13
View File
@@ -20,9 +20,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "main/main_account.h"
//#include "storage/storage_feed_messages.h" // #feed
#include "main/main_session.h"
#include "mtproto/mtproto_config.h"
#include "apiwrap.h"
#include "mainwidget.h"
#include "facades.h"
#include "styles/style_dialogs.h"
namespace Data {
@@ -31,17 +31,6 @@ namespace {
constexpr auto kLoadedChatsMinCount = 20;
constexpr auto kShowChatNamesCount = 8;
rpl::producer<int> PinnedDialogsInFolderMaxValue(
not_null<Main::Session*> session) {
return rpl::single(
rpl::empty_value()
) | rpl::then(
session->account().configUpdates()
) | rpl::map([=] {
return Global::PinnedDialogsInFolderMax();
});
}
} // namespace
// #feed
@@ -60,7 +49,7 @@ Folder::Folder(not_null<Data::Session*> owner, FolderId id)
, _chatsList(
&owner->session(),
FilterId(),
PinnedDialogsInFolderMaxValue(&owner->session()))
owner->session().serverConfig().pinnedDialogsInFolderMax.value())
, _name(tr::lng_archived_name(tr::now)) {
indexNameParts();