knock,topic: Remove useless IsChannelName checks.
If !IsChannelName(name), then certainly find_channel(name) == NULL.
This commit is contained in:
parent
d3cfd0324a
commit
0941f28e7d
2 changed files with 6 additions and 23 deletions
|
@ -79,13 +79,6 @@ m_knock(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
if((p = strchr(name, ',')))
|
if((p = strchr(name, ',')))
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
if(!IsChannelName(name))
|
|
||||||
{
|
|
||||||
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
|
|
||||||
form_str(ERR_NOSUCHCHANNEL), name);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if((chptr = find_channel(name)) == NULL)
|
if((chptr = find_channel(name)) == NULL)
|
||||||
{
|
{
|
||||||
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
|
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
|
||||||
|
|
|
@ -87,13 +87,6 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
if(MyClient(source_p) && !IsFloodDone(source_p))
|
if(MyClient(source_p) && !IsFloodDone(source_p))
|
||||||
flood_endgrace(source_p);
|
flood_endgrace(source_p);
|
||||||
|
|
||||||
if(!IsChannelName(name))
|
|
||||||
{
|
|
||||||
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
|
|
||||||
form_str(ERR_NOSUCHCHANNEL), name);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
chptr = find_channel(name);
|
chptr = find_channel(name);
|
||||||
|
|
||||||
if(chptr == NULL)
|
if(chptr == NULL)
|
||||||
|
@ -191,17 +184,14 @@ ms_topic(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
{
|
{
|
||||||
struct Channel *chptr = NULL;
|
struct Channel *chptr = NULL;
|
||||||
|
|
||||||
if(IsChannelName(parv[1]))
|
if((chptr = find_channel(parv[1])) == NULL)
|
||||||
{
|
return 0;
|
||||||
if((chptr = find_channel(parv[1])) == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
set_channel_topic(chptr, parv[4], parv[2], atoi(parv[3]));
|
set_channel_topic(chptr, parv[4], parv[2], atoi(parv[3]));
|
||||||
|
|
||||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s TOPIC %s :%s",
|
sendto_channel_local(ALL_MEMBERS, chptr, ":%s TOPIC %s :%s",
|
||||||
source_p->name, parv[1],
|
source_p->name, parv[1],
|
||||||
chptr->topic == NULL ? "" : chptr->topic);
|
chptr->topic == NULL ? "" : chptr->topic);
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue