From aa21312f18ef86a335dd28272e317da959ceb9b7 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 21 Apr 2024 02:09:16 +0500 Subject: upd: renamed namespaces + added utils namespace --- src/irc/message.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/irc/message.hpp') diff --git a/src/irc/message.hpp b/src/irc/message.hpp index 23bbe29..94541a6 100644 --- a/src/irc/message.hpp +++ b/src/irc/message.hpp @@ -8,8 +8,8 @@ #include "../utils/string.hpp" -namespace RedpilledBot { - namespace IRC { +namespace bot { + namespace irc { enum MessageType { Privmsg, Notice }; std::optional define_message_type(const std::string &msg); @@ -38,7 +38,7 @@ namespace RedpilledBot { template std::optional> parse_message(const std::string &msg) { - std::vector parts = split_text(msg, ' '); + std::vector parts = utils::string::split_text(msg, ' '); if (T == MessageType::Privmsg) { MessageSender sender; @@ -53,7 +53,8 @@ namespace RedpilledBot { std::string user = parts[0]; user = user.substr(1, user.length()); - std::vector user_parts = split_text(user, '!'); + std::vector user_parts = + utils::string::split_text(user, '!'); sender.login = user_parts[0]; @@ -64,10 +65,11 @@ namespace RedpilledBot { parts.erase(parts.begin()); - std::string chat_message = join_vector(parts, ' '); + std::string chat_message = utils::string::join_vector(parts, ' '); message.message = chat_message.substr(1, chat_message.length()); - std::vector tags_parts = split_text(tags, ';'); + std::vector tags_parts = + utils::string::split_text(tags, ';'); for (const std::string &tag : tags_parts) { std::istringstream iss(tag); -- cgit v1.2.3