]> jfr.im git - irc/quakenet/newserv.git/blame - miscreply/admin.c
CHANSERV: better batcher error handling for expired accounts/accounts with no email.
[irc/quakenet/newserv.git] / miscreply / admin.c
CommitLineData
7bec4aeb 1/* admin.c */
2
3#include "miscreply.h"
7bec4aeb 4#include "../irc/irc.h"
5#include "../core/error.h"
7bec4aeb 6
7bec4aeb 7
8
7bec4aeb 9/* handle remote admin request
10 *
11 * <source numeric> ADMIN/AD <target server numeric>
12 *
13 * cargv[0] = target server numeric
14 *
15 */
16int handleadminmsg(void *source, int cargc, char **cargv) {
17
a7697869 18 nick *snick; /* struct nick for source nick */
19 char *sourcenum = (char *)source; /* source user numeric */
7bec4aeb 20
21 /* check parameters */
22 if (cargc < 1) {
23 miscreply_needmoreparams(sourcenum, "ADMIN");
24 return CMD_OK;
25 }
26
7bec4aeb 27 /* find source user */
28 if (!(snick = miscreply_finduser(sourcenum, "ADMIN")))
29 return CMD_OK;
30
a7697869 31 /*
32 * 256 RPL_ADMINME "source 256 target :Administrative info about server"
33 * "irc.netsplit.net 256 foobar :Administrative info about irc.netsplit.net"
34 */
35 irc_send("%s 256 %s :Administrative info about %s", getmynumeric(), sourcenum, myserver->content);
36
37 /*
38 * 257 RPL_ADMINLOC1 "source 257 target :text"
39 * "irc.netsplit.net 257 foobar :Located at someplace"
40 */
41 irc_send("%s 257 %s :%s", getmynumeric(), sourcenum, admin1->content);
42
43 /*
44 * 258 RPL_ADMINLOC2 "source 258 target :text"
45 * "irc.netsplit.net 258 foobar :NetSplit IRC Server"
46 */
47 irc_send("%s 258 %s :%s", getmynumeric(), sourcenum, admin2->content);
48
49 /*
50 * 259 RPL_ADMINEMAIL "source 259 target :text"
51 * "irc.netsplit.net 259 foobar :IRC Admins <mail@host>"
52 */
53 irc_send("%s 259 %s :%s", getmynumeric(), sourcenum, admin3->content);
7bec4aeb 54
55 return CMD_OK;
56}