From 4f40ace9d4cf475d445678e63b3f48cc03cf7d7e Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 23 Mar 2020 16:52:24 -0400 Subject: Track MODE in replies --- chat.h | 1 + command.c | 2 ++ handle.c | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/chat.h b/chat.h index 3f93f3d..7ffcfcd 100644 --- a/chat.h +++ b/chat.h @@ -187,6 +187,7 @@ extern struct Replies { uint invex; uint join; uint list; + uint mode; uint names; uint topic; uint whois; diff --git a/command.c b/command.c index 5da8bb9..7339574 100644 --- a/command.c +++ b/command.c @@ -185,12 +185,14 @@ static void commandMode(uint id, char *params) { ircFormat("MODE %s %s\r\n", self.nick, params); } else { ircFormat("MODE %s\r\n", self.nick); + replies.mode++; } } else { if (params) { ircFormat("MODE %s %s\r\n", idNames[id], params); } else { ircFormat("MODE %s\r\n", idNames[id]); + replies.mode++; } } } diff --git a/handle.c b/handle.c index 376e722..e690caa 100644 --- a/handle.c +++ b/handle.c @@ -527,6 +527,9 @@ static const char *UserModes[256] = { static void handleReplyUserModeIs(struct Message *msg) { require(msg, false, 2); + if (!replies.mode) return; + replies.mode--; + char buf[1024] = ""; for (char *ch = msg->params[1]; *ch; ++ch) { if (*ch == '+') continue; @@ -560,6 +563,9 @@ static const char *ChanModes[256] = { static void handleReplyChannelModeIs(struct Message *msg) { require(msg, false, 3); + if (!replies.mode) return; + replies.mode--; + uint param = 3; char buf[1024] = ""; for (char *ch = msg->params[2]; *ch; ++ch) { -- cgit 1.4.1 lue='dda50e8be72d45059623d79c45508c9347092c01'/>
path: root/etc/psf/.gitignore (unfollow)
Commit message (Collapse)Author
2021-01-02Clean up make lexerJune McEnroe
Still feels pretty messy though.
2021-01-02Tag top-level typedefs the same way as function definitionsJune McEnroe
2021-01-01Clean up order lexerJune McEnroe
2021-01-01Remove empty comma statement from bitJune McEnroe
2021-01-01Increment license header templatesJune McEnroe
2020-12-31Tell "Music" rather than "iTunes"June McEnroe
It's the new era.
2020-12-31Add ASCII control code names to bitJune McEnroe
2020-12-31Simplify bit lexing and parsingJune McEnroe
Also print the value of each expression separated by commas.
2020-12-31Add ddateJune McEnroe
I'm tired of package managers not having this!
2020-12-30Print octal for 8 bits in bitJune McEnroe
2020-12-30Add unary & to bitJune McEnroe
Also unary + and fix precedence of unary -.
2020-12-30Support unary + in orderJune McEnroe
Missed this because operator(7) just doesn't list it, oddly.
2020-12-30Add postfix $ operator to bitJune McEnroe
2020-12-29Add make lexerJune McEnroe
This is kind of a mess and needs to be cleaned up against more careful reading of the make grammar.
2020-12-29Clean up C lexerJune McEnroe
This ordering of rules feels much cleaner.
2020-12-29Clean up hilex code somewhatJune McEnroe
2020-12-29Match lex/yacc %% %{ %} lines as MacroJune McEnroe
2020-12-29Match top-level C definitions as IdentifierTagJune McEnroe
2020-12-29Match C type declarations as IdentifierTagJune McEnroe
2020-12-29Match function-like macro definitions as IdentifierTagJune McEnroe
2020-12-29Reconfigure C macro start conditionsJune McEnroe
2020-12-29Document HTML class namesJune McEnroe
2020-12-29Rename Tag class to IdentifierTagJune McEnroe
2020-12-29Change HTML class from hi to hilexJune McEnroe
You can tell I was just copying the HTML code huh.
2020-12-29Add hilex HTML outputJune McEnroe