]>
Commit | Line | Data |
---|---|---|
1 | #include "stdinc.h" | |
2 | ||
3 | #include "send.h" | |
4 | #include "channel.h" | |
5 | #include "client.h" | |
6 | #include "common.h" | |
7 | #include "config.h" | |
8 | #include "ircd.h" | |
9 | #include "numeric.h" | |
10 | #include "s_conf.h" | |
11 | #include "s_newconf.h" | |
12 | #include "s_serv.h" | |
13 | #include "hash.h" | |
14 | #include "msg.h" | |
15 | #include "parse.h" | |
16 | #include "modules.h" | |
17 | #include "whowas.h" | |
18 | #include "monitor.h" | |
19 | ||
20 | void me_metadata(struct Client *, struct Client *, int, const char **); | |
21 | ||
22 | struct Message metadata_msgtab = { | |
23 | "METADATA", 0, 0, 0, MFLG_SLOW, | |
24 | {mg_ignore, mg_ignore, mg_ignore, mg_ignore, {me_metadata, 3}, mg_ignore} | |
25 | }; | |
26 | ||
27 | mapi_clist_av1 metadata_clist[] = { | |
28 | &metadata_msgtab, NULL | |
29 | }; | |
30 | ||
31 | DECLARE_MODULE_AV1(metadata, NULL, NULL, metadata_clist, NULL, NULL, "$Revision$"); | |
32 | ||
33 | void | |
34 | me_metadata(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) | |
35 | { | |
36 | struct Client *target_p; | |
37 | ||
38 | if((target_p = find_client(parv[2])) == NULL) | |
39 | return; | |
40 | ||
41 | if(!target_p->user) | |
42 | return; | |
43 | ||
44 | if(!strcmp(parv[1], "ADD") && parv[4] != NULL) | |
45 | user_metadata_add(target_p, parv[3], parv[4], 0); | |
46 | if(!strcmp(parv[1], "DELETE") && parv[3] != NULL) | |
47 | user_metadata_delete(target_p, parv[3], 0); | |
48 | } |