Browse Source

Implement chop_nickname and chop_message

rexim 4 years ago
parent
commit
12b40fb58a
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/vodus_message.cpp

+ 4 - 4
src/vodus_message.cpp

@@ -208,14 +208,14 @@ Timestamp chop_timestamp(String_View *input)
 
 
 String_View chop_nickname(String_View *input)
 String_View chop_nickname(String_View *input)
 {
 {
-    assert(0 && "TODO: chop_nickname is not implemented");
-    return {};
+    input->chop_by_delim('<');
+    auto nickname = input->chop_by_delim('>');
+    return nickname;
 }
 }
 
 
 String_View chop_message(String_View *input)
 String_View chop_message(String_View *input)
 {
 {
-    assert(0 && "TODO: chop_message is not implemented");
-    return {};
+    return input->trim();
 }
 }
 
 
 size_t parse_messages_from_string_view(String_View input,
 size_t parse_messages_from_string_view(String_View input,