2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Save self to local storage map.

This commit is contained in:
John Preston
2018-09-11 17:36:09 +03:00
parent 0c8709ca5f
commit 34665cd6da
9 changed files with 313 additions and 218 deletions

View File

@@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/section_widget.h"
#include "chat_helpers/tabbed_selector.h"
#include "boxes/send_files_box.h"
#include "observer_peer.h"
namespace {
@@ -296,6 +297,24 @@ AuthSession::AuthSession(const MTPUser &user)
_api->requestTermsUpdate();
_api->requestFullPeer(_user);
crl::on_main(this, [=] {
using Flag = Notify::PeerUpdate::Flag;
const auto events = Flag::NameChanged
| Flag::UsernameChanged
| Flag::PhotoChanged
| Flag::AboutChanged
| Flag::UserPhoneChanged;
subscribe(
Notify::PeerUpdated(),
Notify::PeerUpdatedHandler(
events,
[=](const Notify::PeerUpdate &update) {
if (update.peer == _user) {
Local::writeSelf();
}
}));
});
Window::Theme::Background()->start();
}