2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Move non-settings session data to Data::Session.

Rename AuthSessionData to AuthSessionSettings, move data away.
This commit is contained in:
John Preston
2018-01-04 13:22:53 +03:00
parent 724fe65d72
commit 6a9556d42c
51 changed files with 574 additions and 481 deletions

View File

@@ -1433,7 +1433,7 @@ void SendFilesBox::initSendWay() {
? SendFilesWay::Album
: SendFilesWay::Photos;
}
const auto currentWay = Auth().data().sendFilesWay();
const auto currentWay = Auth().settings().sendFilesWay();
if (currentWay == SendFilesWay::Files) {
return currentWay;
} else if (currentWay == SendFilesWay::Album) {
@@ -1756,7 +1756,7 @@ void SendFilesBox::send(bool ctrlShiftEnter) {
const auto way = _sendWay ? _sendWay->value() : Way::Files;
if (_compressConfirm == CompressConfirm::Auto) {
const auto oldWay = Auth().data().sendFilesWay();
const auto oldWay = Auth().settings().sendFilesWay();
if (way != oldWay) {
// Check if the user _could_ use the old value, but didn't.
if ((oldWay == Way::Album && _sendAlbum)
@@ -1764,8 +1764,8 @@ void SendFilesBox::send(bool ctrlShiftEnter) {
|| (oldWay == Way::Files && _sendFiles)
|| (way == Way::Files && (_sendAlbum || _sendPhotos))) {
// And in that case save it to settings.
Auth().data().setSendFilesWay(way);
Auth().saveDataDelayed();
Auth().settings().setSendFilesWay(way);
Auth().saveSettingsDelayed();
}
}
}