Send sticker from set box to correct place.

This commit is contained in:
John Preston
2026-04-30 16:53:35 +07:00
parent 0628b23226
commit b7a20e1878
25 changed files with 187 additions and 6 deletions
@@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_chat_switch_process.h"
#include "window/window_controller.h"
#include "window/window_filters_menu.h"
#include "window/section_widget.h"
#include "window/window_separate_id.h"
#include "info/channel_statistics/earn/info_channel_earn_list.h"
#include "info/peer_gifts/info_peer_gifts_widget.h"
@@ -297,6 +298,9 @@ SendMenu::Details MainWindowShow::sendMenuDetails() const {
if (!window) {
return SendMenu::Details();
}
if (const auto section = window->activeLayerSection()) {
return section->sendMenuDetails();
}
return window->content()->sendMenuDetails();
}
@@ -318,7 +322,11 @@ void MainWindowShow::processChosenSticker(
ChatHelpers::FileChosen &&chosen) const {
if (const auto window = _window.get()) {
Ui::PostponeCall(window, [=, chosen = std::move(chosen)]() mutable {
window->stickerOrEmojiChosen(std::move(chosen));
if (const auto section = window->activeLayerSection()) {
section->processChosenSticker(std::move(chosen));
} else {
window->content()->processChosenSticker(std::move(chosen));
}
});
}
}
@@ -3120,6 +3128,20 @@ bool SessionController::isLayerShown() const {
return _window->isLayerShown();
}
void SessionController::registerActiveLayerSection(SectionWidget *section) {
_activeLayerSection = section;
}
void SessionController::unregisterActiveLayerSection(SectionWidget *section) {
if (_activeLayerSection == section) {
_activeLayerSection = nullptr;
}
}
SectionWidget *SessionController::activeLayerSection() const {
return _activeLayerSection.data();
}
not_null<MainWidget*> SessionController::content() const {
return widget()->sessionContent();
}