diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp index 1d74c0ef6..59edff71e 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -531,6 +531,9 @@ void InnerWidget::saveState(not_null memento) { void InnerWidget::restoreState(not_null memento) { _items = memento->takeItems(); + for (auto &item : _items) { + item.refreshView(this); + } _itemsByIds = memento->takeItemsByIds(); if (auto manager = memento->takeIdManager()) { _idManager = std::move(manager); diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp index 783ab111e..c45c08394 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -195,9 +195,9 @@ auto GenerateBannedChangeText(const TextWithEntities &user, const MTPChannelBann lt_date, langDateTime(ParseDateTime(newUntil))); auto result = lng_admin_log_restricted__generic( - lt_user, - user, - lt_until, + lt_user, + user, + lt_until, TextWithEntities { untilText }); static auto phraseMap = std::map { @@ -317,6 +317,11 @@ OwnedItem::~OwnedItem() { } } +void OwnedItem::refreshView( + not_null delegate) { + _view = _data->createView(delegate); +} + void GenerateItems( not_null delegate, not_null history, diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.h b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.h index 7f238be38..05cc07132 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.h +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.h @@ -46,6 +46,8 @@ public: return get(); } + void refreshView(not_null delegate); + private: HistoryItem *_data = nullptr; std::unique_ptr _view;