From 363b700f1f805cbcc81786e7ef10426e160a2e7d Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 14 May 2024 18:35:57 +0400 Subject: [PATCH] Fix chat preview and new emoji interactions. --- .../SourceFiles/history/view/history_view_chat_preview.cpp | 5 +++++ .../SourceFiles/history/view/history_view_list_widget.cpp | 6 +++++- .../SourceFiles/history/view/history_view_list_widget.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp b/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp index 56d7f648c..fdc7607f9 100644 --- a/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp +++ b/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp @@ -129,6 +129,7 @@ private: void listAddTranslatedItems( not_null tracker) override; not_null listWindow() override; + not_null listEmojiInteractionsParent() override; not_null listChatStyle() override; rpl::producer listChatWideValue() override; std::unique_ptr listMakeReactionsManager( @@ -676,6 +677,10 @@ not_null Item::listWindow() { Unexpected("Item::listWindow."); } +not_null Item::listEmojiInteractionsParent() { + return this; +} + not_null Item::listChatStyle() { return _chatStyle.get(); } diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index 1b8905dfa..a66ba415e 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -101,6 +101,10 @@ not_null WindowListDelegate::listWindow() { return _window; } +not_null WindowListDelegate::listEmojiInteractionsParent() { + return _window->content(); +} + not_null WindowListDelegate::listChatStyle() { return _window->chatStyle(); } @@ -376,7 +380,7 @@ ListWidget::ListWidget( , _session(session) , _emojiInteractions(std::make_unique( this, - _delegate->listWindow()->content(), + _delegate->listEmojiInteractionsParent(), session, [=](not_null view) { return itemTop(view); })) , _context(_delegate->listContext()) diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.h b/Telegram/SourceFiles/history/view/history_view_list_widget.h index b85bb7bed..5cfc57c08 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.h +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.h @@ -161,6 +161,7 @@ public: // Methods that use Window::SessionController by default. virtual not_null listWindow() = 0; + virtual not_null listEmojiInteractionsParent() = 0; virtual not_null listChatStyle() = 0; virtual rpl::producer listChatWideValue() = 0; virtual std::unique_ptr listMakeReactionsManager( @@ -194,6 +195,7 @@ public: explicit WindowListDelegate(not_null window); not_null listWindow() override; + not_null listEmojiInteractionsParent() override; not_null listChatStyle() override; rpl::producer listChatWideValue() override; std::unique_ptr listMakeReactionsManager(