File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -714,8 +714,9 @@ void ContactStatus::setupShareHandler(not_null<UserData*> user) {
714714
715715void ContactStatus::setupUnarchiveHandler (not_null<PeerData*> peer) {
716716 _inner->unarchiveClicks (
717- ) | rpl::start_with_next ([=] {
718- Window::ToggleHistoryArchived (peer->owner ().history (peer), false );
717+ ) | rpl::start_with_next ([=, show = _controller->uiShow ()] {
718+ using namespace Window ;
719+ ToggleHistoryArchived (show, peer->owner ().history (peer), false );
719720 peer->owner ().notifySettings ().resetToDefault (peer);
720721 if (const auto settings = peer->settings ()) {
721722 const auto flags = PeerSetting::AutoArchived
Original file line number Diff line number Diff line change @@ -652,8 +652,8 @@ void Filler::addToggleArchive() {
652652 ? tr::lng_archived_remove (tr::now)
653653 : tr::lng_archived_add (tr::now);
654654 };
655- const auto toggle = [=] {
656- ToggleHistoryArchived (history, !isArchived ());
655+ const auto toggle = [=, show = _controller-> uiShow () ] {
656+ ToggleHistoryArchived (show, history, !isArchived ());
657657 };
658658 const auto archiveAction = _addAction (
659659 label (),
@@ -2406,9 +2406,12 @@ void MenuAddMarkAsReadChatListAction(
24062406 &st::menuIconMarkRead);
24072407}
24082408
2409- void ToggleHistoryArchived (not_null<History*> history, bool archived) {
2409+ void ToggleHistoryArchived (
2410+ std::shared_ptr<ChatHelpers::Show> show,
2411+ not_null<History*> history,
2412+ bool archived) {
24102413 const auto callback = [=] {
2411- Ui::Toast::Show (Ui::Toast::Config{
2414+ show-> showToast (Ui::Toast::Config{
24122415 .text = { (archived
24132416 ? tr::lng_archived_added (tr::now)
24142417 : tr::lng_archived_removed (tr::now)) },
Original file line number Diff line number Diff line change @@ -116,7 +116,10 @@ void BlockSenderFromRepliesBox(
116116 not_null<Window::SessionController*> controller,
117117 FullMsgId id);
118118
119- void ToggleHistoryArchived (not_null<History*> history, bool archived);
119+ void ToggleHistoryArchived (
120+ std::shared_ptr<ChatHelpers::Show> show,
121+ not_null<History*> history,
122+ bool archived);
120123Fn<void ()> ClearHistoryHandler (
121124 not_null<Window::SessionController*> controller,
122125 not_null<PeerData*> peer);
You can’t perform that action at this time.
0 commit comments