diff --git a/src/channel.c b/src/channel.c index 3d1e8a7..05ce725 100644 --- a/src/channel.c +++ b/src/channel.c @@ -67,7 +67,7 @@ Chan *find_channel(const char *name, int anychannel) for(chan=current->chanlist;chan;chan=chan->next) { - if (chan->active < anychannel) + if (anychannel == 1 && chan->active == 0) continue; if (ni != tolowertab[(uchar)(chan->name[1])]) continue; @@ -757,24 +757,21 @@ begin: void do_forget(COMMAND_ARGS) { /* - * on_msg checks: CARGS + * on_msg checks: CAXS */ - Chan *chan; - char *channel; - channel = chop(&rest); /* cant be NULL (CARGS) */ - if ((chan = find_channel_ny(channel)) == NULL) + if (CurrentChan == NULL) { - to_user(from,"Channel %s is not in memory",channel); + to_user(from,"Unknown channel"); return; } - if (chan->active) + if (CurrentChan->active) { - to_user(from,"I'm currently active on %s",channel); + to_user(from,"I'm currently active on %s",CurrentChan->name); return; } - to_user(from,"Channel %s is now forgotten",channel); - remove_chan(chan); + to_user(from,"Channel %s is now forgotten",CurrentChan->name); + remove_chan(CurrentChan); } /* diff --git a/src/debug.c b/src/debug.c index a42c7ee..899900b 100644 --- a/src/debug.c +++ b/src/debug.c @@ -228,7 +228,7 @@ LS struct { check_telnet, "check_telnet" }, #endif /* TELNET */ #ifdef TOYBOX -{ read_bigcharset_callback, "read_bigcharset_callback" CMD1_SE }, +{ read_charset_callback, "read_charset_callback" CMD1_SE }, #endif /* TOYBOX */ #ifdef TRIVIA { trivia_check, "trivia_check" CMD1_SE }, diff --git a/src/defines.h b/src/defines.h index 7f2f51b..276195b 100644 --- a/src/defines.h +++ b/src/defines.h @@ -374,12 +374,6 @@ enum { #define SP_NO_DNS 7 #define SP_THROTTLED 8 -/* find_channel() */ - -#define CH_ACTIVE 0x1 -#define CH_OLD 0x2 -#define CH_ANY 0x3 - /* check_mass() */ #define INDEX_FLOOD 0 diff --git a/src/gencmd.c b/src/gencmd.c index 5c34a38..b2dcb86 100644 --- a/src/gencmd.c +++ b/src/gencmd.c @@ -182,7 +182,7 @@ struct * Level 70 == JOINLEVEL */ { 0, "CYCLE", "do_cycle", 70 | CCPW | CAXS | ACCHAN }, - { 0, "FORGET", "do_forget", 70 | CCPW | CAXS | CARGS }, + { 0, "FORGET", "do_forget", 70 | CCPW | CAXS }, { 0, "JOIN", "do_join", 70 | CCPW | CARGS }, { 0, "KS", "do_kicksay", 70 | CCPW | REDIR | LBUF }, { 0, "PART", "do_part", 70 | CCPW | CAXS | ACCHAN }, diff --git a/src/h.h b/src/h.h index dc1dc63..9b2eaff 100644 --- a/src/h.h +++ b/src/h.h @@ -688,7 +688,7 @@ LS void do_tcl(COMMAND_ARGS) __page(CMD1_SEG); /* toybox.c */ -LS int read_bigcharset_callback(char *) __page(CMD1_SEG); +LS int read_charset_callback(char *) __page(CMD1_SEG); LS int read_bigcharset(char *) __page(CMD1_SEG); LS int read_ascii(char *) __page(CMD1_SEG); LS void trivia_week_toppers(void) __page(CMD1_SEG); diff --git a/src/ons.c b/src/ons.c index 4c0b6db..7d5cac8 100644 --- a/src/ons.c +++ b/src/ons.c @@ -604,8 +604,8 @@ recheck_alias: uaccess = get_authaccess(from,to); if (uaccess < acmd[i]) return; - CurrentChan = find_channel_ac(to); - if (mcmd[i].acchan && !CurrentChan) + CurrentChan = find_channel_ny(to); + if (mcmd[i].acchan && (CurrentChan == NULL || CurrentChan->active == 0)) { to_user(from,ERR_CHAN,to); return; diff --git a/src/toybox.c b/src/toybox.c index 8b92fff..2a1420e 100644 --- a/src/toybox.c +++ b/src/toybox.c @@ -69,7 +69,7 @@ int orig_charheight; int orig_spacewidth; int orig_kerning; -int read_bigcharset_callback(char *rest) +int read_charset_callback(char *rest) { char *opt; int *n,sz; @@ -98,9 +98,9 @@ int read_bigcharset_callback(char *rest) opt = chop(&rest); #ifdef DEBUG - debug("(read_bigcharset_callback) New character definition: %s\n",opt); + debug("(read_charset_callback) New character definition: %s\n",opt); #endif /* DEBUG */ - set_mallocdoer(read_bigcharset_callback); + set_mallocdoer(read_charset_callback); newchar = (BigC*)Calloc(sizeof(BigC) + strlen(opt)); newchar->next = fontlist; @@ -137,7 +137,7 @@ int read_bigcharset_callback(char *rest) return(TRUE); } Free((char**)&fontname); - set_mallocdoer(read_bigcharset_callback); + set_mallocdoer(read_charset_callback); fontname = stringdup(opt); } @@ -173,7 +173,7 @@ int read_bigcharset(char *fname) charheight = 0; kerning = 0; - readline(fd,&read_bigcharset_callback); /* readline closes fd */ + readline(fd,&read_charset_callback); /* readline closes fd */ /* * free the old font if there is one