mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-28 16:29:53 +00:00
Allow collapsing archive in the chats list.
This commit is contained in:
@@ -93,6 +93,7 @@ QByteArray AuthSessionSettings::serialize() const {
|
||||
stream << qint32(_variables.exeLaunchWarning ? 1 : 0);
|
||||
stream << autoDownload;
|
||||
stream << qint32(_variables.supportAllSearchResults.current() ? 1 : 0);
|
||||
stream << qint32(_variables.archiveCollapsed.current() ? 1 : 0);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -129,6 +130,7 @@ void AuthSessionSettings::constructFromSerialized(const QByteArray &serialized)
|
||||
qint32 exeLaunchWarning = _variables.exeLaunchWarning ? 1 : 0;
|
||||
QByteArray autoDownload;
|
||||
qint32 supportAllSearchResults = _variables.supportAllSearchResults.current() ? 1 : 0;
|
||||
qint32 archiveCollapsed = _variables.archiveCollapsed.current() ? 1 : 0;
|
||||
|
||||
stream >> selectorTab;
|
||||
stream >> lastSeenWarningSeen;
|
||||
@@ -208,6 +210,9 @@ void AuthSessionSettings::constructFromSerialized(const QByteArray &serialized)
|
||||
if (!stream.atEnd()) {
|
||||
stream >> supportAllSearchResults;
|
||||
}
|
||||
if (!stream.atEnd()) {
|
||||
stream >> archiveCollapsed;
|
||||
}
|
||||
if (stream.status() != QDataStream::Ok) {
|
||||
LOG(("App Error: "
|
||||
"Bad data for AuthSessionSettings::constructFromSerialized()"));
|
||||
@@ -277,6 +282,7 @@ void AuthSessionSettings::constructFromSerialized(const QByteArray &serialized)
|
||||
_variables.countUnreadMessages = (countUnreadMessages == 1);
|
||||
_variables.exeLaunchWarning = (exeLaunchWarning == 1);
|
||||
_variables.supportAllSearchResults = (supportAllSearchResults == 1);
|
||||
_variables.archiveCollapsed = (archiveCollapsed == 1);
|
||||
}
|
||||
|
||||
void AuthSessionSettings::setSupportChatsTimeSlice(int slice) {
|
||||
@@ -371,8 +377,20 @@ rpl::producer<int> AuthSessionSettings::thirdColumnWidthChanges() const {
|
||||
return _variables.thirdColumnWidth.changes();
|
||||
}
|
||||
|
||||
void AuthSessionSettings::setArchiveCollapsed(bool collapsed) {
|
||||
_variables.archiveCollapsed = collapsed;
|
||||
}
|
||||
|
||||
bool AuthSessionSettings::archiveCollapsed() const {
|
||||
return _variables.archiveCollapsed.current();
|
||||
}
|
||||
|
||||
rpl::producer<bool> AuthSessionSettings::archiveCollapsedChanges() const {
|
||||
return _variables.archiveCollapsed.changes();
|
||||
}
|
||||
|
||||
AuthSession &Auth() {
|
||||
auto result = Core::App().authSession();
|
||||
const auto result = Core::App().authSession();
|
||||
Assert(result != nullptr);
|
||||
return *result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user