Handle /topic

master
Curtis McEnroe 2018-08-04 18:43:04 -04:00
parent fbf78ef22b
commit ababcbb080
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 9 additions and 0 deletions

View File

@ -69,6 +69,14 @@ static void inputWho(wchar_t *params) {
ircFmt("WHO %s\r\n", chat.chan); 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) { static void inputQuit(wchar_t *params) {
if (params) { if (params) {
ircFmt("QUIT :%ls\r\n", params); ircFmt("QUIT :%ls\r\n", params);
@ -85,6 +93,7 @@ static const struct {
{ L"names", inputWho }, { L"names", inputWho },
{ L"nick", inputNick }, { L"nick", inputNick },
{ L"quit", inputQuit }, { L"quit", inputQuit },
{ L"topic", inputTopic },
{ L"who", inputWho }, { L"who", inputWho },
}; };
static const size_t COMMANDS_LEN = sizeof(COMMANDS) / sizeof(COMMANDS[0]); static const size_t COMMANDS_LEN = sizeof(COMMANDS) / sizeof(COMMANDS[0]);