knock,topic: Remove useless IsChannelName checks.

If !IsChannelName(name), then certainly find_channel(name) == NULL.
This commit is contained in:
Jilles Tjoelker 2011-06-25 11:17:37 +02:00
parent d3cfd0324a
commit 0941f28e7d
2 changed files with 6 additions and 23 deletions

View file

@ -79,13 +79,6 @@ m_knock(struct Client *client_p, struct Client *source_p, int parc, const char *
if((p = strchr(name, ',')))
*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)
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,

View file

@ -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))
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);
if(chptr == NULL)
@ -191,8 +184,6 @@ ms_topic(struct Client *client_p, struct Client *source_p, int parc, const char
{
struct Channel *chptr = NULL;
if(IsChannelName(parv[1]))
{
if((chptr = find_channel(parv[1])) == NULL)
return 0;
@ -201,7 +192,6 @@ ms_topic(struct Client *client_p, struct Client *source_p, int parc, const char
sendto_channel_local(ALL_MEMBERS, chptr, ":%s TOPIC %s :%s",
source_p->name, parv[1],
chptr->topic == NULL ? "" : chptr->topic);
}
return 0;
}