2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Use stories ShareBox from the saved stories list.

This commit is contained in:
John Preston
2023-06-30 17:04:11 +04:00
parent 5f72a5238c
commit a733b83642
4 changed files with 24 additions and 10 deletions

View File

@@ -33,6 +33,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/view/history_view_cursor_state.h"
#include "history/view/history_view_service_message.h"
#include "media/stories/media_stories_controller.h" // ...TogglePinnedToast.
#include "media/stories/media_stories_share.h" // PrepareShareBox.
#include "window/window_session_controller.h"
#include "window/window_peer_menu.h"
#include "ui/widgets/popup_menu.h"
@@ -1104,7 +1105,16 @@ void ListWidget::contextMenuEvent(QContextMenuEvent *e) {
}
void ListWidget::forwardSelected() {
if (auto items = collectSelectedIds(); !items.empty()) {
if (_controller->storiesPeer()) {
const auto ids = collectSelectedIds();
if (ids.size() == 1 && IsStoryMsgId(ids.front().msg)) {
const auto id = ids.front();
_controller->parentController()->show(
::Media::Stories::PrepareShareBox(
_controller->parentController()->uiShow(),
{ id.peer, StoryIdFromMsgId(id.msg) }));
}
} else if (auto items = collectSelectedIds(); !items.empty()) {
forwardItems(std::move(items));
}
}