about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-08-04 18:43:04 -0400
committerJune McEnroe <june@causal.agency>2018-08-04 18:43:04 -0400
commitababcbb0806eecf801179e78043da2bfd2b77eb3 (patch)
treee608d898c22f697d8be88dddc6e9d3c98b84c268
parentAdd README (diff)
downloadcatgirl-ababcbb0806eecf801179e78043da2bfd2b77eb3.tar.gz
catgirl-ababcbb0806eecf801179e78043da2bfd2b77eb3.zip
Handle /topic
-rw-r--r--input.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/input.c b/input.c
index 51fe947..46bbc56 100644
--- a/input.c
+++ b/input.c
@@ -69,6 +69,14 @@ static void inputWho(wchar_t *params) {
 	ircFmt("WHO %s\r\n", chat.chan);
 }
 
+static void inputTopic(wchar_t *params) {
+	if (params) {
+		ircFmt("TOPIC %s :%ls\r\n", chat.chan, params);
+	} else {
+		ircFmt("TOPIC %s\r\n", chat.chan);
+	}
+}
+
 static void inputQuit(wchar_t *params) {
 	if (params) {
 		ircFmt("QUIT :%ls\r\n", params);
@@ -85,6 +93,7 @@ static const struct {
 	{ L"names", inputWho },
 	{ L"nick", inputNick },
 	{ L"quit", inputQuit },
+	{ L"topic", inputTopic },
 	{ L"who", inputWho },
 };
 static const size_t COMMANDS_LEN = sizeof(COMMANDS) / sizeof(COMMANDS[0]);