Added ability to set shortcut to open section with scheduled messages.

This commit is contained in:
23rd 2024-03-24 16:28:25 +03:00 committed by John Preston
parent 24498bc95f
commit 5509c1810b
3 changed files with 11 additions and 0 deletions

View file

@ -105,6 +105,7 @@ const auto CommandByName = base::flat_map<QString, Command>{
{ u"message_silently"_q , Command::SendSilentMessage }, { u"message_silently"_q , Command::SendSilentMessage },
{ u"message_scheduled"_q , Command::ScheduleMessage }, { u"message_scheduled"_q , Command::ScheduleMessage },
{ u"media_viewer_video_fullscreen"_q , Command::MediaViewerFullscreen }, { u"media_viewer_video_fullscreen"_q , Command::MediaViewerFullscreen },
{ u"show_scheduled"_q , Command::ShowScheduled },
// //
}; };

View file

@ -57,6 +57,8 @@ enum class Command {
FolderNext, FolderNext,
FolderPrevious, FolderPrevious,
ShowScheduled,
ShowArchive, ShowArchive,
ShowContacts, ShowContacts,

View file

@ -1915,6 +1915,14 @@ void HistoryWidget::setupShortcuts() {
controller()->searchInChat(_history); controller()->searchInChat(_history);
return true; return true;
}); });
_canSendMessages
&& request->check(Command::ShowScheduled, 1)
&& request->handle([=] {
using Scheduled = HistoryView::ScheduledMemento;
controller()->showSection(
std::make_shared<Scheduled>(_history));
return true;
});
if (session().supportMode()) { if (session().supportMode()) {
request->check( request->check(
Command::SupportToggleMuted Command::SupportToggleMuted