aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Halle <niklas@niklashalle.net>2020-08-23 22:32:18 +0200
committerNiklas Halle <niklas@niklashalle.net>2020-08-23 22:32:18 +0200
commit3b260869b230e20bf701849477f95030b108832c (patch)
tree580108a7ddb05fd8c4d8f7881e8547e475851d27
parentadc4c7ac5f46f06114532c2da1fa292de732564c (diff)
downloadn_core-3b260869b230e20bf701849477f95030b108832c.tar.gz
n_core-3b260869b230e20bf701849477f95030b108832c.zip
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
-rw-r--r--README.md3
-rw-r--r--include/AnnotationTypes.hpp1
-rw-r--r--src/main.cpp5
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<json> 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))));