From 44457f85c6fce35498cff3b58aa635e84a56d40b Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 2 Jul 2021 15:24:11 -0400 Subject: Save invited channel for /join --- catgirl.1 | 8 +++++--- chat.h | 1 + command.c | 1 + handle.c | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/catgirl.1 b/catgirl.1 index 7e39408..ccb3745 100644 --- a/catgirl.1 +++ b/catgirl.1 @@ -1,4 +1,4 @@ -.Dd June 18, 2021 +.Dd July 2, 2021 .Dt CATGIRL 1 .Os . @@ -421,8 +421,10 @@ Set or clear your away status. Send a command to ChanServ. .It Ic /invite Ar nick Invite a user to the channel. -.It Ic /join Ar channel Op Ar key -Join a channel. +.It Ic /join Op Ar channel Op Ar key +Join the named channel, +the current channel, +or the channel you've been invited to. .It Ic /list Op Ar channel List channels. .It Ic /me Op Ar action diff --git a/chat.h b/chat.h index a4c7670..9ad298f 100644 --- a/chat.h +++ b/chat.h @@ -198,6 +198,7 @@ extern struct Self { char *user; char *host; enum Color color; + char *invited; char *quit; } self; diff --git a/command.c b/command.c index 1193615..3392fa9 100644 --- a/command.c +++ b/command.c @@ -149,6 +149,7 @@ static void commandMsg(uint id, char *params) { } static void commandJoin(uint id, char *params) { + if (!params && id == Network) params = self.invited; if (!params) params = idNames[id]; uint count = 1; for (char *ch = params; *ch && *ch != ' '; ++ch) { diff --git a/handle.c b/handle.c index bfe6e8c..a8f054c 100644 --- a/handle.c +++ b/handle.c @@ -479,6 +479,7 @@ static void handleQuit(struct Message *msg) { static void handleInvite(struct Message *msg) { require(msg, true, 2); if (!strcmp(msg->params[0], self.nick)) { + set(&self.invited, msg->params[1]); uiFormat( Network, filterCheck(Hot, Network, msg), tagTime(msg), "\3%02d%s\3\tinvites you to \3%02d%s\3", -- cgit 1.4.1 e=''/>
path: root/bin/cash/libedit/readline (unfollow)
Commit message (Expand)Author
2019-01-13Shorten $HOME to ~ in prompt expansionJune McEnroe
2019-01-13Document PSlitJune McEnroe
2019-01-13Document PS0June McEnroe
2019-01-13Set PS0 in cashJune McEnroe
2019-01-13Add PS0June McEnroe
2019-01-13Change default ENV from cashrc to env.shJune McEnroe
2019-01-13Use colours in cash promptsJune McEnroe
2019-01-12Set PSlit like NetBSD shJune McEnroe
2019-01-12Install gnupg2 from pkgsrc and symlink gpgJune McEnroe
2019-01-12Reference cash builtin man pages in cash.1 SEE ALSOJune McEnroe
2019-01-12Restore cash builtin man page datesJune McEnroe
2019-01-12Use local libeditJune McEnroe
2019-01-12Replace libedit MakefileJune McEnroe
2019-01-11Import /usr/src/lib/libedit from NetBSD 8.0June McEnroe
2019-01-11Add PSlit for prompt escapesJune McEnroe
2019-01-11Don't make depend automaticallyJune McEnroe