summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-03-23 16:52:24 -0400
committerJune McEnroe <june@causal.agency>2020-03-23 16:52:24 -0400
commit4f40ace9d4cf475d445678e63b3f48cc03cf7d7e (patch)
treea99352ca1396d742369301705071a0cf6a26f851 /handle.c
parentFix non-multiline command newline handling (diff)
downloadcatgirl-4f40ace9d4cf475d445678e63b3f48cc03cf7d7e.tar.gz
catgirl-4f40ace9d4cf475d445678e63b3f48cc03cf7d7e.zip
Track MODE in replies
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c6
1 files changed, 6 insertions, 0 deletions
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) {