X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/133755685ef38d8f9ac79ac27c4505b9e96f81fd..8a889b0a5ffbac79bea29658c7c0f4a89f9b7be8:/modules/m_topic.c diff --git a/modules/m_topic.c b/modules/m_topic.c index 439e456..2fd2072 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -38,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 **); @@ -115,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_any_op(msptr) && !can_send(chptr, source_p, 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)) {