diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd.c | 18 | ||||
| -rw-r--r-- | src/irc.c | 10 | ||||
| -rw-r--r-- | src/irc.h | 1 | ||||
| -rw-r--r-- | src/screen.c | 2 | ||||
| -rw-r--r-- | src/screen.h | 3 |
5 files changed, 28 insertions, 6 deletions
@@ -146,11 +146,15 @@ static char have_commas(void) { return 0; } +static void join_arg1(void) { + txbuf_set_str2("JOIN ", arg1); + txbuf_send(); +} + static void do_j1(void) { if(have_commas()) return; - txbuf_set_str2("JOIN ", arg1); - txbuf_send(); + join_arg1(); } static void do_j(void) { @@ -449,3 +453,13 @@ void cmd_execute(void) { if(!*edit_box) return; cmd_command(edit_box); } + +void cmd_rejoin_chans(void) { + char i; + for(i = 2; i < MAX_SCREENS; i++) { + if(scr_names[i][0] == '#') { + arg1 = scr_names[i]; + join_arg1(); + } + } +} @@ -389,15 +389,19 @@ static void do_numeric(void) { /* don't print these, just noise */ case RPL_MOTDSTART: + break; + + /* don't print, but do trigger rejoin */ case RPL_ENDOFMOTD: case ERR_NOMOTD: + cmd_rejoin_chans(); break; case RPL_NAMREPLY: scr_print_active(msg_args[2]); scr_print_active(" users: "); scr_print_active(msg_text); - scr_print_active("\n"); + scr_eol_active(); break; case RPL_ENDOFNAMES: @@ -409,13 +413,13 @@ static void do_numeric(void) { scr_print_active(msg_args[1]); scr_print_active(": "); scr_print_active(msg_text); - scr_print_active("\n"); + scr_eol_active(); break; case RPL_TOPICWHOTIME: scr_print_active("Topic set by "); scr_print_active(msg_args[2]); - scr_print_active("\n"); + scr_eol_active(); break; default: @@ -61,4 +61,5 @@ void print_errnum(void); /**** cmd.c */ void cmd_command(char *cmd); void cmd_execute(void); +void cmd_rejoin_chans(void); unsigned int read_rtclok(void); /* irc.c needs this one so it's not static */ diff --git a/src/screen.c b/src/screen.c index 617ea2f..4a5bbfc 100644 --- a/src/screen.c +++ b/src/screen.c @@ -14,7 +14,7 @@ char scr_current; /* the screen that's currently being written to */ char scr_active; -static char scr_names[7][32]; +char scr_names[7][32]; static char scr_topics[7][40]; static char xpos; diff --git a/src/screen.h b/src/screen.h index a53530b..f8db33e 100644 --- a/src/screen.h +++ b/src/screen.h @@ -27,6 +27,9 @@ extern char scr_active; active screen clears its active flag. */ extern char scr_status[MAX_SCREENS]; +/* names (channel or query). should be treated as read-only by callers. */ +extern char scr_names[7][32]; + /* call before using any of the other functions. sets up the display list, clears all screen memory, selects screen 0 for display. */ |
