From 1efd8ab1b4d4a2b1c8236aee33f51d960964c20b Mon Sep 17 00:00:00 2001 From: Niklas Halle Date: Wed, 26 Aug 2020 12:00:21 +0200 Subject: fixes (i hope) --- src/SimpleHandlers.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/SimpleHandlers.cpp') diff --git a/src/SimpleHandlers.cpp b/src/SimpleHandlers.cpp index c9d0fcf..40cfa68 100644 --- a/src/SimpleHandlers.cpp +++ b/src/SimpleHandlers.cpp @@ -24,7 +24,7 @@ Handler::json Handler::wikiHandler(std::string const &arguments, std::string con } Handler::json Handler::helpHandler(std::string const &arguments, std::string const &session, void *payload) { - auto commands = *(std::unordered_map *) payload; + auto commands = (std::vector *) payload; std::vector reply_vec; reply_vec.emplace_back(create_text( @@ -34,15 +34,15 @@ Handler::json Handler::helpHandler(std::string const &arguments, std::string con "Dear my fellow users, these are my official commands, which are offered to my believers.\n" "\n")); - for (auto const &itor : commands) { + for (auto const &itor : *commands) { std::vector commandAnnotations; commandAnnotations.emplace_back(create_annotation(Reply::AnnotationType::command)); reply_vec.emplace_back(create_text("- ")); - reply_vec.emplace_back(create_text(itor.first, std::move(commandAnnotations))); - while (!itor.second.description->empty()) { - reply_vec.emplace_back(std::move(itor.second.description->back())); - itor.second.description->pop(); + reply_vec.emplace_back(create_text(itor.command, std::move(commandAnnotations))); + while (!itor.description->empty()) { + reply_vec.emplace_back(std::move(itor.description->back())); + itor.description->pop(); } } -- cgit v1.2.3-54-g00ecf