From dde937cec56b3f6563322d37121308d3f5f5ac39 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 25 Feb 2020 18:06:41 -0500 Subject: Request server-time from the server and filter tags for clients This doesn't yet, but it will break the "robustness principle" according to which a server "SHOULD NOT" assume that a client capable of parsing one tag is capable of parsing all tags. In future, TagCaps will have all other caps that use tags ORed into it, and only if the client supports none of them will tags be filtered out. --- bounce.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bounce.h') diff --git a/bounce.h b/bounce.h index f95bdc8..da52592 100644 --- a/bounce.h +++ b/bounce.h @@ -43,6 +43,7 @@ enum { MessageCap = 8191 + 512 }; enum { ParamCap = 15 }; struct Message { + char *tags; char *origin; char *cmd; char *params[ParamCap]; @@ -50,6 +51,7 @@ struct Message { static inline struct Message parse(char *line) { struct Message msg = {0}; + if (line[0] == '@') msg.tags = 1 + strsep(&line, " "); if (line[0] == ':') msg.origin = 1 + strsep(&line, " "); msg.cmd = strsep(&line, " "); for (size_t i = 0; line && i < ParamCap; ++i) { @@ -79,6 +81,7 @@ enum Cap { #define X(name, id) BIT(id), ENUM_CAP #undef X + TagCaps = CapServerTime, }; static const char *CapNames[] = { -- cgit 1.4.1