]> jfr.im git - solanum.git/blobdiff - modules/m_topic.c
Add target change for channels.
[solanum.git] / modules / m_topic.c
index 55be75ae95970d25f6aa7d28cd71eb01883ff7ff..cf7b28530999289b88c161b9677a9f5240f94d95 100644 (file)
@@ -39,6 +39,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 **);
@@ -114,6 +115,15 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
                        return 0;
                }
 
+               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(((chptr->mode.mode & MODE_TOPICLIMIT) == 0 ||
                                        is_chanop(msptr)) &&
                                (!MyClient(source_p) ||