diff options
author | C. McEnroe | 2021-07-02 15:24:11 -0400 |
---|---|---|
committer | C. McEnroe | 2021-07-02 15:24:11 -0400 |
commit | 44457f85c6fce35498cff3b58aa635e84a56d40b (patch) | |
tree | 539837615e5f22265dec83da1c0db41c61c7f39f | |
parent | 54251acae34fe7d72f1f93a69158fbe16cc8a30e (diff) |
Save invited channel for /join
-rw-r--r-- | catgirl.1 | 8 | ||||
-rw-r--r-- | chat.h | 1 | ||||
-rw-r--r-- | command.c | 1 | ||||
-rw-r--r-- | handle.c | 1 |
4 files changed, 8 insertions, 3 deletions
@@ -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 @@ -198,6 +198,7 @@ extern struct Self { char *user; char *host; enum Color color; + char *invited; char *quit; } self; @@ -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) { @@ -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", |