diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/Matrix.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index 5d942ed..bbe9897 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -983,7 +983,17 @@ namespace QuickMedia { } PluginResult MatrixRoomDirectoryPage::submit(const std::string &title, const std::string&, std::vector<Tab> &result_tabs) { - result_tabs.push_back(Tab{create_body(), std::make_unique<MatrixServerRoomListPage>(program, matrix, title), create_search_bar("Search...", 350)}); + std::string server_name = title; + + if(strncmp(server_name.c_str(), "http://", 7) == 0) + server_name.erase(0, 7); + else if(strncmp(server_name.c_str(), "https://", 8) == 0) + server_name.erase(0, 8); + + if(strncmp(server_name.c_str(), "www.", 4) == 0) + server_name.erase(0, 4); + + result_tabs.push_back(Tab{create_body(), std::make_unique<MatrixServerRoomListPage>(program, matrix, server_name), create_search_bar("Search...", 350)}); return PluginResult::OK; } |