2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Load chats in chunks in support mode.

This commit is contained in:
John Preston
2018-11-09 17:54:34 +04:00
parent 2d05281ba9
commit e992702783
6 changed files with 263 additions and 43 deletions

View File

@@ -83,6 +83,7 @@ QByteArray AuthSessionSettings::serialize() const {
stream << qint32(_variables.supportSwitch);
stream << qint32(_variables.supportFixChatsOrder ? 1 : 0);
stream << qint32(_variables.supportTemplatesAutocomplete ? 1 : 0);
stream << qint32(_variables.supportChatsTimeSlice.current());
}
return result;
}
@@ -113,6 +114,7 @@ void AuthSessionSettings::constructFromSerialized(const QByteArray &serialized)
qint32 supportSwitch = static_cast<qint32>(_variables.supportSwitch);
qint32 supportFixChatsOrder = _variables.supportFixChatsOrder ? 1 : 0;
qint32 supportTemplatesAutocomplete = _variables.supportTemplatesAutocomplete ? 1 : 0;
qint32 supportChatsTimeSlice = _variables.supportChatsTimeSlice.current();
stream >> selectorTab;
stream >> lastSeenWarningSeen;
@@ -176,6 +178,9 @@ void AuthSessionSettings::constructFromSerialized(const QByteArray &serialized)
if (!stream.atEnd()) {
stream >> supportTemplatesAutocomplete;
}
if (!stream.atEnd()) {
stream >> supportChatsTimeSlice;
}
if (stream.status() != QDataStream::Ok) {
LOG(("App Error: "
"Bad data for AuthSessionSettings::constructFromSerialized()"));
@@ -243,6 +248,19 @@ void AuthSessionSettings::constructFromSerialized(const QByteArray &serialized)
}
_variables.supportFixChatsOrder = (supportFixChatsOrder == 1);
_variables.supportTemplatesAutocomplete = (supportTemplatesAutocomplete == 1);
_variables.supportChatsTimeSlice = supportChatsTimeSlice;
}
void AuthSessionSettings::setSupportChatsTimeSlice(int slice) {
_variables.supportChatsTimeSlice = slice;
}
int AuthSessionSettings::supportChatsTimeSlice() const {
return _variables.supportChatsTimeSlice.current();
}
rpl::producer<int> AuthSessionSettings::supportChatsTimeSliceValue() const {
return _variables.supportChatsTimeSlice.value();
}
void AuthSessionSettings::setTabbedSelectorSectionEnabled(bool enabled) {