From 3b260869b230e20bf701849477f95030b108832c Mon Sep 17 00:00:00 2001 From: Niklas Halle Date: Sun, 23 Aug 2020 22:32:18 +0200 Subject: added new annotation , so the bridges know when to format in platform specific command.. format. see readme for more info. also removed [[maybe_unused]] again, because clang (not tidy!) said it is going to ignore it anyway --- README.md | 3 +++ include/AnnotationTypes.hpp | 1 + src/main.cpp | 5 ++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f1c42b1..3f8e291 100644 --- a/README.md +++ b/README.md @@ -59,5 +59,8 @@ The text should be printed as strikethrough. No extra content. ##### `underline` The text should be printed as underline. No extra content. +##### `command` +The text should be printed as a command, meaning how did bridge will recognize it (e.g. prefix with '/'). No extra content. + ##### `link` The text should be formatted as a link. Extra content: the alt text for the uri - the uri should be the text itself, so that clients ignoring this annotation still show the real uri. \ No newline at end of file diff --git a/include/AnnotationTypes.hpp b/include/AnnotationTypes.hpp index d61de08..66d0b9d 100644 --- a/include/AnnotationTypes.hpp +++ b/include/AnnotationTypes.hpp @@ -16,6 +16,7 @@ namespace Reply { DECL_ENUM_ELEMENT(italics), DECL_ENUM_ELEMENT(strikethrough), DECL_ENUM_ELEMENT(underline), + DECL_ENUM_ELEMENT(command), DECL_ENUM_ELEMENT(link), } END_ENUM(AnnotationType) } diff --git a/src/main.cpp b/src/main.cpp index a61a3dd..a86c589 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,7 +19,7 @@ struct CommandHandler { } handler_function func{nullptr}; - [[maybe_unused]] std::string description; + std::string description; void *payload{nullptr}; }; @@ -124,8 +124,7 @@ json helpHandler(std::string const &arguments, std::string const &session, void for (auto const &itor : commands) { std::vector commandAnnotations; - commandAnnotations.push_back(std::move(create_annotation(Reply::AnnotationType::italics))); - commandAnnotations.push_back(std::move(create_annotation(Reply::AnnotationType::underline))); + commandAnnotations.push_back(std::move(create_annotation(Reply::AnnotationType::command))); reply_vec.push_back(std::move(create_text("- "))); reply_vec.push_back(std::move(create_text(itor.first, std::move(commandAnnotations)))); -- cgit v1.2.3-54-g00ecf