/[cvs]/botnetop.mod/ircbinds.c
ViewVC logotype

Contents of /botnetop.mod/ircbinds.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1.1.1 - (show annotations) (download) (as text) (vendor branch)
Mon Aug 14 01:41:03 2000 UTC (18 years, 9 months ago) by guppy
Branch: botnetop
CVS Tags: botnetop1
Changes since 1.1: +0 -0 lines
File MIME type: text/x-chdr
first checkin

1 /*
2 * Copyright (C) 2000 Teemu Hjelt <temex@iki.fi>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19 static int bnop_modeop(char *nick, char *uhost, char *hand, char *chname, char *mode, char *victim)
20 {
21 char data[256], s[UHOSTLEN];
22 int i;
23 struct chanset_t *chan = NULL;
24 struct userrec *u;
25 memberlist *m;
26
27 if (bop_modeop) {
28 if ((!(chan = findchan_by_dname(chname))) || (!(m = ismember(chan, victim))))
29 return 0;
30 egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
31 u = get_user_by_host(s);
32 if ((!egg_strcasecmp(mode, "+o")) && (!isop(botname, chan->dname)) && (egg_strcasecmp(nick, botname)) && (matchattr(u, "b|-", chan->dname)) && (matchattr(u, "o|o", chan->dname))) {
33 i = nextbot(u->handle);
34 if (i >= 0) {
35 sprintf(data, "reqops %s", chan->dname);
36 botnet_send_zapf(i, botnetnick, u->handle, data);
37 }
38 }
39 }
40 return 0;
41 }
42
43 static int bnop_jointmr(char *nick, char *uhost, char *hand, char *chname)
44 {
45 struct chanset_t *chan = NULL;
46 struct userrec *u;
47
48 if (!(chan = findchan_by_dname(chname)))
49 return 0;
50 if (egg_strcasecmp(nick, botname)) {
51 u = get_user_by_handle(userlist, hand);
52 if ((matchattr(u, "b|-", chan->dname)) && (matchattr(u, "o|o", chan->dname)) && (!matchattr(u, "d|d", chan->dname)))
53 bnop_askbot(hand, chan->dname);
54 } else {
55 bnop_setneed(chan->dname);
56 }
57 return 0;
58 }
59
60 static cmd_t botnetop_mode[] =
61 {
62 {"*", "", (Function) bnop_modeop, "botnetop"},
63 {0, 0, 0, 0}
64 };
65
66 static cmd_t botnetop_join[] =
67 {
68 {"*", "", (Function) bnop_jointmr, "botnetop"},
69 {0, 0, 0, 0}
70 };

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23