#include "parse.h"
#include "modules.h"
#include "s_serv.h"
+#include "supported.h"
static int m_knock(struct Client *, struct Client *, int, const char **);
{mg_unreg, {m_knock, 2}, {m_knock, 2}, mg_ignore, mg_ignore, {m_knock, 2}}
};
+static int
+_modinit(void)
+{
+ add_isupport("KNOCK", isupport_boolean, &ConfigChannel.use_knock);
+ return 0;
+}
+
+static void
+_moddeinit(void)
+{
+ delete_isupport("KNOCK");
+}
+
mapi_clist_av1 knock_clist[] = { &knock_msgtab, NULL };
-DECLARE_MODULE_AV1(knock, NULL, NULL, knock_clist, NULL, NULL, "$Revision: 3570 $");
+DECLARE_MODULE_AV1(knock, _modinit, _moddeinit, knock_clist, NULL, NULL, "$Revision: 3570 $");
/* m_knock
* parv[1] = channel
return 0;
}
- if(!((chptr->mode.mode & MODE_INVITEONLY) || (*chptr->mode.key) ||
- (chptr->mode.limit &&
+ if(!((chptr->mode.mode & MODE_INVITEONLY) || (*chptr->mode.key) ||
+ (chptr->mode.limit &&
rb_dlink_list_length(&chptr->members) >= (unsigned long)chptr->mode.limit)))
{
sendto_one_numeric(source_p, ERR_CHANOPEN,
return 0;
}
-
+
if(MyClient(source_p))
{
/* don't allow a knock if the user is banned */
* allow one knock per user per knock_delay
* allow one knock per channel per knock_delay_channel
*/
- if(!IsOper(source_p) &&
+ if(!IsOper(source_p) &&
(source_p->localClient->last_knock + ConfigChannel.knock_delay) > rb_current_time())
{
sendto_one(source_p, form_str(ERR_TOOMANYKNOCK),