summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-10-30 14:12:04 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-10-30 14:12:04 +0000
commit0bbe346a069316f2b4571834791abc6e2ed3e4d7 (patch)
tree5ffcf4bcd99fd95c5ab3d350534e4e8e10253175 /src
parenta6e9900f65e250aa1419420708598df23aae0891 (diff)
Parser: spell out prefix vs. non-prefix logic better
Diffstat (limited to 'src')
-rw-r--r--src/idle-parser.c4
-rw-r--r--src/idle-parser.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/idle-parser.c b/src/idle-parser.c
index 5e7ede0..170f299 100644
--- a/src/idle-parser.c
+++ b/src/idle-parser.c
@@ -352,10 +352,10 @@ static void _parse_message(IdleParser *parser, const gchar *split_msg) {
for (int i = 0; i < IDLE_PARSER_LAST_MESSAGE_CODE; i++) {
const MessageSpec *spec = &(message_specs[i]);
- if ((split_msg[0] != ':') && (i <= IDLE_PARSER_CMD_PING)) {
+ if ((split_msg[0] != ':') && (i <= IDLE_PARSER_LAST_NON_PREFIX_CMD)) {
if (!g_ascii_strcasecmp(tokens[0], spec->str))
_parse_and_forward_one(parser, tokens, spec->code, spec->format);
- } else if (i >= IDLE_PARSER_PREFIXCMD_INVITE) {
+ } else if (i > IDLE_PARSER_LAST_NON_PREFIX_CMD) {
if (!g_ascii_strcasecmp(tokens[2], spec->str))
_parse_and_forward_one(parser, tokens, spec->code, spec->format);
}
diff --git a/src/idle-parser.h b/src/idle-parser.h
index fb68e3d..a900b00 100644
--- a/src/idle-parser.h
+++ b/src/idle-parser.h
@@ -49,6 +49,8 @@ typedef enum {
IDLE_PARSER_CMD_ERROR = 0,
IDLE_PARSER_CMD_PING,
+ IDLE_PARSER_LAST_NON_PREFIX_CMD = IDLE_PARSER_CMD_PING,
+
IDLE_PARSER_PREFIXCMD_INVITE,
IDLE_PARSER_PREFIXCMD_JOIN,
IDLE_PARSER_PREFIXCMD_KICK,