Made TOPIC override send snotes.

This commit is contained in:
JD Horelick 2010-03-03 13:21:28 -05:00
parent 4ebf686203
commit c6fa55060c
1 changed files with 16 additions and 7 deletions

View File

@ -105,6 +105,8 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
/* setting topic */ /* setting topic */
if(parc > 2) if(parc > 2)
{ {
char topic_info[USERHOST_REPLYLEN];
msptr = find_channel_membership(chptr, source_p); msptr = find_channel_membership(chptr, source_p);
if(msptr == NULL) if(msptr == NULL)
@ -114,9 +116,20 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
return 0; return 0;
} }
if((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || is_any_op(msptr) || IsOverride(source_p)) if(MyClient(source_p) && (chptr->mode.mode & MODE_TOPICLIMIT) && !is_chanop(msptr))
{ {
char topic_info[USERHOST_REPLYLEN]; if(IsOverride(source_p))
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
"%s is overriding TOPIC on [%s]",
get_oper_name(source_p), chptr->chname);
else
{
sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
me.name, source_p->name, parv[1]);
return 0;
}
}
if(ConfigChannel.host_in_topic) if(ConfigChannel.host_in_topic)
rb_sprintf(topic_info, "%s!%s@%s", rb_sprintf(topic_info, "%s!%s@%s",
@ -135,11 +148,7 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
source_p->name, source_p->username, source_p->name, source_p->username,
source_p->host, chptr->chname, source_p->host, chptr->chname,
chptr->topic == NULL ? "" : chptr->topic); chptr->topic == NULL ? "" : chptr->topic);
}
else
sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
get_id(&me, source_p),
get_id(source_p, source_p), name);
} }
else if(MyClient(source_p)) else if(MyClient(source_p))
{ {