mirror of
https://github.com/EnergyMech/energymech.git
synced 2025-12-29 16:14:43 +00:00
fixes .forget command issue #20, & shorter function name
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 },
|
||||
|
||||
2
src/h.h
2
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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
10
src/toybox.c
10
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
|
||||
|
||||
Reference in New Issue
Block a user