summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-10-28 00:55:47 -0400
committerJune McEnroe <june@causal.agency>2019-10-28 00:56:09 -0400
commit8ccc5a2207cebf034051d45961aa7059a7ce656a (patch)
treea1f24b54965da79e170927a2db9fb7e3f4441cca /client.c
parentMove entire login flow to state and reorganize it (diff)
downloadpounce-8ccc5a2207cebf034051d45961aa7059a7ce656a.tar.gz
pounce-8ccc5a2207cebf034051d45961aa7059a7ce656a.zip
Disallow PRIVMSG/NOTICE before registration
Diffstat (limited to 'client.c')
-rw-r--r--client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/client.c b/client.c
index 3ed8a81..cd9d008 100644
--- a/client.c
+++ b/client.c
@@ -172,7 +172,11 @@ static void handleQuit(struct Client *client, struct Message *msg) {
 }
 
 static void handlePrivmsg(struct Client *client, struct Message *msg) {
-	if (!msg->params[0] || !msg->params[1]) return;
+	if (client->need || !msg->params[0] || !msg->params[1]) {
+		client->error = true;
+		return;
+	}
+
 	char line[1024];
 	snprintf(
 		line, sizeof(line), ":%s %s %s :%s",
@@ -181,6 +185,7 @@ static void handlePrivmsg(struct Client *client, struct Message *msg) {
 	size_t diff = ringDiff(client->consumer);
 	ringProduce(line);
 	if (!diff) ringConsume(NULL, client->consumer);
+
 	serverFormat("%s %s :%s\r\n", msg->cmd, msg->params[0], msg->params[1]);
 }
 
nnotated-deco' href='/litterbox/tag/?h=1.2p1'>1.2p1June McEnroe 2020-04-20Use . as ${LDLIBS.$@} separatorJune McEnroe 2020-04-05Error on invalid ISUPPORT values 1.2June McEnroe 2020-04-05Only set RCS on FreeBSDJune McEnroe 2020-04-05Log bans and unbansJune McEnroe 2020-04-05Parse mode types from ISUPPORTJune McEnroe 2020-04-05Add unscoop matchers for ban/unban eventsJune McEnroe 2020-04-05Check unscoop regexps with make testJune McEnroe 2020-04-05Add unscoop -n flag for checking regexpsJune McEnroe 2020-04-05Add Ban and Unban event typesJune McEnroe 2020-04-02Update styleJune McEnroe 2020-03-31Update unscoop catgirl matchersJune McEnroe 2020-03-31Fix writing verbose to stderrJune McEnroe 2020-03-02Include <>/-/* around nicks in scoop coloring 1.1June McEnroe 2020-03-02Replace .mk files with configure scriptJune McEnroe 2020-02-28Implement the causal.agency/consumer capabilityJune McEnroe 2020-02-22Include <>/-/* around nicks in coloringJune McEnroe 2020-02-22Use (almost) the full range of IRC colors for nicksJune McEnroe