diff --git a/Telegram/SourceFiles/core/shortcuts.cpp b/Telegram/SourceFiles/core/shortcuts.cpp index 0a00d82b83..dad91d9734 100644 --- a/Telegram/SourceFiles/core/shortcuts.cpp +++ b/Telegram/SourceFiles/core/shortcuts.cpp @@ -66,6 +66,7 @@ const auto CommandByName = base::flat_map{ { qsl("next_chat") , Command::ChatNext }, { qsl("first_chat") , Command::ChatFirst }, { qsl("last_chat") , Command::ChatLast }, + { qsl("self_chat") , Command::ChatSelf }, }; const auto CommandNames = base::flat_map{ @@ -87,6 +88,7 @@ const auto CommandNames = base::flat_map{ { Command::ChatNext , qsl("next_chat") }, { Command::ChatFirst , qsl("first_chat") }, { Command::ChatLast , qsl("last_chat") }, + { Command::ChatSelf , qsl("self_chat") }, }; class Manager { @@ -320,6 +322,8 @@ void Manager::fillDefaults() { set(qsl("ctrl+3"), Command::ChatPinned3); set(qsl("ctrl+4"), Command::ChatPinned4); set(qsl("ctrl+5"), Command::ChatPinned5); + + set(qsl("ctrl+0"), Command::ChatSelf); } void Manager::writeDefaultFile() { diff --git a/Telegram/SourceFiles/core/shortcuts.h b/Telegram/SourceFiles/core/shortcuts.h index 3029f218c7..b94f03c171 100644 --- a/Telegram/SourceFiles/core/shortcuts.h +++ b/Telegram/SourceFiles/core/shortcuts.h @@ -28,6 +28,7 @@ enum class Command { ChatNext, ChatFirst, ChatLast, + ChatSelf, ChatPinned1, ChatPinned2, ChatPinned3, diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 2be31852f5..82ec8ffb36 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -2915,6 +2915,10 @@ void DialogsInner::setupShortcuts() { request->check(Command::ChatLast) && request->handle([=] { return jumpToDialogRow(last); }); + request->check(Command::ChatSelf) && request->handle([] { + App::main()->choosePeer(Auth().userPeerId(), ShowAtUnreadMsgId); + return true; + }); static const auto kPinned = { Command::ChatPinned1,