2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Add chat name / account name / unread count title settings.

This commit is contained in:
John Preston
2023-02-03 17:51:26 +04:00
parent eb64ffcd86
commit 94b489835c
13 changed files with 233 additions and 34 deletions

View File

@@ -745,10 +745,23 @@ SessionController::SessionController(
}
}, _lifetime);
_authedName = session->user()->name();
session->changes().peerUpdates(
Data::PeerUpdate::Flag::FullInfo
| Data::PeerUpdate::Flag::Name
) | rpl::filter([=](const Data::PeerUpdate &update) {
return (update.peer == _showEditPeer);
if (update.flags & Data::PeerUpdate::Flag::Name) {
const auto user = session->user();
if (update.peer == user) {
_authedName = user->name();
const auto &settings = Core::App().settings();
if (!settings.windowTitleContent().hideAccountName) {
widget()->updateTitle();
}
}
}
return (update.flags & Data::PeerUpdate::Flag::FullInfo)
&& (update.peer == _showEditPeer);
}) | rpl::start_with_next([=] {
show(Box<EditPeerInfoBox>(this, base::take(_showEditPeer)));
}, lifetime());