extern int h_new_local_user;
extern int h_new_remote_user;
extern int h_introduce_client;
+extern int h_can_kick;
void init_hook(void);
int register_hook(const char *name);
char *key;
} hook_data_channel_activity;
+typedef struct
+{
+ struct Client *client;
+ struct Channel *chptr;
+ struct Client *target;
+ int approved;
+} hook_data_channel_approval;
+
typedef struct
{
struct Client *client;
#include "hash.h"
#include "packet.h"
#include "s_serv.h"
+#include "hook.h"
static int m_kick(struct Client *, struct Client *, int, const char **);
#define mg_kick { m_kick, 3 }
return 0;
}
+ if(MyClient(source_p))
+ {
+ hook_data_channel_approval hookdata;
+
+ hookdata.client = source_p;
+ hookdata.chptr = chptr;
+ hookdata.target = who;
+ hookdata.approved = 1;
+
+ call_hook(h_can_kick, &hookdata);
+
+ if (!hookdata.approved)
+ return 0;
+ }
+
comment = LOCAL_COPY((EmptyString(parv[3])) ? who->name : parv[3]);
if(strlen(comment) > (size_t) REASONLEN)
comment[REASONLEN] = '\0';
int h_new_local_user;
int h_new_remote_user;
int h_introduce_client;
+int h_can_kick;
void
init_hook(void)
h_new_local_user = register_hook("new_local_user");
h_new_remote_user = register_hook("new_remote_user");
h_introduce_client = register_hook("introduce_client");
+ h_can_kick = register_hook("can_kick");
}
/* grow_hooktable()