1 |
/** |
2 |
* cs_kickdots.C: Kicks people saying "..." on channels with "kickdots" metadata set. |
3 |
* |
4 |
* Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team |
5 |
* Rights to this code are as documented in COPYING. |
6 |
* |
7 |
* |
8 |
* Portions of this file were derived from sources bearing the following license: |
9 |
* Copyright © 2006 William Pitcock |
10 |
* Rights to this code are as documented in doc/pod/license.pod. |
11 |
* |
12 |
* $Id: cs_kickdots.C,v 1.4 2007-08-30 19:56:22 pippijn Exp $ |
13 |
*/ |
14 |
|
15 |
#include "atheme.h" |
16 |
#include <ermyth/module.h> |
17 |
#include <account/mychan.h> |
18 |
|
19 |
static char const rcsid[] = "$Id: cs_kickdots.C,v 1.4 2007-08-30 19:56:22 pippijn Exp $"; |
20 |
|
21 |
REGISTER_MODULE ("chanserv/kickdots", false, "William Pitcock <nenolod -at- nenolod.net>"); |
22 |
|
23 |
static void |
24 |
on_channel_message (channel_t *c, user_t *u, char const * const msg) |
25 |
{ |
26 |
if (msg != NULL && !strncmp (msg, "...", 3)) |
27 |
{ |
28 |
mychan_t *mc = mychan_t::find (c->name); |
29 |
|
30 |
if (mc->find_metadata ("kickdots")) |
31 |
phandler->kick (chansvs.nick, c->name, u->nick, msg); |
32 |
} |
33 |
} |
34 |
|
35 |
bool |
36 |
_modinit (module *m) |
37 |
{ |
38 |
channel_t::callback.message.attach (on_channel_message); |
39 |
|
40 |
return true; |
41 |
} |
42 |
|
43 |
void |
44 |
_moddeinit (void) |
45 |
{ |
46 |
channel_t::callback.message.detach (on_channel_message); |
47 |
} |