summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-05 22:15:08 -0500
committerJune McEnroe <june@causal.agency>2020-02-05 22:15:08 -0500
commit7cc64927bd223ed0a0197cf3285dbc85691fd32b (patch)
tree6b4c3e5fa022ebe9153213cd78f151ecfacbcf73
parentAdd /window (diff)
downloadcatgirl-7cc64927bd223ed0a0197cf3285dbc85691fd32b.tar.gz
catgirl-7cc64927bd223ed0a0197cf3285dbc85691fd32b.zip
Handle empty messages on privmsg, notice, action
Diffstat (limited to '')
-rw-r--r--command.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/command.c b/command.c
index 8471214..2a3df9b 100644
--- a/command.c
+++ b/command.c
@@ -27,6 +27,7 @@ static void commandQuote(size_t id, char *params) {
 }
 
 static void commandPrivmsg(size_t id, char *params) {
+	if (!params || !params[0]) return;
 	ircFormat("PRIVMSG %s :%s\r\n", idNames[id], params);
 	struct Message msg = {
 		.nick = self.nick,
@@ -39,6 +40,7 @@ static void commandPrivmsg(size_t id, char *params) {
 }
 
 static void commandNotice(size_t id, char *params) {
+	if (!params || !params[0]) return;
 	ircFormat("NOTICE %s :%s\r\n", idNames[id], params);
 	struct Message msg = {
 		.nick = self.nick,
@@ -52,7 +54,7 @@ static void commandNotice(size_t id, char *params) {
 
 static void commandMe(size_t id, char *params) {
 	char buf[512];
-	snprintf(buf, sizeof(buf), "\1ACTION %s\1", params);
+	snprintf(buf, sizeof(buf), "\1ACTION %s\1", (params ? params : ""));
 	commandPrivmsg(id, buf);
 }
 
ect'>Return a format->split even at the end of the stringJune McEnroe 2018-09-13Fix weird tab-complete after commaJune McEnroe I have no idea why I did this. 2018-09-13Rewrite UI againJune McEnroe The persistent topic is gone and the status line is now at the top. The status formatting still needs to be reworked. I also want to try showing the nick in the input window so it really looks like your next message. 2018-09-12Add note about C-oJune McEnroe Why are there so few well usable ctrl key bindings? 2018-09-12Use formatParse split to position input cursorJune McEnroe 2018-09-12Factor out IRC formatting parsingJune McEnroe 2018-09-11Add /help equivalent to /manJune McEnroe 2018-09-11Don't render every PM as a pingJune McEnroe 2018-09-11Add urlOpenMatchJune McEnroe 2018-09-10Depend on man.sh for chroot.tar targetJune McEnroe 2018-09-10Set LESSSECURE=1 in man.shJune McEnroe Ridiculous. 2018-09-10Add /man commandJune McEnroe 2018-09-10Install man page in chrootJune McEnroe 2018-09-10Install man pageJune McEnroe 2018-09-10Split keys into subsections and document colorsJune McEnroe 2018-09-10Add "blank" lines to chatte.1June McEnroe 2018-09-10Document key bindings in chatte.1June McEnroe 2018-09-08Document slash commands in chatte.1June McEnroe