summary refs log tree commit diff
path: root/src/timeline/InputBar.cpp
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2021-09-17 10:19:58 +0000
committerGitHub <noreply@github.com>2021-09-17 10:19:58 +0000
commite118f3882d54a6f84885ab492704104848e5d346 (patch)
treed65763df4d31d87fa030f9d40992ab9f5ced09ef /src/timeline/InputBar.cpp
parentAdded a text field that allows choosing custom homeserver in "Room directory"... (diff)
parentImprovements for linking to events (diff)
downloadnheko-e118f3882d54a6f84885ab492704104848e5d346.tar.xz
Merge pull request #728 from Thulinma/goto
Improvements for linking to events
Diffstat (limited to 'src/timeline/InputBar.cpp')
-rw-r--r--src/timeline/InputBar.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp

index ece9db62..a6fbab78 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp
@@ -630,6 +630,23 @@ InputBar::command(QString command, QString args) notice(args, false); } else if (command == "rainbownotice") { notice(args, true); + } else if (command == "goto") { + // Goto has three different modes: + // 1 - Going directly to a given event ID + if (args[0] == '$') { + room->showEvent(args); + return; + } + // 2 - Going directly to a given message index + if (args[0] >= '0' && args[0] <= '9') { + room->showEvent(args); + return; + } + // 3 - Matrix URI handler, as if you clicked the URI + if (ChatPage::instance()->handleMatrixUri(args)) { + return; + } + nhlog::net()->error("Could not resolve goto: {}", args.toStdString()); } }