Add /part

master
C. McEnroe 2020-02-08 01:25:07 -05:00
parent fda510b876
commit f5783d15c6
2 changed files with 12 additions and 1 deletions

View File

@ -1,4 +1,4 @@
.Dd February 7, 2020 .Dd February 8, 2020
.Dt CATGIRL 1 .Dt CATGIRL 1
.Os .Os
. .
@ -134,6 +134,8 @@ Send an action message.
Change nicknames. Change nicknames.
.It Ic /notice Ar message .It Ic /notice Ar message
Send a notice. Send a notice.
.It Ic /part Op Ar message
Leave the channel.
.It Ic /quit Op Ar message .It Ic /quit Op Ar message
Quit IRC. Quit IRC.
.It Ic /quote Ar command .It Ic /quote Ar command

View File

@ -64,6 +64,14 @@ static void commandJoin(size_t id, char *params) {
ircFormat("JOIN %s\r\n", (params ? params : idNames[id])); ircFormat("JOIN %s\r\n", (params ? params : idNames[id]));
} }
static void commandPart(size_t id, char *params) {
if (params) {
ircFormat("PART %s :%s\r\n", idNames[id], params);
} else {
ircFormat("PART %s\r\n", idNames[id]);
}
}
static void commandQuit(size_t id, char *params) { static void commandQuit(size_t id, char *params) {
(void)id; (void)id;
set(&self.quit, (params ? params : "Goodbye")); set(&self.quit, (params ? params : "Goodbye"));
@ -93,6 +101,7 @@ static const struct Handler {
{ "/me", commandMe }, { "/me", commandMe },
{ "/nick", commandNick }, { "/nick", commandNick },
{ "/notice", commandNotice }, { "/notice", commandNotice },
{ "/part", commandPart },
{ "/quit", commandQuit }, { "/quit", commandQuit },
{ "/quote", commandQuote }, { "/quote", commandQuote },
{ "/window", commandWindow }, { "/window", commandWindow },