X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/34d8ef4d14dfcef13f8aab3746b30c6f8cacb4a1..8a889b0a5ffbac79bea29658c7c0f4a89f9b7be8:/modules/m_topic.c diff --git a/modules/m_topic.c b/modules/m_topic.c index 4b6d44b..2fd2072 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_topic.c 254 2005-09-21 23:35:12Z nenolod $ */ #include "stdinc.h" @@ -39,6 +38,7 @@ #include "parse.h" #include "modules.h" #include "packet.h" +#include "tgchange.h" static int m_topic(struct Client *, struct Client *, int, const char **); static int ms_topic(struct Client *, struct Client *, int, const char **); @@ -116,7 +116,16 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char * return 0; } - if(MyClient(source_p) && (chptr->mode.mode & MODE_TOPICLIMIT) && !is_chanop(msptr)) + if(MyClient(source_p) && !is_chanop_voiced(msptr) && + !IsOper(source_p) && + !add_channel_target(source_p, chptr)) + { + sendto_one(source_p, form_str(ERR_TARGCHANGE), + me.name, source_p->name, chptr->chname); + return 0; + } + + if(MyClient(source_p) && (chptr->mode.mode & MODE_TOPICLIMIT) && !is_any_op(msptr)) { if(IsOverride(source_p)) { @@ -125,7 +134,7 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char * get_oper_name(source_p), chptr->chname); sendto_server(NULL, chptr, NOCAPS, NOCAPS, ":%s WALLOPS :%s is overriding TOPIC on [%s]", - use_id(source_p), get_oper_name(source_p), chptr->chname); + me.name, get_oper_name(source_p), chptr->chname); } else {