summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes9
-rw-r--r--Changes.conf12
-rw-r--r--Changes.lang2
-rw-r--r--data/example.conf12
-rw-r--r--docs/README6
-rw-r--r--include/bahamut.h38
-rw-r--r--include/dreamforge.h25
-rw-r--r--include/extern.h51
-rw-r--r--include/hybrid.h48
-rw-r--r--include/ptlink.h14
-rw-r--r--include/services.h12
-rw-r--r--include/ultimate3.h15
-rw-r--r--include/unreal32.h44
-rw-r--r--lang/cat.l12
-rw-r--r--lang/de.l8
-rw-r--r--lang/en_us.l8
-rw-r--r--lang/es.l8
-rw-r--r--lang/fr.l8
-rw-r--r--lang/gr.l8
-rw-r--r--lang/hun.l8
-rw-r--r--lang/it.l8
-rw-r--r--lang/nl.l8
-rw-r--r--lang/pl.l8
-rw-r--r--lang/pt.l8
-rw-r--r--lang/ru.l8
-rw-r--r--lang/tr.l8
-rw-r--r--src/Makefile4
-rw-r--r--src/actions.c16
-rw-r--r--src/bahamut.c196
-rw-r--r--src/base64.c125
-rw-r--r--src/botserv.c80
-rw-r--r--src/channels.c214
-rw-r--r--src/chanserv.c74
-rw-r--r--src/config.c13
-rw-r--r--src/dreamforge.c132
-rw-r--r--src/hostserv.c7
-rw-r--r--src/hybrid.c242
-rw-r--r--src/init.c31
-rw-r--r--src/main.c5
-rw-r--r--src/memoserv.c3
-rw-r--r--src/messages.c25
-rw-r--r--src/misc.c58
-rw-r--r--src/modules.c20
-rw-r--r--src/modules/ircd_catserv.c9
-rw-r--r--src/mysql.c1
-rw-r--r--src/nickserv.c38
-rw-r--r--src/operserv.c15
-rw-r--r--src/ptlink.c365
-rw-r--r--src/rageircd.c173
-rw-r--r--src/servers.c63
-rw-r--r--src/ultimate2.c235
-rw-r--r--src/ultimate3.c213
-rw-r--r--src/unreal31.c84
-rw-r--r--src/unreal32.c657
-rw-r--r--src/users.c68
-rw-r--r--src/viagra.c211
-rw-r--r--version.log6
57 files changed, 3185 insertions, 594 deletions
diff --git a/Changes b/Changes
index 1ba0dd979..915c048be 100644
--- a/Changes
+++ b/Changes
@@ -17,10 +17,19 @@ Provided by Anope Dev. <dev@anope.org> - 2004
08/24 F Compile error with gcc2. [ #00]
Provided by Trystan <trystan@nomadirc.net> - 2004
+08/28 A CSupport for +I channel mode. [ #00]
+08/28 A Complete support for Unreal3.2 [ #00]
+08/28 A New BASE64 general library. [ #00]
09/07 A Unreal32 channel mode +T support. [ #00]
09/07 A Ircd CHANMODE now trapped and stored. [ #00]
08/23 A New protocol independent design (aka anope-capab). [ #00]
08/28 A New IRCD document for adding new ircd support to new design. [ #00]
+09/27 F Verbose message for vident. [#173]
+09/27 F Check and trap for forbidden nicks on HS. [#172]
+09/27 F Tracking of IP address for simple checks. [#166]
+09/27 F Proper deletion of added NS timeouts. [#143]
+09/27 F Partial fix for +a compile error. [#147]
+09/27 F Resolved longstanding NICKIP issue on AKILLs. [ #17]
09/07 F Handling of most Unknown Message from Server commands. [ #00]
09/07 F Several Hybrid support fixes and improvements. [ #00]
09/07 F Several Unreal support fixes and improvements. [ #00]
diff --git a/Changes.conf b/Changes.conf
index 764272f5b..332bbb6b9 100644
--- a/Changes.conf
+++ b/Changes.conf
@@ -19,6 +19,18 @@ Anope Version S V N
# register NewTester or Tester123 unless you are an IRC operator.
#RestrictOperNicks
+# UseTokens [OPTIONAL]
+# Allows irc networks to use TOKEN commands instead of the
+# standard commands. This saves bandwidth but can break older
+# modules that are not set to trap for TOKEN - if you are using
+# older modules do NOT use this option
+#UseTokens
+
+# UseSVS2MODE [OPTIONAL]
+# On Unreal IRCD use SVS2MODE instead of SVSMODE, doing this will
+# show services changing user modes.
+#UseSVS2MODE
+
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
diff --git a/Changes.lang b/Changes.lang
index ae72d1347..f26ec5c87 100644
--- a/Changes.lang
+++ b/Changes.lang
@@ -8,6 +8,8 @@ Anope Version S V N
OPER_SQLINE_UNSUPPORTED
OPER_SVSO_UNSUPPORTED
OPER_UMODE_UNSUPPORTED
+ CHAN_CLEARED_INVITES
+ NICK_INFO_VHOST2
*** Mod Strings:
diff --git a/data/example.conf b/data/example.conf
index 937a11213..a0e6d34b6 100644
--- a/data/example.conf
+++ b/data/example.conf
@@ -464,6 +464,18 @@ GlobalOnCycleUP "Services are now back online - have a nice day"
# register NewTester or Tester123 unless you are an IRC operator.
#RestrictOperNicks
+# UseTokens [OPTIONAL]
+# Allows irc networks to use TOKEN commands instead of the
+# standard commands. This saves bandwidth but can break older
+# modules that are not set to trap for TOKEN - if you are using
+# older modules do NOT use this option
+#UseTokens
+
+# UseSVS2MODE [OPTIONAL]
+# On Unreal IRCD use SVS2MODE instead of SVSMODE, doing this will
+# show services changing user modes.
+#UseSVS2MODE
+
###########################################################################
#
# Mail-related options
diff --git a/docs/README b/docs/README
index 5f9d909c1..f6b2f19ee 100644
--- a/docs/README
+++ b/docs/README
@@ -63,13 +63,15 @@ Anope credits:
Lucas Nussbaum <lucas@lucas-nussbaum.net>
Pieter Bootsma <geniusdex@anope.org>
Thomas Juberg Stensås <ShadowMaster@Shadow-Realm.org>
- Trystan .S Lee <trystan@anope.org>
+ Trystan .S Lee <trystan@nomadirc.net>
openglx <openglx@brasnerd.com.br>
Anope Translations:
GeniusDex <geniusdex@anope.org> (nl.l)
Oleg Nikolaev aka Isot <isot@complife.ru> (ru.l)
Stuff <the.stuff@gmx.de> (de.l)
DrStein <gacevedo@anope.org> (es.l)
+ Janos Kapitany <sarkanyka@cjbchat.hu> (hun.l)
+ Mateusz Szczyrzyca <annihilator@ircnet.pl> (pl.l)
2. PRESENTATION
@@ -130,7 +132,7 @@ Anope currently works with:
- ViagraIRCd 1.3 or later
- Hybrid 7 or later
- PTlink 6.15 or later
- - RageIRCd 2.0 beta-3 or later
+ - RageIRCd 2.0 beta-6 or later
Anope could also work with some of the daemons derived by the ones
listed above, but there's no support for them if they work or don't
diff --git a/include/bahamut.h b/include/bahamut.h
index e04729463..78cefe1f9 100644
--- a/include/bahamut.h
+++ b/include/bahamut.h
@@ -16,7 +16,7 @@
#ifdef IRC_BAHAMUT
#define PROTECT_SET_MODE "+"
-#define PROTECT_UNSET_MODE "+"
+#define PROTECT_UNSET_MODE "-"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
@@ -25,15 +25,33 @@
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
-
-#define UMODE_a 0x00000001
-#define UMODE_h 0x00000002
-#define UMODE_i 0x00000004
-#define UMODE_o 0x00000008
-#define UMODE_r 0x00000010
-#define UMODE_w 0x00000020
-#define UMODE_A 0x00000040
-#define UMODE_R 0x80000000
+#define UMODE_a 0x00000001 /* umode +a - Services Admin */
+#define UMODE_h 0x00000002 /* umode +h - Helper */
+#define UMODE_i 0x00000004 /* umode +i - Invisible */
+#define UMODE_o 0x00000008 /* umode +o - Oper */
+#define UMODE_r 0x00000010 /* umode +r - registered nick */
+#define UMODE_w 0x00000020 /* umode +w - Get wallops */
+#define UMODE_A 0x00000040 /* umode +A - Server Admin */
+#define UMODE_x 0x00000080 /* umode +x - Squelch with notice */
+#define UMODE_X 0x00000100 /* umode +X - Squelch without notice */
+#define UMODE_F 0x00000200 /* umode +F - no cptr->since message rate throttle */
+#define UMODE_j 0x00000400 /* umode +j - client rejection notices */
+#define UMODE_K 0x00000800 /* umode +K - U: lined server kill messages */
+#define UMODE_O 0x00001000 /* umode +O - Local Oper */
+#define UMODE_s 0x00002000 /* umode +s - Server notices */
+#define UMODE_c 0x00004000 /* umode +c - Client connections/exits */
+#define UMODE_k 0x00008000 /* umode +k - Server kill messages */
+#define UMODE_f 0x00010000 /* umode +f - Server flood messages */
+#define UMODE_y 0x00020000 /* umode +y - Stats/links */
+#define UMODE_d 0x00040000 /* umode +d - Debug info */
+#define UMODE_g 0x00080000 /* umode +g - Globops */
+#define UMODE_b 0x00100000 /* umode +b - Chatops */
+#define UMODE_n 0x00200000 /* umode +n - Routing Notices */
+#define UMODE_m 0x00400000 /* umode +m - spambot notices */
+#define UMODE_e 0x00800000 /* umode +e - oper notices for the above +D */
+#define UMODE_D 0x01000000 /* umode +D - Hidden dccallow umode */
+#define UMODE_I 0x02000000 /* umode +I - invisible oper (masked) */
+#define UMODE_R 0x80000000 /* unmode +R - No non registered msgs */
#define CMODE_i 0x00000001
#define CMODE_m 0x00000002
diff --git a/include/dreamforge.h b/include/dreamforge.h
index f5f3c755f..414e0639c 100644
--- a/include/dreamforge.h
+++ b/include/dreamforge.h
@@ -13,10 +13,8 @@
#ifdef IRC_DREAMFORGE
-#define OWNER_SET_MODE "+"
-#define OWNER_UNSET_MODE "+"
#define PROTECT_SET_MODE "+"
-#define PROTECT_UNSET_MODE "+"
+#define PROTECT_UNSET_MODE "-"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
@@ -25,14 +23,19 @@
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
-#define UMODE_a 0x00000001
-#define UMODE_h 0x00000002
-#define UMODE_i 0x00000004
-#define UMODE_o 0x00000008
-#define UMODE_r 0x00000010
-#define UMODE_w 0x00000020
-#define UMODE_A 0x00000040
-#define UMODE_g 0x80000000
+#define UMODE_a 0x00000001 /* Services Admin */
+#define UMODE_h 0x00000002 /* Help system operator */
+#define UMODE_i 0x00000004 /* makes user invisible */
+#define UMODE_o 0x00000008 /* Operator */
+#define UMODE_r 0x00000010 /* Nick set by services as registered */
+#define UMODE_w 0x00000020 /* send wallops to them */
+#define UMODE_A 0x00000040 /* Admin */
+#define UMODE_O 0x00000080 /* Local operator */
+#define UMODE_s 0x00000100 /* server notices such as kill */
+#define UMODE_k 0x00000200 /* Show server-kills... */
+#define UMODE_c 0x00000400 /* Show client information */
+#define UMODE_f 0x00000800 /* Receive flood warnings */
+#define UMODE_g 0x80000000 /* Shows some global messages */
#define CMODE_i 0x00000001
#define CMODE_m 0x00000002
diff --git a/include/extern.h b/include/extern.h
index 7fb46ed25..d20e8060a 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -59,13 +59,14 @@ E CMMode cmmodes[128];
E unsigned long umodes[128];
E char csmodes[128];
-extern void do_mass_mode(char *modes);
extern void add_ban(Channel * chan, char *mask);
extern void chan_adduser2(User * user, Channel * c);
+extern void add_invite(Channel * chan, char *mask);
extern void chan_delete(Channel * c);
extern void del_ban(Channel * chan, char *mask);
extern void set_key(Channel * chan, char *value);
extern void set_limit(Channel * chan, char *value);
+extern void del_invite(Channel * chan, char *mask);
extern char *get_key(Channel * chan);
extern char *get_limit(Channel * chan);
extern Channel *chan_create(char *chan);
@@ -291,7 +292,9 @@ E int DumpCore;
E int LogUsers;
E int NickRegDelay;
E int UseSVSHOLD;
+E int UseSVS2MODE;
E int RestrictOperNicks;
+E int UseTokens;
E char **HostSetters;
E int HostNumber;
@@ -508,6 +511,8 @@ E void helpserv_init(void);
/**** hostserv.c ****/
E void hostserv_init(void);
E void addHostCore(char *nick, char *vIdent, char *vhost, char *creator, int32 tmp_time);
+E char *getvIdent(char *nick);
+E char *getvHost(char *nick);
/**** init.c ****/
@@ -642,9 +647,10 @@ E char *myStrGetOnlyToken(const char *str, const char dilim,
E char *myStrSubString(const char *src, int start, int end);
E char *myStrGetTokenRemainder(const char *str, const char dilim,
int token_number);
+E int myNumToken(const char *str, const char dilim);
E void doCleanBuffer(char *str);
E void EnforceQlinedNick(char *nick, char *killer);
-E int nickIsServices(char *nick);
+E int nickIsServices(char *nick, int bot);
E void add_entropy_userkeys(void);
E void rand_init(void);
@@ -705,6 +711,8 @@ E void nsStartNickTracking(User * u);
E void nsStopNickTracking(User * u);
E int nsCheckNickTracking(User *u);
+E int group_identified(User * u, NickCore * nc);
+E int is_on_access(User * u, NickCore * nc);
/**** operserv.c ****/
@@ -800,13 +808,14 @@ E Server *first_server(int flags);
E Server *next_server(int flags);
E Server *new_server(Server * uplink, const char *name, const char *desc,
- uint16 flags);
+ uint16 flags, char *suid);
E Server *findserver(Server *s, const char *name);
-E void do_server(const char *source, int ac, char **av);
+E void do_server(const char *source, char *servername, char *hops, char *descript, char *numeric);
E void do_squit(const char *source, int ac, char **av);
E void capab_parse(int ac, char **av);
+E int anope_check_sync(const char *name);
/**** sessions.c ****/
@@ -864,6 +873,7 @@ E User *do_nick(const char *source, char *nick, char *username, char *host,
char *server, char *realname, time_t ts, uint32 svid, uint32 ip, char *vhost, char *uid);
E void do_umode(const char *source, int ac, char **av);
+E void do_umode2(const char *source, int ac, char **av);
E void do_quit(const char *source, int ac, char **av);
E void do_kill(char *source, char *reason);
@@ -874,6 +884,7 @@ E int is_excepted(ChannelInfo * ci, User * user);
E int is_excepted_mask(ChannelInfo * ci, char *mask);
E int match_usermask(const char *mask, User * user);
+E int match_userip(const char *mask, User * user, char *host);
E void split_usermask(const char *mask, char **nick, char **user,
char **host);
E char *create_mask(User * u);
@@ -978,19 +989,27 @@ extern void anope_cmd_sqline(char *mask, char *reason);
extern void anope_cmd_szline(char *mask, char *reason); /* SZLINE */
extern void anope_cmd_squit(char *servname, char *message); /* SQUIT */
extern void anope_cmd_svinfo(); /* SVINFO */
+extern void anope_cmd_svsadmin(char *server, int set); /* SVSADMIN */
extern void anope_cmd_svshold(char *nick); /* SVSHOLD */
extern void anope_cmd_release_svshold(char *nick); /* SVSHOLD */
extern void anope_cmd_svsinfo(); /* SVSINFO */
+extern void anope_cmd_svsjoin(char *source, char *nick,char *chan); /* SVSJOIN */
extern void anope_cmd_svskill(char *source,char *user, const char *fmt, ...); /* SVSKILL */
extern void anope_cmd_svsmode(User * u, int ac, char **av); /* SVSMODE */
extern void anope_cmd_svsnick(char *nick,char *newnick, time_t when); /* SVSNICK */
extern void anope_cmd_svsnoop(char *server, int set); /* SVSNOOP */
extern void anope_cmd_svso(char *source,char *nick, char *flag); /* SVSO */
+extern void anope_cmd_svspart(char *source, char *nick,char *chan); /* SVSPART */
+extern void anope_cmd_swhois(char *source, char *who, char *mask); /* SWHOIS */
extern void anope_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); /* TOPIC */
extern void anope_cmd_unsgline(char *mask); /* UNSGLINE */
extern void anope_cmd_unsqline(char *user); /* UNSQLINE */
extern void anope_cmd_unszline(char *mask); /* UNSZLINE */
+extern void anope_cmd_eob(); /* EOB - end of burst */
+extern void anope_cmd_burst(); /* BURST - use eob to send burst 0 */
+extern void anope_cmd_svswatch(char *sender, char *nick, char *parm);
+extern int anope_event_482(char *source, int ac, char **av);
extern int anope_event_436(char *source, int ac, char **av);
extern int anope_event_away(char *source, int ac, char **av);
extern int anope_event_ping(char *source, int ac, char **av);
@@ -1028,27 +1047,51 @@ extern int anope_event_snick(char *source, int ac, char **av);
extern int anope_event_vhost(char *source, int ac, char **av);
extern int anope_event_tkl(char *source, int ac, char **av);
extern int anope_event_eos(char *source, int ac, char **av);
+extern int anope_event_eob(char *source, int ac, char **av);
extern int anope_event_pass(char *source, int ac, char **av);
extern int anope_event_netinfo(char *source, int ac, char **av);
extern int anope_event_error(char *source, int ac, char **av);
extern int anope_event_eb(char *source, int ac, char **av);
extern int anope_event_netctrl(char *source, int ac, char **av);
extern int anope_event_notice(char *source, int ac, char **av);
+extern int anope_event_snotice(char *source, int ac, char **av);
extern int anope_event_sqline(char *source, int ac, char **av);
extern int anope_event_error(char *source, int ac, char **av);
extern int anope_event_smo(char *source, int ac, char **av);
extern int anope_event_myid(char *source, int ac, char **av);
extern int anope_event_vctrl(char *source, int ac, char **av);
+extern int anope_event_tctrl(char *source, int ac, char **av);
extern int anope_event_netinfo(char *source, int ac, char **av);
extern int anope_event_snetinfo(char *source, int ac, char **av);
+extern int anope_event_umode2(char *source, int ac, char **av);
+extern int anope_event_globops(char *source, int ac, char **av);
+extern int anope_event_swhois(char *source, int ac, char **av);
+extern int anope_event_burst(char *source, int ac, char **av);
+extern int anope_event_luserslock(char *source, int ac, char **av);
+extern int anope_event_admin(char *source, int ac, char **av);
+extern int anope_event_credits(char *source, int ac, char **av);
+extern int anope_event_rehash(char *source, int ac, char **av);
+extern int anope_event_sdesc(char *source, int ac, char **av);
+extern int anope_event_netglobal(char *source, int ac, char **av);
+extern int anope_event_invite(char *source, int ac, char **av);
extern void anope_set_umode(User * user, int ac, char **av);
extern void anope_cmd_svid_umode(char *nick, time_t ts);
extern void anope_cmd_svid_umode2(User *u, char *ts);
extern void anope_cmd_svid_umode3(User *u, char *ts);
extern void anope_cmd_nc_change(User *u);
+extern int anope_flood_mode_check(char *value);
extern char *common_get_vident(User *u);
extern char *common_get_vhost(User *u);
+extern char *send_token(char *token1, char *token2);
+extern char *base64enc(long i);
+extern long base64dec(char *b64);
+extern long base64dects(char *ts);
+
+#define Anope_Free(x) if ((x) != NULL) free(x)
+
+extern char *host_resolve(char *host);
+
#endif /* EXTERN_H */
diff --git a/include/hybrid.h b/include/hybrid.h
index 58664e01a..74c69c3a1 100644
--- a/include/hybrid.h
+++ b/include/hybrid.h
@@ -14,7 +14,7 @@
#ifdef IRC_HYBRID
#define PROTECT_SET_MODE "+"
-#define PROTECT_UNSET_MODE "+"
+#define PROTECT_UNSET_MODE "-"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
@@ -23,23 +23,35 @@
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
-#define UMODE_a 0x00000001
-#define UMODE_h 0x00000002
-#define UMODE_i 0x00000004
-#define UMODE_o 0x00000008
-#define UMODE_r 0x00000010
-#define UMODE_w 0x00000020
-#define UMODE_A 0x00000040
-
-#define CMODE_i 0x00000001
-#define CMODE_m 0x00000002
-#define CMODE_n 0x00000004
-#define CMODE_p 0x00000008
-#define CMODE_s 0x00000010
-#define CMODE_t 0x00000020
-#define CMODE_k 0x00000040 /* These two used only by ChanServ */
-#define CMODE_l 0x00000080
-#define CMODE_a 0x00000400
+#define UMODE_a 0x00000001 /* Admin status */
+#define UMODE_b 0x00000080 /* See bot and drone flooding notices */
+#define UMODE_c 0x00000100 /* Client connection/quit notices */
+#define UMODE_d 0x00000200 /* See debugging notices */
+#define UMODE_f 0x00000400 /* See I: line full notices */
+#define UMODE_g 0x00000800 /* Server Side Ignore */
+#define UMODE_i 0x00000004 /* Not shown in NAMES or WHO unless you share a channel */
+#define UMODE_k 0x00001000 /* See server generated KILL messages */
+#define UMODE_l 0x00002000 /* See LOCOPS messages */
+#define UMODE_n 0x00004000 /* See client nick changes */
+#define UMODE_o 0x00000008 /* Operator status */
+#define UMODE_r 0x00000010 /* See rejected client notices */
+#define UMODE_s 0x00008000 /* See general server notices */
+#define UMODE_u 0x00010000 /* See unauthorized client notices */
+#define UMODE_w 0x00000020 /* See server generated WALLOPS */
+#define UMODE_x 0x00020000 /* See remote server connection and split notices */
+#define UMODE_y 0x00040000 /* See LINKS, STATS (if configured), TRACE notices */
+#define UMODE_z 0x00080000 /* See oper generated WALLOPS */
+
+#define CMODE_i 0x00000001 /* Invite only */
+#define CMODE_m 0x00000002 /* Users without +v/h/o cannot send text to the channel */
+#define CMODE_n 0x00000004 /* Users must be in the channel to send text to it */
+#define CMODE_p 0x00000008 /* Private is obsolete, this now restricts KNOCK */
+#define CMODE_s 0x00000010 /* The channel does not show up on NAMES or LIST */
+#define CMODE_t 0x00000020 /* Only chanops can change the topic */
+#define CMODE_k 0x00000040 /* Key/password for the channel. */
+#define CMODE_l 0x00000080 /* Limit the number of users in a channel */
+#define CMODE_a 0x00000400 /* Anonymous ops, chanops are hidden */
+
#define DEFAULT_MLOCK CMODE_n | CMODE_t
diff --git a/include/ptlink.h b/include/ptlink.h
index 7091add18..8e61f52bf 100644
--- a/include/ptlink.h
+++ b/include/ptlink.h
@@ -30,6 +30,19 @@
#define UMODE_r 0x00000010
#define UMODE_w 0x00000020
#define UMODE_A 0x00000040
+#define UMODE_B 0x00000080
+#define UMODE_H 0x00000100
+#define UMODE_N 0x00000200
+#define UMODE_O 0x00000400
+#define UMODE_p 0x00000800
+#define UMODE_R 0x00001000
+#define UMODE_s 0x00002000
+#define UMODE_S 0x00004000
+#define UMODE_T 0x00008000
+#define UMODE_v 0x00001000
+#define UMODE_y 0x00002000
+#define UMODE_z 0x00004000
+
#define CMODE_i 0x00000001
@@ -52,6 +65,7 @@
#define CMODE_N 0x00080000
#define CMODE_R 0x00000100 /* Only identified users can join */
#define CMODE_r 0x00000200 /* Set for all registered channels */
+#define CMODE_C 0x00100000
#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
diff --git a/include/services.h b/include/services.h
index 4c7ddcb4e..81c1b2017 100644
--- a/include/services.h
+++ b/include/services.h
@@ -245,7 +245,11 @@ struct ircdvars_ {
uint32 chan_lmode; /* Mode */
int check_nick_id; /* On nick change check if they could be identified */
int knock_needs_i; /* Check if we needed +i when setting NOKNOCK */
- char *chanmodes; /* If the ircd sends CHANMODE in CAPAB this is where we store it */
+ char *chanmodes; /* If the ircd sends CHANMODE in CAPAB this is where we store it */
+ int token; /* Does Anope support the tokens for the ircd */
+ int tokencaseless; /* TOKEN are not case senstive - most its Unreal that is case senstive */
+ int sjb64; /* Base 64 encode TIMESTAMP */
+ int invitemode; /* +I */
};
struct ircdcapab_ {
@@ -278,6 +282,7 @@ struct ircdcapab_ {
uint32 dodkey;
uint32 dozip;
uint32 chanmodes;
+ uint32 sjb64;
};
/*************************************************************************/
@@ -658,6 +663,7 @@ struct server_ {
char *desc; /* Server description */
uint16 flags; /* Some info flags, as defined below */
char *suid; /* Server Univeral ID */
+ int sync; /* Whether is synced or not */
Server *links; /* Linked list head for linked servers */
Server *uplink; /* Server which pretends to be the uplink */
@@ -800,6 +806,8 @@ struct channel_ {
char **bans;
int32 exceptcount, exceptsize;
char **excepts;
+ int32 invitecount, invitesize;
+ char **invite;
struct c_userlist {
struct c_userlist *next, *prev;
User *user;
@@ -1072,7 +1080,7 @@ struct hostcache_ {
#define CAPAB_VL 0x04000000
#define CAPAB_TLKEXT 0x08000000
#define CAPAB_CHANMODE 0x10000000
-
+#define CAPAB_SJB64 0x20000000
/*************************************************************************/
diff --git a/include/ultimate3.h b/include/ultimate3.h
index 511037144..0aafffa87 100644
--- a/include/ultimate3.h
+++ b/include/ultimate3.h
@@ -30,11 +30,17 @@
#define UMODE_r 0x00000010
#define UMODE_w 0x00000020
#define UMODE_A 0x00000040
+#define UMODE_0 0x00000080
+#define UMODE_Z 0x00000100 /* umode +Z - Services Root Admin */
+#define UMODE_S 0x00000200 /* umode +S - Services Client */
+#define UMODE_D 0x00000400 /* umode +D - has seen dcc warning message */
+#define UMODE_d 0x00000800 /* umode +d - user is deaf to channel messages */
+#define UMODE_W 0x00001000 /* umode +d - user is deaf to channel messages */
#define UMODE_p 0x04000000
-#define UMODE_Z 0x08000000
-#define UMODE_P 0x20000000
-#define UMODE_R 0x80000000
+#define UMODE_P 0x20000000 /* umode +P - Services Admin */
#define UMODE_x 0x40000000
+#define UMODE_R 0x80000000
+
#define CMODE_i 0x00000001
#define CMODE_m 0x00000002
@@ -49,7 +55,8 @@
#define CMODE_S 0x00002000
#define CMODE_K 0x00004000
#define CMODE_c 0x00000400 /* Colors can't be used */
-#define CMODE_M 0x00000800 /* Non-regged nicks can't send messages */
+#define CMODE_M 0x00000800 /* Non-regged nicks can't send messages */
+#define CMODE_q 0x00001000 /* No Quit Reason */
#define CMODE_O 0x00008000 /* Only opers can join */
#define CMODE_R 0x00000100 /* Only identified users can join */
#define CMODE_r 0x00000200 /* Set for all registered channels */
diff --git a/include/unreal32.h b/include/unreal32.h
index b94c82395..4970b6772 100644
--- a/include/unreal32.h
+++ b/include/unreal32.h
@@ -16,16 +16,34 @@
/*************************************************************************/
/* User Modes */
-#define UMODE_a 0x00000001
-#define UMODE_h 0x00000002
-#define UMODE_i 0x00000004
-#define UMODE_o 0x00000008
-#define UMODE_r 0x00000010
-#define UMODE_w 0x00000020
-#define UMODE_A 0x00000040
-#define UMODE_g 0x80000000
-#define UMODE_x 0x40000000
-#define UMODE_R 0x80000000
+#define UMODE_a 0x00000001 /* a Services Admin */
+#define UMODE_h 0x00000002 /* h Available for help (HelpOp) */
+#define UMODE_i 0x00000004 /* i Invisible (not shown in /who) */
+#define UMODE_o 0x00000008 /* o Global IRC Operator */
+#define UMODE_r 0x00000010 /* r Identifies the nick as being registered */
+#define UMODE_w 0x00000020 /* w Can listen to wallop messages */
+#define UMODE_A 0x00000040 /* A Server Admin */
+#define UMODE_N 0x00000080 /* N Network Administrator */
+#define UMODE_O 0x00000100 /* O Local IRC Operator */
+#define UMODE_C 0x00000200 /* C Co-Admin */
+#define UMODE_d 0x00000400 /* d Makes it so you can not receive channel PRIVMSGs */
+#define UMODE_p 0x00000800 /* Hides the channels you are in in a /whois reply */
+#define UMODE_q 0x00001000 /* q Only U:Lines can kick you (Services Admins Only) */
+#define UMODE_s 0x00002000 /* s Can listen to server notices */
+#define UMODE_t 0x00004000 /* t Says you are using a /vhost */
+#define UMODE_v 0x00008000 /* v Receives infected DCC Send Rejection notices */
+#define UMODE_z 0x00010000 /* z Indicates that you are an SSL client */
+#define UMODE_B 0x00020000 /* B Marks you as being a Bot */
+#define UMODE_G 0x00040000 /* G Filters out all the bad words per configuration */
+#define UMODE_H 0x00080000 /* H Hide IRCop Status (IRCop Only) */
+#define UMODE_S 0x00100000 /* S services client */
+#define UMODE_V 0x00200000 /* V Marks you as a WebTV user */
+#define UMODE_W 0x00400000 /* W Lets you see when people do a /whois on you */
+#define UMODE_T 0x00800000 /* T Prevents you from receiving CTCPs */
+#define UMODE_g 0x20000000 /* g Can send & read globops and locops */
+#define UMODE_x 0x40000000 /* x Gives user a hidden hostname */
+#define UMODE_R 0x80000000 /* Allows you to only receive PRIVMSGs/NOTICEs from registered (+r) users */
+
/*************************************************************************/
@@ -43,7 +61,7 @@
#define CMODE_r 0x00000200 /* Set for all registered channels */
#define CMODE_c 0x00000400
#define CMODE_A 0x00000800
-#define CMODE_H 0x00001000
+/* #define CMODE_H 0x00001000 Was now +I may not join, but Unreal Removed it and it will not set in 3.2 */
#define CMODE_K 0x00002000
#define CMODE_L 0x00004000
#define CMODE_O 0x00008000
@@ -57,6 +75,7 @@
#define CMODE_z 0x00800000
#define CMODE_N 0x01000000
#define CMODE_T 0x02000000
+#define CMODE_M 0x04000000
/*************************************************************************/
@@ -78,4 +97,7 @@
#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
+#define SJOINBANNCHAR '&'
+#define SJOINEXCEPTIONCHAR '\"'
+
#endif
diff --git a/lang/cat.l b/lang/cat.l
index 0041ad2b8..5795b255b 100644
--- a/lang/cat.l
+++ b/lang/cat.l
@@ -13,8 +13,8 @@
# messages need to take the same per ameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the per ameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -577,9 +577,11 @@ NICK_INFO_LAST_QUIT
NICK_INFO_URL
URL: %s
NICK_INFO_EMAIL
- Adreça E-mail: %s
+ Adreça E-mail: %s
NICK_INFO_VHOST
- vhost: %s
+ vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
ICQ #: %d
NICK_INFO_GREET
@@ -1432,6 +1434,8 @@ CHAN_CLEARED_VOICES
Mode +v ha estat eliminat del canal %s.
CHAN_CLEARED_USERS
Tots els usuaris han estat kickegats del canal %s.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/lang/de.l b/lang/de.l
index ff5ddd0c5..d67c1febe 100644
--- a/lang/de.l
+++ b/lang/de.l
@@ -24,8 +24,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -591,6 +591,8 @@ NICK_INFO_EMAIL
eMail-Adresse: %s
NICK_INFO_VHOST
vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
ICQ #: %d
NICK_INFO_GREET
@@ -1428,6 +1430,8 @@ CHAN_CLEARED_VOICES
Alle Voice-Flatgs wurden im Channel %s entfernt.
CHAN_CLEARED_USERS
Alle User wurden aus Channel %s gekicked.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/lang/en_us.l b/lang/en_us.l
index dc49d71fb..3faee6c35 100644
--- a/lang/en_us.l
+++ b/lang/en_us.l
@@ -13,8 +13,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -570,6 +570,8 @@ NICK_INFO_EMAIL
E-mail address: %s
NICK_INFO_VHOST
vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
ICQ #: %d
NICK_INFO_GREET
@@ -1409,6 +1411,8 @@ CHAN_CLEARED_VOICES
Mode +v has been cleared from channel %s.
CHAN_CLEARED_USERS
All users have been kicked from channel %s.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/lang/es.l b/lang/es.l
index 3e56a7b0d..b4ea451b9 100644
--- a/lang/es.l
+++ b/lang/es.l
@@ -13,8 +13,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -584,6 +584,8 @@ NICK_INFO_EMAIL
Direccion E-mail: %s
NICK_INFO_VHOST
vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
ICQ #: %d
NICK_INFO_GREET
@@ -1430,6 +1432,8 @@ CHAN_CLEARED_VOICES
Modo +v ha sido removido del canal %s.
CHAN_CLEARED_USERS
Todos los usuarios han sido kickeados del canal %s.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/lang/fr.l b/lang/fr.l
index a225353b2..9e7c261e7 100644
--- a/lang/fr.l
+++ b/lang/fr.l
@@ -16,8 +16,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -582,6 +582,8 @@ NICK_INFO_EMAIL
Adresse e-mail: %s
NICK_INFO_VHOST
vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
Numéro ICQ: %d
NICK_INFO_GREET
@@ -1431,6 +1433,8 @@ CHAN_CLEARED_VOICES
Tous les voices du channel %s ont été enlevés.
CHAN_CLEARED_USERS
Tous les utilisateurs du channel %s ont été kickés.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/lang/gr.l b/lang/gr.l
index 003a42389..9beabb950 100644
--- a/lang/gr.l
+++ b/lang/gr.l
@@ -13,8 +13,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -578,6 +578,8 @@ NICK_INFO_EMAIL
E-mail äéåýèõíóç: %s
NICK_INFO_VHOST
vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
ICQ #: %d
NICK_INFO_GREET
@@ -1421,6 +1423,8 @@ CHAN_CLEARED_VOICES
Œëá ôá Mode +v Ý÷åé êáèáñéóôåß áðü ôï êáíÜëé %s.
CHAN_CLEARED_USERS
Œëïé ïé ÷ñÞóôåò Ýãéíáí kick áðü ôï êáíÜëé %s.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/lang/hun.l b/lang/hun.l
index 299edf724..e6f0667ed 100644
--- a/lang/hun.l
+++ b/lang/hun.l
@@ -19,8 +19,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -577,6 +577,8 @@ NICK_INFO_EMAIL
E-mail cím: %s
NICK_INFO_VHOST
vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
ICQ #: %d
NICK_INFO_GREET
@@ -1419,6 +1421,8 @@ CHAN_CLEARED_VOICES
A (%s) csatornán minden +v mód levéve.
CHAN_CLEARED_USERS
A (%s) csatornáról minden felhasználó ki lett rúgva.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS válaszok
CHAN_GETPASS_SYNTAX
diff --git a/lang/it.l b/lang/it.l
index 780d22217..0bc0eff80 100644
--- a/lang/it.l
+++ b/lang/it.l
@@ -15,8 +15,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -579,6 +579,8 @@ NICK_INFO_EMAIL
Indirizzo e-mail: %s
NICK_INFO_VHOST
vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
Numero ICQ: %d
NICK_INFO_GREET
@@ -1422,6 +1424,8 @@ CHAN_CLEARED_VOICES
Il modo +v è stato rimosso da tutti gli utenti di %s.
CHAN_CLEARED_USERS
Tutti gli utenti sono stati kickati dal canale %s.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/lang/nl.l b/lang/nl.l
index b2d9e9b3c..8c5246760 100644
--- a/lang/nl.l
+++ b/lang/nl.l
@@ -15,8 +15,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -581,6 +581,8 @@ NICK_INFO_EMAIL
E-mail adres: %s
NICK_INFO_VHOST
vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
ICQ #: %d
NICK_INFO_GREET
@@ -1419,6 +1421,8 @@ CHAN_CLEARED_VOICES
Mode +v is verwijderd van kanaal %s.
CHAN_CLEARED_USERS
Alle users zijn gekicked van kanaal %s.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/lang/pl.l b/lang/pl.l
index 0f003be63..7d2bdbdc3 100644
--- a/lang/pl.l
+++ b/lang/pl.l
@@ -22,8 +22,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -631,6 +631,8 @@ NICK_INFO_EMAIL
Adres e-mail: %s
NICK_INFO_VHOST
vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
Numer ICQ: %d
NICK_INFO_GREET
@@ -1535,6 +1537,8 @@ CHAN_CLEARED_VOICES
Tryby +v zosta³y wyczyszczone na %s.
CHAN_CLEARED_USERS
Wszyscy u¿ytkownicy zostali wykopani z %s.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/lang/pt.l b/lang/pt.l
index 614954c5d..fe90234f8 100644
--- a/lang/pt.l
+++ b/lang/pt.l
@@ -13,8 +13,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -578,6 +578,8 @@ NICK_INFO_EMAIL
E-mail: %s
NICK_INFO_VHOST
vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
ICQ: %d
NICK_INFO_GREET
@@ -1423,6 +1425,8 @@ CHAN_CLEARED_VOICES
Mode +v foi retirado do canal %s.
CHAN_CLEARED_USERS
Todos os usuários foram kickados do canal %s.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/lang/ru.l b/lang/ru.l
index 492f065ab..a66d59570 100644
--- a/lang/ru.l
+++ b/lang/ru.l
@@ -19,8 +19,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -578,6 +578,8 @@ NICK_INFO_EMAIL
àäðåñ E-mail: %s
NICK_INFO_VHOST
Âèðòóàëüíûé õîñò: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
ICQ #: %d
NICK_INFO_GREET
@@ -1417,6 +1419,8 @@ CHAN_CLEARED_VOICES
Âñå âîéñû áûëè ñíÿòû íà êàíàëå %s.
CHAN_CLEARED_USERS
Âñå ïîëüçîâàòåëè áûëè âûêèíóòû ñ êàíàëà %s.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/lang/tr.l b/lang/tr.l
index e6959b0cb..433fcb673 100644
--- a/lang/tr.l
+++ b/lang/tr.l
@@ -13,8 +13,8 @@
# messages need to take the same parameters in the same order as the
# English messages do. (Obviously, this doesn't hold for the strftime()
# format lines immediately below.) If you can't get a natural translation
-# of a message without changing the order of the parameters, let me know
-# (achurch@dragonfire.net) which message is causing a problem and I'll see
+# of a message without changing the order of the parameters, let us know
+# (dev@anope.org) which message is causing a problem and I'll see
# what I can do.
#
# In help messages, "%S" (capital S, not lowercase) refers to the name of
@@ -584,6 +584,8 @@ NICK_INFO_EMAIL
E-mail adresi: %s
NICK_INFO_VHOST
vhost: %s
+NICK_INFO_VHOST2
+ vhost: %s@%s
NICK_INFO_ICQ
ICQ #: %d
NICK_INFO_GREET
@@ -1427,6 +1429,8 @@ CHAN_CLEARED_VOICES
Mod +v %s kanalýnda temizlendi.
CHAN_CLEARED_USERS
%s kanalýndaki tüm kullanýcýlar atýldý.
+CHAN_CLEARED_INVITES
+ All invites on channel %s have been removed.
# GETPASS responses
CHAN_GETPASS_SYNTAX
diff --git a/src/Makefile b/src/Makefile
index 7db726aa3..dd672c721 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,13 +1,13 @@
MYSQL_OBJ = $(MYSQL:.c=.o)
RDB_OBJ = $(RDB:.c=.o)
-OBJS = actions.o botserv.o channels.o chanserv.o commands.o compat.o converter.o \
+OBJS = actions.o base64.o botserv.o channels.o chanserv.o commands.o compat.o converter.o \
config.o datafiles.o encrypt.o helpserv.o hostserv.o init.o language.o list.o log.o mail.o main.o \
memory.o memoserv.o messages.o misc.o modules.o news.o nickserv.o operserv.o \
process.o proxy.o send.o servers.o sessions.o slist.o sockutil.o \
timeout.o users.o dreamforge.o bahamut.o unreal31.o ultimate2.o ultimate3.o \
hybrid.o ptlink.o viagra.o rageircd.o unreal32.o \
$(VSNPRINTF_O) $(RDB_OBJ) $(MYSQL_OBJ)
-SRCS = actions.c botserv.c channels.c chanserv.c commands.c compat.c converter.c \
+SRCS = actions.c base64.c botserv.c channels.c chanserv.c commands.c compat.c converter.c \
config.c datafiles.c encrypt.c helpserv.c hostserv.c init.c language.c list.c log.c mail.c main.c \
memory.c memoserv.c messages.c misc.c modules.c news.c nickserv.c operserv.c \
process.c proxy.c send.c servers.c sessions.c slist.c sockutil.c \
diff --git a/src/actions.c b/src/actions.c
index a863eae76..1cfcdf2e1 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -113,12 +113,16 @@ void common_unban(ChannelInfo * ci, char *nick)
int count, i;
char *av[3], **bans;
User *u;
+ char *host;
- if (!ci || !ci->c || !ci->bi || !nick)
+ if (!ci || !ci->c || !nick)
return;
+
if (!(u = finduser(nick)))
return;
+ host = host_resolve(u->host);
+
if (ircd->svsmode_unban) {
anope_cmd_unban(ci->name, nick);
} else {
@@ -131,7 +135,15 @@ void common_unban(ChannelInfo * ci, char *nick)
if (match_usermask(bans[i], u)) {
anope_cmd_mode(whosends(ci), ci->name, "-b %s", bans[i]);
av[2] = bans[i];
- do_cmode(ci->bi->nick, 3, av);
+ do_cmode(whosends(ci), 3, av);
+ }
+ if (host) {
+ if (match_userip(bans[i], u, host)) {
+ anope_cmd_mode(whosends(ci), ci->name, "-b %s",
+ bans[i]);
+ av[2] = bans[i];
+ do_cmode(whosends(ci), 3, av);
+ }
}
}
free(bans);
diff --git a/src/bahamut.c b/src/bahamut.c
index 468d3be46..e54627faf 100644
--- a/src/bahamut.c
+++ b/src/bahamut.c
@@ -91,6 +91,9 @@ IRCDVar ircd[] = {
1,
1, /* No Knock requires +i */
NULL, /* CAPAB Chan Modes */
+ 0, /* We support TOKENS */
+ 1, /* TOKENS are CASE inSensitive */
+ 1, /* validate - to the #:# standard */
}
,
{NULL}
@@ -195,29 +198,55 @@ void anope_set_umode(User * user, int ac, char **av)
}
-
-
unsigned long umodes[128] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, UMODE_A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,
- 0,
- UMODE_R,
- 0, 0, 0, 0, 0, 0, 0,
- 0,
- 0, 0, 0, 0, 0,
- 0, UMODE_a, 0, 0, 0, 0, 0,
- 0,
- UMODE_h, UMODE_i, 0, 0, 0, 0, 0, UMODE_o,
- 0,
- 0, UMODE_r, 0, 0, 0, 0, UMODE_w,
- 0,
- 0,
- 0,
- 0, 0, 0, 0, 0
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Horzontal Tab */
+ 0, 0, 0, /* Line Feed, Unused, Unused */
+ 0, 0, 0, /* Carriage Return, Unused, Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Space */
+ 0, 0, 0, /* ! " # */
+ 0, 0, 0, /* $ % & */
+ 0, 0, 0, /* ! ( ) */
+ 0, 0, 0, /* * + , */
+ 0, 0, 0, /* - . / */
+ 0, 0, /* 0 1 */
+ 0, 0, /* 2 3 */
+ 0, 0, /* 4 5 */
+ 0, 0, /* 6 7 */
+ 0, 0, /* 8 9 */
+ 0, 0, /* : ; */
+ 0, 0, 0, /* < = > */
+ 0, 0, /* ? @ */
+ UMODE_A, 0, 0, /* A B C */
+ UMODE_D, 0, UMODE_F, /* D E F */
+ 0, 0, UMODE_I, /* G H I */
+ 0, UMODE_K, 0, /* J K L */
+ 0, 0, UMODE_O, /* M N O */
+ 0, 0, UMODE_R, /* P Q R */
+ 0, 0, 0, /* S T U */
+ 0, 0, UMODE_X, /* V W X */
+ 0, /* Y */
+ 0, /* Z */
+ 0, 0, 0, /* [ \ ] */
+ 0, 0, 0, /* ^ _ ` */
+ UMODE_a, UMODE_b, UMODE_c, /* a b c */
+ UMODE_d, UMODE_e, UMODE_f, /* d e f */
+ UMODE_g, UMODE_h, UMODE_i, /* g h i */
+ UMODE_j, UMODE_k, 0, /* j k l */
+ UMODE_m, UMODE_n, UMODE_o, /* m n o */
+ 0, 0, UMODE_r, /* p q r */
+ UMODE_s, 0, 0, /* s t u */
+ 0, 0, UMODE_x, /* v w x */
+ UMODE_y, /* y */
+ 0, /* z */
+ 0, 0, 0, /* { | } */
+ 0, 0 /* ~ ‚ */
};
char csmodes[128] = {
@@ -505,7 +534,7 @@ int anope_event_os(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_OperServ, av[0]);
return MOD_CONT;
}
@@ -514,7 +543,7 @@ int anope_event_ns(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_NickServ, av[0]);
return MOD_CONT;
}
@@ -523,7 +552,7 @@ int anope_event_ms(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_MemoServ, av[0]);
return MOD_CONT;
}
@@ -532,7 +561,7 @@ int anope_event_hs(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_HostServ, av[0]);
return MOD_CONT;
}
@@ -541,7 +570,7 @@ int anope_event_cs(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_ChanServ, av[0]);
return MOD_CONT;
}
@@ -570,7 +599,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m);
m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m);
m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m);
- m = createMessage("PASS", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m);
m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m);
m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m);
m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m);
@@ -582,7 +611,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m);
m = createMessage("AKILL", NULL); addCoreMessage(IRCD,m);
m = createMessage("GLOBOPS", NULL); addCoreMessage(IRCD,m);
- m = createMessage("GNOTICE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("GNOTICE", anope_event_gnotice); addCoreMessage(IRCD,m);
m = createMessage("GOPER", NULL); addCoreMessage(IRCD,m);
m = createMessage("RAKILL", NULL); addCoreMessage(IRCD,m);
m = createMessage("SILENCE", NULL); addCoreMessage(IRCD,m);
@@ -590,7 +619,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("SVSMODE", NULL); addCoreMessage(IRCD,m);
m = createMessage("SVSNICK", NULL); addCoreMessage(IRCD,m);
m = createMessage("SVSNOOP", NULL); addCoreMessage(IRCD,m);
- m = createMessage("SQLINE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("SQLINE", anope_event_sqline); addCoreMessage(IRCD,m);
m = createMessage("UNSQLINE", NULL); addCoreMessage(IRCD,m);
m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m);
m = createMessage("CS", anope_event_cs); addCoreMessage(IRCD,m);
@@ -607,6 +636,9 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("UNSGLINE", NULL); addCoreMessage(IRCD,m);
m = createMessage("UNSZLINE", NULL); addCoreMessage(IRCD,m);
m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
+ m = createMessage("LUSERSLOCK",anope_event_luserslock); addCoreMessage(IRCD,m);
+ m = createMessage("BURST", anope_event_burst); addCoreMessage(IRCD,m);
+ m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
}
@@ -646,6 +678,11 @@ void anope_cmd_svsnoop(char *server, int set)
send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
}
+void anope_cmd_svsadmin(char *server, int set)
+{
+ anope_cmd_svsnoop(server, set);
+}
+
/* SGLINE */
void anope_cmd_sgline(char *mask, char *reason)
{
@@ -760,6 +797,11 @@ void anope_cmd_svsmode(User * u, int ac, char **av)
}
/* SQUIT */
+/*
+ * parv[0] = sender prefix
+ * parv[1] = server name
+ * parv[2] = comment
+*/
void anope_cmd_squit(char *servname, char *message)
{
send_cmd(servname, "SQUIT %s :%s", servname, message);
@@ -783,9 +825,18 @@ void anope_cmd_connect(int servernum)
anope_cmd_capab();
anope_cmd_server(ServerName, 1, ServerDesc);
anope_cmd_svinfo();
+ anope_cmd_burst();
}
-/* SVINFO */
+
+/*
+ * SVINFO
+ * parv[0] = sender prefix
+ * parv[1] = TS_CURRENT for the server
+ * parv[2] = TS_MIN for the server
+ * parv[3] = server is standalone or connected to non-TS only
+ * parv[4] = server's idea of UTC time
+ */
void anope_cmd_svinfo()
{
send_cmd(NULL, "SVINFO 3 1 0 :%ld", time(NULL));
@@ -806,7 +857,8 @@ void anope_cmd_server(char *servname, int hop, char *descript)
/* CAPAB */
void anope_cmd_capab()
{
- send_cmd(NULL, "CAPAB NICKIP SSJOIN TS3 NOQUIT TSMODE UNCONNECT");
+ send_cmd(NULL,
+ "CAPAB SSJOIN NOQUIT BURST UNCONNECT NICKIP TSMODE TS3");
}
/* EVENT : SERVER */
@@ -818,7 +870,7 @@ int anope_event_server(char *source, int ac, char **av)
uplink = sstrdup(av[0]);
}
- do_server(source, ac, av);
+ do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1233,6 +1285,7 @@ void anope_cmd_211(const char *fmt, ...)
void anope_cmd_nick(char *nick, char *name, char *modes)
{
+ EnforceQlinedNick(nick, NULL);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, time(NULL),
modes, ServiceUser, ServiceHost, ServerName, name);
anope_cmd_sqline(nick, "Reserved for services");
@@ -1340,6 +1393,7 @@ void anope_cmd_351(char *source)
void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real,
char *modes)
{
+ EnforceQlinedNick(nick, s_BotServ);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, time(NULL),
modes, user, host, ServerName, real);
anope_cmd_sqline(nick, "Reserved for services");
@@ -1443,4 +1497,80 @@ int anope_event_sqline(char *source, int ac, char **av)
}
+int anope_event_gnotice(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_pass(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+void anope_cmd_svsjoin(char *source, char *nick, char *chan)
+{
+ /* Can not find any reference to these in Bahamut */
+}
+
+void anope_cmd_svspart(char *source, char *nick, char *chan)
+{
+ /* Can not find any reference to these in Bahamut */
+}
+
+void anope_cmd_swhois(char *source, char *who, char *mask)
+{
+ /* not supported */
+}
+
+
+void anope_cmd_burst()
+{
+ send_cmd(NULL, "BURST");
+}
+
+void anope_cmd_eob()
+{
+ send_cmd(NULL, "BURST 0");
+}
+
+int anope_event_burst(char *source, int ac, char **av)
+{
+ Server *s;
+ s = findserver(servlist, source);
+ if (!ac) {
+ /* for future use - start burst */
+ } else {
+ if (s) {
+ s->sync = 1;
+ }
+ }
+ return MOD_CONT;
+}
+
+int anope_event_luserslock(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_rehash(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_credits(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_admin(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_flood_mode_check(char *value)
+{
+ return 0;
+}
+
+
#endif
diff --git a/src/base64.c b/src/base64.c
new file mode 100644
index 000000000..f17550bba
--- /dev/null
+++ b/src/base64.c
@@ -0,0 +1,125 @@
+/* base64 routines.
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+/*
+ This is borrowed from Unreal
+*/
+
+#include "services.h"
+
+static char *int_to_base64(long);
+static long base64_to_int(char *);
+
+char *base64enc(long i)
+{
+ if (i < 0)
+ return ("0");
+ return int_to_base64(i);
+}
+
+long base64dec(char *b64)
+{
+ if (b64)
+ return base64_to_int(b64);
+ else
+ return 0;
+}
+
+/* ':' and '#' and '&' and '+' and '@' must never be in this table. */
+/* these tables must NEVER CHANGE! >) */
+char int6_to_base64_map[] = {
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D',
+ 'E', 'F',
+ 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
+ 'U', 'V',
+ 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+ 'k', 'l',
+ 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ '{', '}'
+};
+
+char base64_to_int6_map[] = {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
+ -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1,
+ -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 63, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
+};
+
+static char *int_to_base64(long val)
+{
+ /* 32/6 == max 6 bytes for representation,
+ * +1 for the null, +1 for byte boundaries
+ */
+ static char base64buf[8];
+ long i = 7;
+
+ base64buf[i] = '\0';
+
+ /* Temporary debugging code.. remove before 2038 ;p.
+ * This might happen in case of 64bit longs (opteron/ia64),
+ * if the value is then too large it can easily lead to
+ * a buffer underflow and thus to a crash. -- Syzop
+ */
+ if (val > 2147483647L) {
+ abort();
+ }
+
+ do {
+ base64buf[--i] = int6_to_base64_map[val & 63];
+ }
+ while (val >>= 6);
+
+ return base64buf + i;
+}
+
+static long base64_to_int(char *b64)
+{
+ int v = base64_to_int6_map[(u_char) * b64++];
+
+ if (!b64)
+ return 0;
+
+ while (*b64) {
+ v <<= 6;
+ v += base64_to_int6_map[(u_char) * b64++];
+ }
+
+ return v;
+}
+
+long base64dects(char *ts)
+{
+ char *token;
+
+ if (!ts) {
+ return 0;
+ }
+ token = myStrGetToken(ts, '!', 1);
+
+ if (!token) {
+ return strtoul(ts, NULL, 10);;
+ }
+ return base64dec(token);
+}
diff --git a/src/botserv.c b/src/botserv.c
index 03fdafdf5..d38ab917c 100644
--- a/src/botserv.c
+++ b/src/botserv.c
@@ -1236,46 +1236,9 @@ static int do_bot(User * u)
**/
/* Check whether it's a services client's nick and return if so - Certus */
+ /* use nickIsServices reduce the total number lines of code - TSL */
- if ((s_NickServ && (stricmp(nick, s_NickServ) == 0))
- || (s_NickServAlias && !stricmp(nick, s_NickServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_ChanServ && (stricmp(nick, s_ChanServ) == 0))
- || (s_ChanServAlias
- && !stricmp(nick, s_ChanServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_MemoServ && (stricmp(nick, s_MemoServ) == 0))
- || (s_MemoServAlias
- && !stricmp(nick, s_MemoServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_BotServ && (stricmp(nick, s_BotServ) == 0))
- || (s_BotServAlias
- && !stricmp(nick, s_BotServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_HelpServ && (stricmp(nick, s_HelpServ) == 0))
- || (s_HelpServAlias
- && !stricmp(nick, s_HelpServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_OperServ && (stricmp(nick, s_OperServ) == 0))
- || (s_OperServAlias
- && !stricmp(nick, s_OperServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else
- if ((s_GlobalNoticer
- && (stricmp(nick, s_GlobalNoticer) == 0))
- || (s_GlobalNoticerAlias
- && !stricmp(nick, s_GlobalNoticerAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_HostServ && (stricmp(nick, s_HostServ) == 0))
- || (s_HostServAlias
- && !stricmp(nick, s_HostServAlias))) {
+ if (nickIsServices(nick, 0)) {
notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
return MOD_CONT;
}
@@ -1342,43 +1305,8 @@ static int do_bot(User * u)
}
/* Check whether it's a services client's nick and return if so - Certus */
- if ((s_NickServ && !stricmp(nick, s_NickServ))
- || (s_NickServAlias && !stricmp(nick, s_NickServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_ChanServ && !stricmp(nick, s_ChanServ))
- || (s_ChanServAlias
- && !stricmp(nick, s_ChanServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_MemoServ && !stricmp(nick, s_MemoServ))
- || (s_MemoServAlias
- && !stricmp(nick, s_MemoServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_BotServ && !stricmp(nick, s_BotServ))
- || (s_BotServAlias
- && !stricmp(nick, s_BotServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_HelpServ && !stricmp(nick, s_HelpServ))
- || (s_HelpServAlias
- && !stricmp(nick, s_HelpServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_OperServ && !stricmp(nick, s_OperServ))
- || (s_OperServAlias
- && !stricmp(nick, s_OperServAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_GlobalNoticer && !stricmp(nick, s_GlobalNoticer))
- || (s_GlobalNoticerAlias
- && !stricmp(nick, s_GlobalNoticerAlias))) {
- notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
- return MOD_CONT;
- } else if ((s_HostServ && !stricmp(nick, s_HostServ))
- || (s_HostServAlias
- && !stricmp(nick, s_HostServAlias))) {
+ /* use nickIsServices() to reduce the number of lines of code - TSL */
+ if (nickIsServices(nick, 0)) {
notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
return MOD_CONT;
}
diff --git a/src/channels.c b/src/channels.c
index ebee50403..2b871853d 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -21,11 +21,13 @@ Channel *chanlist[1024];
void add_ban(Channel * chan, char *mask);
void add_exception(Channel * chan, char *mask);
+void add_invite(Channel * chan, char *mask);
void chan_adduser2(User * user, Channel * c);
Channel *chan_create(char *chan);
void chan_delete(Channel * c);
void del_ban(Channel * chan, char *mask);
void del_exception(Channel * chan, char *mask);
+void del_invite(Channel * chan, char *mask);
char *get_flood(Channel * chan);
char *get_key(Channel * chan);
char *get_limit(Channel * chan);
@@ -390,6 +392,13 @@ void get_channel_stats(long *nrec, long *memuse)
mem += strlen(chan->excepts[j]) + 1;
}
}
+ if (ircd->invitemode) {
+ mem += sizeof(char *) * chan->invitesize;
+ for (j = 0; j < chan->invitecount; j++) {
+ if (chan->invite[j])
+ mem += strlen(chan->invite[j]) + 1;
+ }
+ }
for (cu = chan->users; cu; cu = cu->next) {
mem += sizeof(*cu);
if (cu->ud) {
@@ -618,22 +627,48 @@ void do_part(const char *source, int ac, char **av)
av[0] = timestamp
av[1] = user
+ ============================================================
+
+ Unreal SJOIN
+
+ On Connect there is
+ SJOIN !11LkOb #ircops +nt :@Trystan
+
+ av[0] = time stamp (base64)
+ av[1] = channel
+ av[2] = modes
+ av[3] = users + bans
+
+ On Channel Creation or a User joins an existing
+ Luna.NomadIrc.Net SJOIN !11LkW9 #akill :@Trystan
+ Luna.NomadIrc.Net SJOIN !11LkW9 #akill :Trystan`
+
+ av[0] = time stamp (base64)
+ av[1] = channel
+ av[2] = users
+
*/
void do_sjoin(const char *source, int ac, char **av)
{
Channel *c;
User *user;
+ char *s, *end, cubuf[ircd->max_symbols + 2], *end2,
+ *cumodes[ircd->max_symbols + 1];
+
int is_sqlined = 0;
+ int ts = 0;
+
+ if (ircd->sjb64) {
+ ts = base64dects(av[0]);
+ } else {
+ ts = strtoul(av[0], NULL, 10);
+ }
/* Double check to avoid unknown modes that need parameters */
if (ac >= 4 && ac <= 6) {
- char *s, *end, cubuf[ircd->max_symbols + 2], *end2,
- *cumodes[ircd->max_symbols + 1];
-
c = findchan(av[1]);
-
if (ircd->chansqline) {
if (!c)
is_sqlined = check_chan_sqline(av[1]);
@@ -651,6 +686,26 @@ void do_sjoin(const char *source, int ac, char **av)
*end = 0;
end2 = cubuf + 1;
+
+#ifdef SJOINBANNCHAR
+ if (*s == SJOINBANNCHAR) {
+ add_ban(c, myStrGetToken(s, SJOINBANNCHAR, 1));
+ if (!end)
+ break;
+ s = end + 1;
+ continue;
+ }
+#endif
+#ifdef SJOINEXCEPTIONCHAR
+ if (*s == SJOINEXCEPTIONCHAR) {
+ add_exception(c, myStrGetToken(s, SJOINEXCEPTIONCHAR, 1));
+ if (!end)
+ break;
+ s = end + 1;
+ continue;
+ }
+#endif
+
while (csmodes[(int) *s] != 0)
*end2++ = csmodes[(int) *s++];
*end2 = 0;
@@ -693,10 +748,75 @@ void do_sjoin(const char *source, int ac, char **av)
if (c) {
/* Set the timestamp */
- c->creation_time = strtoul(av[0], NULL, 10);
+ c->creation_time = ts;
/* We now update the channel mode. */
chan_set_modes(source, c, ac - 3, &av[2], 1);
}
+
+ /* Unreal just had to be different */
+ } else if (ac == 3) {
+ c = findchan(av[1]);
+ if (ircd->chansqline) {
+ if (!c)
+ is_sqlined = check_chan_sqline(av[1]);
+ }
+
+ cubuf[0] = '+';
+ cumodes[0] = cubuf;
+
+ /* We make all the users join */
+ s = av[2]; /* Users are always the last element */
+
+ while (*s) {
+ end = strchr(s, ' ');
+ if (end)
+ *end = 0;
+
+ end2 = cubuf + 1;
+
+ while (csmodes[(int) *s] != 0)
+ *end2++ = csmodes[(int) *s++];
+ *end2 = 0;
+
+ user = finduser(s);
+ if (!user) {
+ alog("user: SJOIN for nonexistent user %s on %s", s,
+ av[1]);
+ return;
+ }
+
+ if (is_sqlined && !is_oper(user)) {
+ anope_cmd_kick(s_OperServ, av[1], s, "Q-Lined");
+ } else {
+ if (!check_kick(user, av[1])) {
+ /* Make the user join; if the channel does not exist it
+ * will be created there. This ensures that the channel
+ * is not created to be immediately destroyed, and
+ * that the locked key or topic is not shown to anyone
+ * who joins the channel when empty.
+ */
+ c = join_user_update(user, c, av[1]);
+
+ /* We update user mode on the channel */
+ if (end2 - cubuf > 1) {
+ int i;
+
+ for (i = 1; i < end2 - cubuf; i++)
+ cumodes[i] = user->nick;
+ chan_set_modes(source, c, 1 + (end2 - cubuf - 1),
+ cumodes, 1);
+ }
+ }
+ }
+
+ if (!end)
+ break;
+ s = end + 1;
+ }
+
+ if (c) {
+ c->creation_time = ts;
+ }
} else if (ac == 2) {
user = finduser(source);
if (!user) {
@@ -718,7 +838,7 @@ void do_sjoin(const char *source, int ac, char **av)
anope_cmd_kick(s_OperServ, av[1], user->nick, "Q-Lined");
} else {
c = join_user_update(user, c, av[1]);
- c->creation_time = strtoul(av[0], NULL, 10);
+ c->creation_time = ts;
}
}
}
@@ -786,7 +906,16 @@ void do_cmode(const char *source, int ac, char **av)
void do_topic(const char *source, int ac, char **av)
{
Channel *c = findchan(av[0]);
- time_t topic_time = strtoul(av[2], NULL, 10);
+ int ts;
+ time_t topic_time;
+
+ if (ircd->sjb64) {
+ ts = base64dects(av[0]);
+ } else {
+ ts = strtoul(av[0], NULL, 10);
+ }
+
+ topic_time = ts;
if (!c) {
alog("channel: TOPIC %s for nonexistent channel %s",
@@ -856,6 +985,21 @@ void add_exception(Channel * chan, char *mask)
/*************************************************************************/
+void add_invite(Channel * chan, char *mask)
+{
+ if (chan->invitecount >= chan->invitesize) {
+ chan->invitesize += 8;
+ chan->invite =
+ srealloc(chan->invite, sizeof(char *) * chan->invitesize);
+ }
+ chan->invite[chan->invitecount++] = sstrdup(mask);
+
+ if (debug)
+ alog("debug: Added invite %s to channel %s", mask, chan->name);
+}
+
+/*************************************************************************/
+
/* Add/remove a user to/from a channel, creating or deleting the channel as
* necessary. If creating the channel, restore mode lock and topic as
* necessary. Also check for auto-opping and auto-voicing.
@@ -1012,13 +1156,25 @@ void chan_delete(Channel * c)
if (c->excepts[i])
free(c->excepts[i]);
else
- alog("channel: BUG freeing %s: exceps[%d] is NULL!",
+ alog("channel: BUG freeing %s: excepts[%d] is NULL!",
c->name, i);
}
if (c->exceptsize)
free(c->excepts);
}
+ if (ircd->invitemode) {
+ for (i = 0; i < c->invitecount; ++i) {
+ if (c->invite[i])
+ free(c->invite[i]);
+ else
+ alog("channel: BUG freeing %s: invite[%d] is NULL!",
+ c->name, i);
+ }
+ if (c->invitesize)
+ free(c->invite);
+ }
+
if (c->next)
c->next->prev = c->prev;
if (c->prev)
@@ -1037,6 +1193,11 @@ void del_ban(Channel * chan, char *mask)
int i = 0;
AutoKick *akick;
+ /* Sanity check as it seems some IRCD will just send -b without a mask */
+ if (!mask) {
+ return;
+ }
+
while (i < chan->bancount && strcmp(*s, mask) != 0) {
i++;
s++;
@@ -1063,6 +1224,11 @@ void del_exception(Channel * chan, char *mask)
int i;
int reset = 0;
+ /* Sanity check as it seems some IRCD will just send -e without a mask */
+ if (!mask) {
+ return;
+ }
+
for (i = 0; i < chan->exceptcount; i++) {
if ((!reset) && (stricmp(chan->excepts[i], mask) == 0)) {
free(chan->excepts[i]);
@@ -1082,6 +1248,36 @@ void del_exception(Channel * chan, char *mask)
/*************************************************************************/
+void del_invite(Channel * chan, char *mask)
+{
+ int i;
+ int reset = 0;
+
+ /* Sanity check as it seems some IRCD will just send -I without a mask */
+ if (!mask) {
+ return;
+ }
+
+ for (i = 0; i < chan->invitecount; i++) {
+ if ((!reset) && (stricmp(chan->invite[i], mask) == 0)) {
+ free(chan->invite[i]);
+ reset = 1;
+ }
+ if (reset)
+ chan->invite[i] =
+ (i == chan->invitecount) ? NULL : chan->invite[i + 1];
+ }
+
+ if (reset)
+ chan->invitecount--;
+
+ if (debug)
+ alog("debug: Deleted invite %s to channel %s", mask, chan->name);
+}
+
+
+/*************************************************************************/
+
char *get_flood(Channel * chan)
{
return chan->flood;
@@ -1148,7 +1344,7 @@ void set_flood(Channel * chan, char *value)
chan->flood = value ? sstrdup(value) : NULL;
if (debug)
- alog("debug: Flood of channel %s set to %s", chan->name,
+ alog("debug: Flood mode for channel %s set to %s", chan->name,
chan->flood ? chan->flood : "no flood settings");
}
diff --git a/src/chanserv.c b/src/chanserv.c
index e210ac5ac..712c22560 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -2038,20 +2038,37 @@ int delchan(ChannelInfo * ci)
int i;
NickCore *nc = ci->founder;
+ if (debug >= 2) {
+ alog("debug: delchan removing %s", ci->name);
+ }
+
if (ci->bi) {
ci->bi->chancount--;
}
+
+ if (debug >= 2) {
+ alog("debug: delchan top of removing the bot");
+ }
if (ci->c) {
if (ci->bi && ci->c->usercount >= BSMinUsers) {
anope_cmd_part(ci->bi->nick, ci->c->name, NULL);
}
ci->c->ci = NULL;
}
+ if (debug >= 2) {
+ alog("debug: delchan() Bot has been removed moving on");
+ }
#ifdef USE_RDB
+ if (debug >= 2) {
+ alog("debug: delchan() rdb updating");
+ }
if (rdb_open()) {
rdb_cs_delchan(ci);
rdb_close();
}
+ if (debug >= 2) {
+ alog("debug: delchan() rdb done");
+ }
#endif
if (ci->next)
ci->next->prev = ci->prev;
@@ -2079,6 +2096,9 @@ int delchan(ChannelInfo * ci)
free(ci->forbidreason);
if (ci->access)
free(ci->access);
+ if (debug >= 2) {
+ alog("debug: delchan() top of the akick list");
+ }
for (i = 0; i < ci->akickcount; i++) {
if (!(ci->akick[i].flags & AK_ISNICK) && ci->akick[i].u.mask)
free(ci->akick[i].u.mask);
@@ -2087,10 +2107,16 @@ int delchan(ChannelInfo * ci)
if (ci->akick[i].creator)
free(ci->akick[i].creator);
}
+ if (debug >= 2) {
+ alog("debug: delchan() done with the akick list");
+ }
if (ci->akick)
free(ci->akick);
if (ci->levels)
free(ci->levels);
+ if (debug >= 2) {
+ alog("debug: delchan() top of the memo list");
+ }
if (ci->memos.memos) {
for (i = 0; i < ci->memos.memocount; i++) {
if (ci->memos.memos[i].text)
@@ -2099,21 +2125,38 @@ int delchan(ChannelInfo * ci)
}
free(ci->memos.memos);
}
+ if (debug >= 2) {
+ alog("debug: delchan() done with the memo list");
+ }
if (ci->ttb)
free(ci->ttb);
+
+ if (debug >= 2) {
+ alog("debug: delchan() top of the badword list");
+ }
for (i = 0; i < ci->bwcount; i++) {
if (ci->badwords[i].word)
free(ci->badwords[i].word);
}
if (ci->badwords)
free(ci->badwords);
+ if (debug >= 2) {
+ alog("debug: delchan() done with the badword list");
+ }
+
+ if (debug >= 2) {
+ alog("debug: delchan() calling on moduleCleanStruct()");
+ }
moduleCleanStruct(&ci->moduleData);
free(ci);
if (nc)
nc->channelcount--;
+ if (debug >= 2) {
+ alog("debug: delchan() all done");
+ }
return 1;
}
@@ -2342,16 +2385,11 @@ char *cs_get_redirect(ChannelInfo * ci)
void cs_set_flood(ChannelInfo * ci, char *value)
{
- char *dp, *end;
-
if (ci->mlock_flood)
free(ci->mlock_flood);
/* This looks ugly, but it works ;) */
- if (value && *value != ':'
- && (strtoul((*value == '*' ? value + 1 : value), &dp, 10) > 0)
- && (*dp == ':') && (*(++dp) != 0) && (strtoul(dp, &end, 10) > 0)
- && (*end == 0)) {
+ if (anope_flood_mode_check(value)) {
ci->mlock_flood = sstrdup(value);
} else {
ci->mlock_on &= ~ircd->chan_fmode;
@@ -5645,6 +5683,30 @@ static int do_clear(User * u)
}
notice_lang(s_ChanServ, u, CHAN_CLEARED_EXCEPTS, chan);
free(excepts);
+
+ } else if (ircd->invitemode && stricmp(what, "invites") == 0) {
+ char *av[3];
+ int i;
+
+ /* Save original except info */
+ int count = c->invitecount;
+ char **invites = scalloc(sizeof(char *) * count, 1);
+ for (i = 0; i < count; i++)
+ invites[i] = sstrdup(c->invite[i]);
+
+ for (i = 0; i < count; i++) {
+ av[0] = sstrdup(chan);
+ av[1] = sstrdup("-I");
+ av[2] = invites[i];
+ anope_cmd_mode(whosends(ci), av[0], "%s :%s", av[1], av[2]);
+ do_cmode(s_ChanServ, 3, av);
+ free(av[2]);
+ free(av[1]);
+ free(av[0]);
+ }
+ notice_lang(s_ChanServ, u, CHAN_CLEARED_INVITES, chan);
+ free(invites);
+
} else if (stricmp(what, "modes") == 0) {
char buf[BUFSIZE], *end = buf;
char *argv[2];
diff --git a/src/config.c b/src/config.c
index 8bbbd077d..31dc59fa7 100644
--- a/src/config.c
+++ b/src/config.c
@@ -117,6 +117,8 @@ int DumpCore;
int LogUsers;
int NickRegDelay;
int UseSVSHOLD;
+int UseTokens;
+int UseSVS2MODE;
int UseMail;
char *SendMailPath;
@@ -622,6 +624,8 @@ Directive directives[] = {
{"UserKey2", {{PARAM_POSINT, PARAM_RELOAD, &UserKey2}}},
{"UserKey3", {{PARAM_POSINT, PARAM_RELOAD, &UserKey3}}},
{"UseSVSHOLD", {{PARAM_SET, PARAM_RELOAD, &UseSVSHOLD}}},
+ {"UseSVS2MODE", {{PARAM_SET, PARAM_RELOAD, &UseSVS2MODE}}},
+ {"UseTokens", {{PARAM_SET, 0, &UseTokens}}},
{"WallAkillExpire", {{PARAM_SET, PARAM_RELOAD, &WallAkillExpire}}},
{"WallBadOS", {{PARAM_SET, PARAM_RELOAD, &WallBadOS}}},
{"WallDrop", {{PARAM_SET, PARAM_RELOAD, &WallDrop}}},
@@ -941,7 +945,7 @@ int read_config(int reload)
CHECK(RemoteServer2);
}
if (!reload) {
- if (LocalHost) {
+ if (LocalHost && RemoteServer) {
if ((!stricmp(LocalHost, RemoteServer))
&& LocalPort == RemotePort) {
printf
@@ -1319,6 +1323,13 @@ int read_config(int reload)
CHECK(DefconMessage);
}
+ if (UseTokens) {
+ if (!ircd->token) {
+ alog("Anope does not support TOKENS for this ircd setting unsetting UseToken");
+ UseTokens = 0;
+ }
+ }
+
/**
* If they try to enable any email registration option,
* make sure they have everything else they need too...
diff --git a/src/dreamforge.c b/src/dreamforge.c
index 6cdec5745..7ec4fd081 100644
--- a/src/dreamforge.c
+++ b/src/dreamforge.c
@@ -89,6 +89,10 @@ IRCDVar ircd[] = {
0,
1, /* No Knock requires +i */
NULL, /* CAPAB Chan Modes */
+ 0, /* We support TOKENS */
+ 1, /* TOKENS are CASE inSensitive */
+ 0, /* TIME STAMPS are BASE64 */
+ 0, /* +I support */
}
,
{NULL}
@@ -185,27 +189,56 @@ void anope_set_umode(User * user, int ac, char **av)
}
}
+
unsigned long umodes[128] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, UMODE_A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,
- 0,
- 0,
- 0, 0, 0, 0, 0, 0, 0,
- 0,
- 0, 0, 0, 0, 0,
- 0, UMODE_a, 0, 0, 0, 0, 0,
- UMODE_g,
- UMODE_h, UMODE_i, 0, 0, 0, 0, 0, UMODE_o,
- 0,
- 0, UMODE_r, 0, 0, 0, 0, UMODE_w,
- 0,
- 0,
- 0,
- 0, 0, 0, 0, 0
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Horzontal Tab */
+ 0, 0, 0, /* Line Feed, Unused, Unused */
+ 0, 0, 0, /* Carriage Return, Unused, Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Space */
+ 0, 0, 0, /* ! " # */
+ 0, 0, 0, /* $ % & */
+ 0, 0, 0, /* ! ( ) */
+ 0, 0, 0, /* * + , */
+ 0, 0, 0, /* - . / */
+ 0, 0, /* 0 1 */
+ 0, 0, /* 2 3 */
+ 0, 0, /* 4 5 */
+ 0, 0, /* 6 7 */
+ 0, 0, /* 8 9 */
+ 0, 0, /* : ; */
+ 0, 0, 0, /* < = > */
+ 0, 0, /* ? @ */
+ UMODE_A, 0, 0, /* A B C */
+ 0, 0, 0, /* D E F */
+ 0, 0, 0, /* G H I */
+ 0, 0, 0, /* J K L */
+ 0, 0, UMODE_O, /* M N O */
+ 0, 0, 0, /* P Q R */
+ 0, 0, 0, /* S T U */
+ 0, 0, 0, /* V W X */
+ 0, /* Y */
+ 0, /* Z */
+ 0, 0, 0, /* [ \ ] */
+ 0, 0, 0, /* ^ _ ` */
+ UMODE_a, 0, UMODE_c, /* a b c */
+ 0, 0, UMODE_f, /* d e f */
+ UMODE_g, UMODE_h, UMODE_i, /* g h i */
+ 0, UMODE_k, 0, /* j k l */
+ 0, 0, UMODE_o, /* m n o */
+ 0, 0, UMODE_r, /* p q r */
+ UMODE_s, 0, 0, /* s t u */
+ 0, 0, 0, /* v w x */
+ 0, /* y */
+ 0, /* z */
+ 0, 0, 0, /* { | } */
+ 0, 0 /* ~ ‚ */
};
char csmodes[128] = {
@@ -447,6 +480,10 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("UNSQLINE", NULL); addCoreMessage(IRCD,m);
m = createMessage("PROTOCTL", anope_event_capab); addCoreMessage(IRCD,m);
+ m = createMessage("REHASH", anope_event_rehash); addCoreMessage(IRCD,m);
+ m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
+ m = createMessage("CREDITS", anope_event_credits); addCoreMessage(IRCD,m);
+
}
@@ -469,6 +506,11 @@ void anope_cmd_svsnoop(char *server, int set)
send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
}
+void anope_cmd_svsadmin(char *server, int set)
+{
+ anope_cmd_svsnoop(server, set);
+}
+
void anope_cmd_remove_akill(char *user, char *host)
{
send_cmd(NULL, "RAKILL %s %s", host, user);
@@ -563,6 +605,7 @@ void anope_pong(char *servname)
void anope_cmd_connect(int servernum)
{
+ anope_cmd_capab();
if (servernum == 1)
anope_cmd_pass(RemotePassword);
if (servernum == 2)
@@ -578,6 +621,11 @@ void anope_cmd_pass(char *pass)
send_cmd(NULL, "PASS :%s", pass);
}
+void anope_cmd_capab()
+{
+ send_cmd(NULL, "PROTOCTL NOQUIT");
+}
+
void anope_cmd_bot_chan_mode(char *nick, char *chan)
{
anope_cmd_mode(nick, chan, "%s %s %s", ircd->botchanumode, nick, nick);
@@ -1016,6 +1064,7 @@ void anope_cmd_211(const char *fmt, ...)
void anope_cmd_nick(char *nick, char *name, char *modes)
{
+ EnforceQlinedNick(nick, NULL);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", nick, time(NULL),
ServiceUser, ServiceHost, ServerName, name);
anope_cmd_mode(nick, nick, "%s", modes);
@@ -1049,7 +1098,7 @@ int anope_event_server(char *source, int ac, char **av)
if (!stricmp(av[1], "1"))
uplink = sstrdup(av[0]);
- do_server(source, ac, av);
+ do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1127,6 +1176,7 @@ void anope_cmd_pong(char *servname, char *who)
void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real,
char *modes)
{
+ EnforceQlinedNick(nick, s_BotServ);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", nick, time(NULL),
user, host, ServerName, real);
anope_cmd_mode(nick, "MODE %s %s", nick, modes);
@@ -1245,4 +1295,44 @@ void anope_cmd_chg_nick(char *oldnick, char *newnick)
send_cmd(oldnick, "NICK %s", newnick);
}
+void anope_cmd_svsjoin(char *source, char *nick, char *chan)
+{
+ /* Not Supported by this IRCD */
+}
+
+void anope_cmd_svspart(char *source, char *nick, char *chan)
+{
+ /* Not Supported by this IRCD */
+}
+
+void anope_cmd_swhois(char *source, char *who, char *mask)
+{
+ /* not supported */
+}
+
+int anope_event_rehash(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_credits(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_admin(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_flood_mode_check(char *value)
+{
+ return 0;
+}
+
+void anope_cmd_eob()
+{
+ /* Not supported */
+}
+
#endif
diff --git a/src/hostserv.c b/src/hostserv.c
index 4c862e8b3..94e8354f8 100644
--- a/src/hostserv.c
+++ b/src/hostserv.c
@@ -33,9 +33,6 @@ HostCore *insertHostCore(HostCore * head, HostCore * prev, char *nick,
HostCore *deleteHostCore(HostCore * head, HostCore * prev);
void delHostCore(char *nick);
-char *getvIdent(char *nick);
-char *getvHost(char *nick);
-
int is_host_setter(User * u);
int is_host_remover(User * u);
@@ -881,6 +878,10 @@ int do_set(User * u)
tmp_time = time(NULL);
if ((na = findnick(nick))) {
+ if (na->status & NS_VERBOTEN) {
+ notice_lang(s_HostServ, u, NICK_X_FORBIDDEN, nick);
+ return MOD_CONT;
+ }
alog("vHost for user \002%s\002 set to \002%s\002 by oper \002%s\002", nick, hostmask, u->nick);
addHostCore(nick, vIdent, hostmask, u->nick, tmp_time);
if (vIdent) {
diff --git a/src/hybrid.c b/src/hybrid.c
index b769d7a8e..1247af6ee 100644
--- a/src/hybrid.c
+++ b/src/hybrid.c
@@ -40,7 +40,7 @@ IRCDVar ircd[] = {
"+io", /* Global alias mode */
"+", /* Used by BotServ Bots */
3, /* Chan Max Symbols */
- "aiklmnpst", /* Modes to Remove */
+ "-aiklmnpst", /* Modes to Remove */
"+o", /* Channel Umode used by Botserv bots */
0, /* SVSNICK */
0, /* Vhost */
@@ -89,6 +89,10 @@ IRCDVar ircd[] = {
0, /* On nick change check if they could be identified */
0, /* No Knock requires +i */
NULL, /* CAPAB Chan Modes */
+ 0, /* We support TOKENS */
+ 1, /* TOKENS are CASE inSensitive */
+ 0, /* TIME STAMPS are BASE64 */
+ 0, /* +I support */
}
,
{NULL}
@@ -96,7 +100,7 @@ IRCDVar ircd[] = {
IRCDCAPAB ircdcap[] = {
{
- 0, /* NOQUIT */
+ CAPAB_NOQUIT, /* NOQUIT */
0, /* TSMODE */
0, /* UNCONNECT */
0, /* NICKIP */
@@ -189,36 +193,65 @@ void anope_set_umode(User * user, int ac, char **av)
}
unsigned long umodes[128] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, UMODE_A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,
- 0,
- 0,
- 0, 0, 0, 0, 0, 0, 0,
- 0,
- 0, 0, 0, 0, 0,
- 0, UMODE_a, 0, 0, 0, 0, 0,
- 0,
- UMODE_h, UMODE_i, 0, 0, 0, 0, 0, UMODE_o,
- 0,
- 0, UMODE_r, 0, 0, 0, 0, UMODE_w,
- 0,
- 0,
- 0,
- 0, 0, 0, 0, 0
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Horzontal Tab */
+ 0, 0, 0, /* Line Feed, Unused, Unused */
+ 0, 0, 0, /* Carriage Return, Unused, Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Space */
+ 0, 0, 0, /* ! " # */
+ 0, 0, 0, /* $ % & */
+ 0, 0, 0, /* ! ( ) */
+ 0, 0, 0, /* * + , */
+ 0, 0, 0, /* - . / */
+ 0, 0, /* 0 1 */
+ 0, 0, /* 2 3 */
+ 0, 0, /* 4 5 */
+ 0, 0, /* 6 7 */
+ 0, 0, /* 8 9 */
+ 0, 0, /* : ; */
+ 0, 0, 0, /* < = > */
+ 0, 0, /* ? @ */
+ 0, 0, 0, /* A B C */
+ 0, 0, 0, /* D E F */
+ 0, 0, 0, /* G H I */
+ 0, 0, 0, /* J K L */
+ 0, 0, 0, /* M N O */
+ 0, 0, 0, /* P Q R */
+ 0, 0, 0, /* S T U */
+ 0, 0, 0, /* V W X */
+ 0, /* Y */
+ 0, /* Z */
+ 0, 0, 0, /* [ \ ] */
+ 0, 0, 0, /* ^ _ ` */
+ UMODE_a, UMODE_b, UMODE_c, /* a b c */
+ UMODE_d, 0, UMODE_f, /* d e f */
+ UMODE_g, 0, UMODE_i, /* g h i */
+ 0, UMODE_k, UMODE_l, /* j k l */
+ 0, UMODE_n, UMODE_o, /* m n o */
+ 0, 0, UMODE_r, /* p q r */
+ UMODE_s, 0, UMODE_u, /* s t u */
+ 0, UMODE_w, UMODE_x, /* v w x */
+ UMODE_y, /* y */
+ UMODE_z, /* z */
+ 0, 0, 0, /* { | } */
+ 0, 0 /* ~ ‚ */
};
+
char csmodes[128] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,
- 'a', /* (33) ! Channel Admins */
+ 'a', /* (33) ! */
0, 0, 0,
- 0,
+ 'h',
0, 0, 0, 0,
0,
@@ -232,22 +265,44 @@ char csmodes[128] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
-
CMMode cmmodes[128] = {
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL},
- {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL}, /* BCD */
+ {NULL}, {NULL}, {NULL}, /* EFG */
+ {NULL}, /* H */
+ {add_invite, del_invite},
+ {NULL}, /* J */
+ {NULL}, {NULL}, {NULL}, /* KLM */
+ {NULL}, {NULL}, {NULL}, /* NOP */
+ {NULL}, {NULL}, {NULL}, /* QRS */
+ {NULL}, {NULL}, {NULL}, /* TUV */
+ {NULL}, {NULL}, {NULL}, /* WXY */
+ {NULL}, /* Z */
+ {NULL}, {NULL}, /* (char 91 - 92) */
+ {NULL}, {NULL}, {NULL}, /* (char 93 - 95) */
+ {NULL}, /* ` (char 96) */
+ {NULL}, /* a (char 97) */
{add_ban, del_ban},
{NULL},
{NULL},
@@ -465,7 +520,7 @@ void anope_cmd_global(char *source, const char *fmt, ...)
return;
}
- send_cmd(source ? source : ServerName, "WALLOPS :%s", buf);
+ send_cmd(source ? source : ServerName, "OPERWALL :%s", buf);
}
@@ -538,14 +593,14 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("401", NULL); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
- m = createMessage("INVITE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("INVITE", anope_event_invite); addCoreMessage(IRCD,m);
m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m);
m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m);
m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m);
m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m);
m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m);
- m = createMessage("NOTICE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m);
m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m);
m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m);
m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m);
@@ -553,8 +608,6 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m);
m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m);
m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m);
- m = createMessage("STATS", m_stats); addCoreMessage(IRCD,m);
- m = createMessage("TIME", m_time); addCoreMessage(IRCD,m);
m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m);
m = createMessage("USER", NULL); addCoreMessage(IRCD,m);
m = createMessage("WALLOPS", NULL); addCoreMessage(IRCD,m);
@@ -575,8 +628,9 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m);
m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m);
m = createMessage("SVINFO", anope_event_svinfo); addCoreMessage(IRCD,m);
-
-
+ m = createMessage("EOB", anope_event_eob); addCoreMessage(IRCD,m);
+ m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
+ m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
}
/* *INDENT-ON* */
@@ -605,6 +659,11 @@ void anope_cmd_svsnoop(char *server, int set)
/* does not support */
}
+void anope_cmd_svsadmin(char *server, int set)
+{
+ anope_cmd_svsnoop(server, set);
+}
+
void anope_cmd_sgline(char *mask, char *reason)
{
/* does not support */
@@ -718,9 +777,30 @@ void anope_cmd_svinfo()
}
/* CAPAB */
+/*
+ QS - Can handle quit storm removal
+ EX - Can do channel +e exemptions
+ CHW - Can do channel wall @#
+ LL - Can do lazy links
+ IE - Can do invite exceptions
+ EOB - Can do EOB message
+ KLN - Can do KLINE message
+ GLN - Can do GLINE message
+ HOPS - can do half ops (+h)
+ HUB - This server is a HUB
+ AOPS - Can do anon ops (+a)
+ UID - Can do UIDs
+ ZIP - Can do ZIPlinks
+ ENC - Can do ENCrypted links
+ KNOCK - supports KNOCK
+ TBURST - supports TBURST
+ PARA - supports invite broadcasting for +p
+ ENCAP - ?
+*/
void anope_cmd_capab()
{
- send_cmd(NULL, "CAPAB TS5 EX IE HOPS HUB AOPS");
+ send_cmd(NULL,
+ "CAPAB :QS EX CHW IE EOB KLN GLN HOPS HUB AOPS KNOCK TBURST PARA");
}
/* PASS */
@@ -738,6 +818,7 @@ void anope_cmd_server(char *servname, int hop, char *descript)
void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real,
char *modes)
{
+ EnforceQlinedNick(nick, s_BotServ);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, time(NULL),
modes, user, host, ServerName, real);
@@ -799,6 +880,21 @@ int anope_event_kick(char *source, int ac, char **av)
return MOD_CONT;
}
+int anope_event_eob(char *source, int ac, char **av)
+{
+ Server *s;
+ s = findserver(servlist, source);
+ if (s) {
+ s->sync = 1;
+ }
+ return MOD_CONT;
+}
+
+void anope_cmd_eob()
+{
+ send_cmd(ServerName, "EOB");
+}
+
int anope_event_join(char *source, int ac, char **av)
{
@@ -849,7 +945,7 @@ int anope_event_server(char *source, int ac, char **av)
if (!stricmp(av[1], "1"))
uplink = sstrdup(av[0]);
- do_server(source, ac, av);
+ do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1106,6 +1202,7 @@ void anope_cmd_mode(char *source, char *dest, const char *fmt, ...)
void anope_cmd_nick(char *nick, char *name, char *mode)
{
+ EnforceQlinedNick(nick, NULL);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, time(NULL), mode,
ServiceUser, ServiceHost, ServerName, (name));
}
@@ -1150,7 +1247,7 @@ void anope_cmd_notice_ops(char *source, char *dest, const char *fmt, ...)
void anope_cmd_bot_chan_mode(char *nick, char *chan)
{
- anope_cmd_mode(nick, chan, "%s %s %s", ircd->botchanumode, nick, nick);
+ anope_cmd_mode(nick, chan, "%s %s", ircd->botchanumode, nick);
}
/* QUIT */
@@ -1317,4 +1414,51 @@ int anope_event_pass(char *source, int ac, char **av)
return MOD_CONT;
}
+void anope_cmd_svsjoin(char *source, char *nick, char *chan)
+{
+ /* Not Supported by this IRCD */
+}
+
+void anope_cmd_svspart(char *source, char *nick, char *chan)
+{
+ /* Not Supported by this IRCD */
+}
+
+void anope_cmd_swhois(char *source, char *who, char *mask)
+{
+ /* not supported */
+}
+
+int anope_event_notice(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_admin(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_invite(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_flood_mode_check(char *value)
+{
+ return 0;
+}
+
+int anope_event_error(char *source, int ac, char **av)
+{
+ if (ac >= 1) {
+ if (debug) {
+ alog("ERROR: %s", av[0]);
+ }
+ }
+ return MOD_CONT;
+}
+
+
+
#endif
diff --git a/src/init.c b/src/init.c
index 2ff23d437..486c54e82 100644
--- a/src/init.c
+++ b/src/init.c
@@ -34,103 +34,85 @@ void introduce_user(const char *user)
/* NickServ */
if (!user || stricmp(user, s_NickServ) == 0) {
- EnforceQlinedNick(s_NickServ, NULL);
anope_cmd_nick(s_NickServ, desc_NickServ, ircd->nickservmode);
}
/* ChanServ */
if (!user || stricmp(user, s_ChanServ) == 0) {
- EnforceQlinedNick(s_ChanServ, NULL);
anope_cmd_nick(s_ChanServ, desc_ChanServ, ircd->chanservmode);
}
if (s_HostServ && ircd->vhost
&& (!user || stricmp(user, s_HostServ) == 0)) {
- EnforceQlinedNick(s_HostServ, NULL);
anope_cmd_nick(s_HostServ, desc_HostServ, ircd->hostservmode);
}
if (!user || stricmp(user, s_MemoServ) == 0) {
- EnforceQlinedNick(s_MemoServ, NULL);
anope_cmd_nick(s_MemoServ, desc_MemoServ, ircd->memoservmode);
}
if (s_BotServ && (!user || stricmp(user, s_BotServ) == 0)) {
- EnforceQlinedNick(s_BotServ, NULL);
anope_cmd_nick(s_BotServ, desc_BotServ, ircd->botservmode);
}
if (!user || stricmp(user, s_HelpServ) == 0) {
- EnforceQlinedNick(s_HelpServ, NULL);
anope_cmd_nick(s_HelpServ, desc_HelpServ, ircd->helpservmode);
}
if (!user || stricmp(user, s_OperServ) == 0) {
- EnforceQlinedNick(s_OperServ, NULL);
anope_cmd_nick(s_OperServ, desc_OperServ, ircd->operservmode);
}
if (s_DevNull && (!user || stricmp(user, s_DevNull) == 0)) {
- EnforceQlinedNick(s_DevNull, NULL);
anope_cmd_nick(s_DevNull, desc_DevNull, ircd->devnullmode);
}
if (!user || stricmp(user, s_GlobalNoticer) == 0) {
- EnforceQlinedNick(s_GlobalNoticer, NULL);
anope_cmd_nick(s_GlobalNoticer, desc_GlobalNoticer,
ircd->globalmode);
}
/* We make aliases go online */
if (s_NickServAlias && (!user || stricmp(user, s_NickServAlias) == 0)) {
- EnforceQlinedNick(s_NickServAlias, NULL);
anope_cmd_nick(s_NickServAlias, desc_NickServAlias,
ircd->nickservaliasmode);
}
if (s_ChanServAlias && (!user || stricmp(user, s_ChanServAlias) == 0)) {
- EnforceQlinedNick(s_ChanServAlias, NULL);
anope_cmd_nick(s_ChanServAlias, desc_ChanServAlias,
ircd->chanservaliasmode);
}
if (s_MemoServAlias && (!user || stricmp(user, s_MemoServAlias) == 0)) {
- EnforceQlinedNick(s_MemoServAlias, NULL);
anope_cmd_nick(s_MemoServAlias, desc_MemoServAlias,
ircd->memoservaliasmode);
}
if (s_BotServAlias && (!user || stricmp(user, s_BotServAlias) == 0)) {
- EnforceQlinedNick(s_BotServAlias, NULL);
anope_cmd_nick(s_BotServAlias, desc_BotServAlias,
ircd->botservaliasmode);
}
if (s_HelpServAlias && (!user || stricmp(user, s_HelpServAlias) == 0)) {
- EnforceQlinedNick(s_HelpServAlias, NULL);
anope_cmd_nick(s_HelpServAlias, desc_HelpServAlias,
ircd->helpservaliasmode);
}
if (s_OperServAlias && (!user || stricmp(user, s_OperServAlias) == 0)) {
- EnforceQlinedNick(s_OperServAlias, NULL);
anope_cmd_nick(s_OperServAlias, desc_OperServAlias,
ircd->operservaliasmode);
}
if (s_DevNullAlias && (!user || stricmp(user, s_DevNullAlias) == 0)) {
- EnforceQlinedNick(s_DevNullAlias, NULL);
anope_cmd_nick(s_DevNullAlias, desc_DevNullAlias,
ircd->devnullvaliasmode);
}
if (s_HostServAlias && ircd->vhost
&& (!user || stricmp(user, s_HostServAlias) == 0)) {
- EnforceQlinedNick(s_HostServAlias, NULL);
anope_cmd_nick(s_HostServAlias, desc_HostServAlias,
ircd->hostservaliasmode);
}
if (s_GlobalNoticerAlias
&& (!user || stricmp(user, s_GlobalNoticerAlias) == 0)) {
- EnforceQlinedNick(s_GlobalNoticerAlias, NULL);
anope_cmd_nick(s_GlobalNoticerAlias, desc_GlobalNoticerAlias,
ircd->globalaliasmode);
}
@@ -143,8 +125,6 @@ void introduce_user(const char *user)
for (i = 0; i < 256; i++)
for (bi = botlists[i]; bi; bi = bi->next) {
- EnforceQlinedNick(bi->nick, s_BotServ);
-
if (!user || !stricmp(user, bi->nick))
anope_cmd_bot_nick(bi->nick, bi->user, bi->host,
bi->real, ircd->botserv_bot_mode);
@@ -152,8 +132,6 @@ void introduce_user(const char *user)
}
}
-#undef NICK
-
/*************************************************************************/
/* Set GID if necessary. Return 0 if successful (or if RUNGROUP not
@@ -345,8 +323,8 @@ static int parse_options(int ac, char **av)
is44 = 1;
#endif
} else if (!strcmp(s, "version")) {
- fprintf(stdout, "Anope-%s %s -- %s\n", version_number,
- version_flags, version_build);
+ fprintf(stdout, "Anope-%s %s %s -- %s\n", version_number,
+ ircd->name, version_flags, version_build);
exit(EXIT_SUCCESS);
} else if (!strcmp(s, "help")) {
fprintf(stdout, "Anope-%s %s -- %s\n", version_number,
@@ -663,7 +641,8 @@ int init(int ac, char **av)
}
#endif
/* Make myself known to myself in the serverlist */
- me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME);
+ me_server =
+ new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
/* Connect to the remote server */
servsock = conn(RemoteServer, RemotePort, LocalHost, LocalPort);
@@ -721,6 +700,8 @@ int init(int ac, char **av)
anope_cmd_join(s_GlobalNoticer, LogChannel, time(NULL));
}
+ anope_cmd_eob();
+
/**
* Load our delayed modeles - modules that are planing on making clients need to wait till now
* where as modules wanting to modify our ircd connection messages need to load eariler :|
diff --git a/src/main.c b/src/main.c
index 15660e2fc..f61d4f355 100644
--- a/src/main.c
+++ b/src/main.c
@@ -503,8 +503,9 @@ int main(int ac, char **av, char **envp)
int errno_save = errno;
quitmsg = scalloc(BUFSIZE, 1);
if (quitmsg) {
- snprintf(quitmsg, BUFSIZE, "Read error from server: %s",
- strerror(errno_save));
+ snprintf(quitmsg, BUFSIZE,
+ "Read error from server: %s (error num: %d)",
+ strerror(errno_save), errno_save);
} else {
quitmsg = "Read error from server";
}
diff --git a/src/memoserv.c b/src/memoserv.c
index 716f1a1bc..131c48d48 100644
--- a/src/memoserv.c
+++ b/src/memoserv.c
@@ -1003,6 +1003,9 @@ static int do_info(User * u)
if (!na) {
notice_lang(s_MemoServ, u, NICK_X_NOT_REGISTERED, name);
return MOD_CONT;
+ } else if (na->status & NS_VERBOTEN) {
+ notice_lang(s_MemoServ, u, NICK_X_FORBIDDEN, name);
+ return MOD_CONT;
}
mi = &na->nc->memos;
hardmax = na->nc->flags & NI_MEMO_HARDMAX ? 1 : 0;
diff --git a/src/messages.c b/src/messages.c
index 335fc1093..571a0ea2b 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -49,25 +49,8 @@ int m_kill(char *nick, char *msg)
BotInfo *bi;
/* Recover if someone kills us. */
- if (stricmp(nick, s_OperServ) == 0 ||
- (s_OperServAlias && stricmp(nick, s_OperServAlias) == 0) ||
- stricmp(nick, s_NickServ) == 0 ||
- (s_NickServAlias && stricmp(nick, s_NickServAlias) == 0) ||
- stricmp(nick, s_ChanServ) == 0 ||
- (s_ChanServAlias && stricmp(nick, s_ChanServAlias) == 0) ||
- stricmp(nick, s_MemoServ) == 0 ||
- (s_MemoServAlias && stricmp(nick, s_MemoServAlias) == 0) ||
- (s_HostServ && stricmp(nick, s_HostServ) == 0) ||
- (s_HostServAlias && stricmp(nick, s_HostServAlias) == 0) ||
- (s_BotServ && stricmp(nick, s_BotServ) == 0) ||
- (s_BotServAlias && stricmp(nick, s_BotServAlias) == 0) ||
- stricmp(nick, s_HelpServ) == 0 ||
- (s_HelpServAlias && stricmp(nick, s_HelpServAlias) == 0) ||
- (s_DevNull && stricmp(nick, s_DevNull) == 0) ||
- (s_DevNullAlias && stricmp(nick, s_DevNullAlias) == 0) ||
- stricmp(nick, s_GlobalNoticer) == 0 ||
- (s_GlobalNoticerAlias && stricmp(nick, s_GlobalNoticerAlias) == 0)
- ) {
+ /* use nickIsServices() to reduce the number of lines of code - TSL */
+ if (nickIsServices(nick, 0)) {
if (!readonly && !skeleton)
introduce_user(nick);
} else if (s_BotServ && (bi = findbot(nick))) {
@@ -138,6 +121,10 @@ int m_privmsg(char *source, char *receiver, char *msg)
return MOD_CONT;
}
+ if (!*receiver || !receiver || !msg) {
+ return MOD_CONT;
+ }
+
if (*receiver == '#') {
if (s_BotServ && (ci = cs_findchan(receiver)))
if (!(ci->flags & CI_VERBOTEN) && ci->c && ci->bi) /* Some paranoia checks */
diff --git a/src/misc.c b/src/misc.c
index be34f3bf6..ec9e4944a 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -663,7 +663,7 @@ void EnforceQlinedNick(char *nick, char *killer)
}
}
-int nickIsServices(char *nick)
+int nickIsServices(char *nick, int bot)
{
int found = 0;
@@ -704,7 +704,7 @@ int nickIsServices(char *nick)
else if (s_GlobalNoticerAlias
&& (stricmp(nick, s_GlobalNoticerAlias) == 0))
found++;
- else if (s_BotServ) {
+ else if (s_BotServ && bot) {
BotInfo *bi;
int i;
for (i = 0; i < 256; i++) {
@@ -831,4 +831,58 @@ u_int32_t getrandom32(void)
return val;
}
+char *send_token(char *token1, char *token2)
+{
+ if (UseTokens && ircd->token && ircdcap->token) {
+ return token2;
+ }
+ else {
+ return token1;
+ }
+}
+
+int myNumToken(const char *str, const char dilim)
+{
+ int len, idx, counter = 0, start_pos = 0;
+ if (!str) {
+ return 0;
+ }
+ len = strlen(str);
+ for (idx = 0; idx <= len; idx++) {
+ if ((str[idx] == dilim) || (idx == len)) {
+ start_pos = idx + 1;
+ counter++;
+ }
+ }
+ return counter;
+}
+
+
+char *host_resolve(char *host)
+{
+ struct hostent *hentp = NULL;
+ uint32 ip = INADDR_NONE;
+ char ipbuf[16];
+ char *ipreturn;
+ struct in_addr addr;
+
+ ipreturn = NULL;
+
+ hentp = gethostbyname(host);
+
+ if (hentp) {
+ memcpy(&ip, hentp->h_addr, sizeof(hentp->h_length));
+ addr.s_addr = ip;
+ ntoa(addr, ipbuf, sizeof(ipbuf));
+ ipreturn = strdup(ipbuf);
+ if (debug) {
+ alog("Resolved %s to %s",host, ipbuf);
+ }
+ return ipreturn;
+ }
+ else {
+ return ipreturn;
+ }
+}
+
diff --git a/src/modules.c b/src/modules.c
index 7321c43b9..fede2de3c 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -1054,10 +1054,24 @@ Message *findMessage(MessageHash * msgTable[], const char *name)
idx = CMD_HASH(name);
for (current = msgTable[idx]; current; current = current->next) {
- if (stricmp(name, current->name) == 0) {
- return current->m;
+ if (UseTokens) {
+ if (ircd->tokencaseless) {
+ if (stricmp(name, current->name) == 0) {
+ return current->m;
+ }
+ }
+ else {
+ if (strcmp(name, current->name) == 0) {
+ return current->m;
+ }
+ }
+ }
+ else {
+ if (stricmp(name, current->name) == 0) {
+ return current->m;
+ }
}
- }
+ }
return NULL;
}
diff --git a/src/modules/ircd_catserv.c b/src/modules/ircd_catserv.c
index 05a3f997d..17aede270 100644
--- a/src/modules/ircd_catserv.c
+++ b/src/modules/ircd_catserv.c
@@ -27,7 +27,14 @@ int AnopeInit(int argc, char **argv)
{
Message *msg = NULL;
int status;
+#ifdef IRC_UNREAL32
+ msg = createMessage("PRIVMSG", my_privmsg);
+ if (UseTokens) {
+ msg = createMessage("!", my_privmsg);
+ }
+#else
msg = createMessage("PRIVMSG", my_privmsg);
+#endif
status = moduleAddMessage(msg, MOD_HEAD);
if (status == MOD_ERR_OK) {
addClient(s_CatServ, "meow!");
@@ -81,7 +88,7 @@ void addClient(char *nick, char *realname)
void delClient(void)
{
- send_cmd(s_CatServ, "QUIT :Module Unloaded!");
+ anope_cmd_quit(s_CatServ, "QUIT :Module Unloaded!");
}
void addMessageList(void)
diff --git a/src/mysql.c b/src/mysql.c
index d0771faa0..97df90b2f 100644
--- a/src/mysql.c
+++ b/src/mysql.c
@@ -58,6 +58,7 @@ int db_mysql_init()
} else {
do_mysql = 1;
alog("MySQL has been enabled.");
+ alog("MySQL client version %s.",mysql_get_client_info());
}
/* The following configuration options are required.
diff --git a/src/nickserv.c b/src/nickserv.c
index d3232e9f1..23d0e2738 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -33,7 +33,6 @@ unsigned int guestnum; /* Current guest number */
extern char *getvHost(char *nick);
-static int is_on_access(User * u, NickCore * nc);
void alpha_insert_alias(NickAlias * na);
void insert_core(NickCore * nc);
void insert_requestnick(NickRequest * nr);
@@ -41,7 +40,6 @@ static NickAlias *makenick(const char *nick);
static NickRequest *makerequest(const char *nick);
static NickAlias *makealias(const char *nick, NickCore * nc);
static void change_core_display(NickCore * nc, char *newdisplay);
-static int group_identified(User * u, NickCore * nc);
static void collide(NickAlias * na, int from_timeout);
static void release(NickAlias * na, int from_timeout);
@@ -1188,7 +1186,7 @@ int nick_recognized(User * u)
/* Returns whether a user is identified AND in the group nc */
-static int group_identified(User * u, NickCore * nc)
+int group_identified(User * u, NickCore * nc)
{
return nick_identified(u) && u->na->nc == nc;
}
@@ -1302,7 +1300,7 @@ NickCore *findcore(const char *nick)
/* Is the given user's address on the given nick's access list? Return 1
* if so, 0 if not. */
-static int is_on_access(User * u, NickCore * nc)
+int is_on_access(User * u, NickCore * nc)
{
int i;
char *buf;
@@ -2499,6 +2497,12 @@ static int do_identify(User * u)
/* Enable nick tracking if enabled */
if (NSNickTracking)
nsStartNickTracking(u);
+
+ /* Clear any timers */
+ if (na->nc->flags & NI_KILLPROTECT) {
+ del_ns_timeout(na, TO_COLLIDE);
+ }
+
}
return MOD_CONT;
}
@@ -2614,7 +2618,9 @@ static int do_logout(User * u)
u2->na->status &= ~(NS_IDENTIFIED | NS_RECOGNIZED);
}
- common_svsmode(u2, "-r+d", "1");
+ if (ircd->modeonreg) {
+ common_svsmode(u2, ircd->modeonreg, "1");
+ }
u->isSuperAdmin = 0; /* Dont let people logout and remain a SuperAdmin */
alog("%s: %s!%s@%s logged out nickname %s", s_NickServ, u->nick,
@@ -2628,6 +2634,12 @@ static int do_logout(User * u)
/* Stop nick tracking if enabled */
if (NSNickTracking)
nsStopNickTracking(u);
+
+ /* Clear any timers again */
+ if (u->na->nc->flags & NI_KILLPROTECT) {
+ del_ns_timeout(u->na, TO_COLLIDE);
+ }
+
}
return MOD_CONT;
}
@@ -3286,7 +3298,7 @@ static int do_info(User * u)
s_NickServ, nr->nick);
}
}
- } else if (nickIsServices(nick)) {
+ } else if (nickIsServices(nick, 1)) {
notice_lang(s_NickServ, u, NICK_X_IS_SERVICES, nick);
} else {
notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
@@ -3390,12 +3402,14 @@ static int do_info(User * u)
if (show_hidden) {
if (s_HostServ && ircd->vhost) {
if (getvHost(na->nick) != NULL) {
- vHost = smalloc(strlen(getvHost(na->nick)) + 2);
- bzero(vHost, sizeof(vHost));
- snprintf(vHost, strlen(getvHost(na->nick)) + 2, "%s",
- getvHost(na->nick));
- notice_lang(s_NickServ, u, NICK_INFO_VHOST, vHost);
- free(vHost);
+ if (ircd->vident && getvIdent(na->nick) != NULL) {
+ notice_lang(s_NickServ, u, NICK_INFO_VHOST2,
+ getvIdent(na->nick),
+ getvHost(na->nick));
+ } else {
+ notice_lang(s_NickServ, u, NICK_INFO_VHOST,
+ getvHost(na->nick));
+ }
}
}
if (na->nc->greet)
diff --git a/src/operserv.c b/src/operserv.c
index 92130c790..a6e5e10ac 100644
--- a/src/operserv.c
+++ b/src/operserv.c
@@ -3100,13 +3100,12 @@ static int do_sqline(User * u)
notice_lang(s_OperServ, u, USERHOST_MASK_TOO_WIDE, mask);
return MOD_CONT;
}
- if (ircd->chansqline) {
- /* Channel SQLINEs are only supported on Bahamut servers */
- if (*mask == '#') {
- notice_lang(s_OperServ, u,
- OPER_SQLINE_CHANNELS_UNSUPPORTED);
- return MOD_CONT;
- }
+
+ /* Channel SQLINEs are only supported on Bahamut servers */
+ if (*mask == '#' && !ircd->chansqline) {
+ notice_lang(s_OperServ, u,
+ OPER_SQLINE_CHANNELS_UNSUPPORTED);
+ return MOD_CONT;
}
deleted = add_sqline(u, mask, u->nick, expires, reason);
@@ -4460,7 +4459,7 @@ static int do_jupe(User * u)
anope_cmd_squit(jserver, rbuf);
anope_cmd_server(jserver, 1, rbuf);
- new_server(me_server, jserver, rbuf, SERVER_JUPED);
+ new_server(me_server, jserver, rbuf, SERVER_JUPED, NULL);
if (WallOSJupe)
anope_cmd_global(s_OperServ, "\2%s\2 used JUPE on \2%s\2",
diff --git a/src/ptlink.c b/src/ptlink.c
index e0acf3711..7000988ed 100644
--- a/src/ptlink.c
+++ b/src/ptlink.c
@@ -40,7 +40,7 @@ IRCDVar ircd[] = {
"+io", /* Global alias mode */
"+", /* Used by BotServ Bots */
2, /* Chan Max Symbols */
- "-cdfiklmnpqstRS", /* Modes to Remove */
+ "-inpsmtCRKOASdcqBNfkl", /* Modes to Remove */
"+ao", /* Channel Umode used by Botserv bots */
1, /* SVSNICK */
1, /* Vhost */
@@ -89,6 +89,10 @@ IRCDVar ircd[] = {
1,
1, /* No Knock requires +i */
NULL, /* CAPAB Chan Modes */
+ 0, /* We support TOKENS */
+ 1, /* TOKENS are CASE inSensitive */
+ 0, /* TIME STAMPS are BASE64 */
+ 0, /* +I support */
}
,
{NULL}
@@ -129,26 +133,54 @@ IRCDCAPAB ircdcap[] = {
unsigned long umodes[128] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, UMODE_A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,
- 0,
- 0,
- 0, 0, 0, 0, 0, 0, 0,
- 0,
- 0, 0, 0, 0, 0,
- 0, UMODE_a, 0, 0, 0, 0, 0,
- 0,
- UMODE_h, UMODE_i, 0, 0, 0, 0, 0, UMODE_o,
- 0,
- 0, UMODE_r, 0, 0, 0, 0, UMODE_w,
- 0,
- 0,
- 0,
- 0, 0, 0, 0, 0
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Horzontal Tab */
+ 0, 0, 0, /* Line Feed, Unused, Unused */
+ 0, 0, 0, /* Carriage Return, Unused, Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Space */
+ 0, 0, 0, /* ! " # */
+ 0, 0, 0, /* $ % & */
+ 0, 0, 0, /* ! ( ) */
+ 0, 0, 0, /* * + , */
+ 0, 0, 0, /* - . / */
+ 0, 0, /* 0 1 */
+ 0, 0, /* 2 3 */
+ 0, 0, /* 4 5 */
+ 0, 0, /* 6 7 */
+ 0, 0, /* 8 9 */
+ 0, 0, /* : ; */
+ 0, 0, 0, /* < = > */
+ 0, 0, /* ? @ */
+ UMODE_A, UMODE_B, 0, /* A B C */
+ 0, 0, 0, /* D E F */
+ 0, UMODE_H, 0, /* G H I */
+ 0, 0, 0, /* J K L */
+ 0, UMODE_N, UMODE_O, /* M N O */
+ 0, 0, UMODE_R, /* P Q R */
+ UMODE_S, UMODE_T, 0, /* S T U */
+ 0, 0, 0, /* V W X */
+ 0, /* Y */
+ 0, /* Z */
+ 0, 0, 0, /* [ \ ] */
+ 0, 0, 0, /* ^ _ ` */
+ UMODE_a, 0, 0, /* a b c */
+ 0, 0, 0, /* d e f */
+ 0, UMODE_h, UMODE_i, /* g h i */
+ 0, 0, 0, /* j k l */
+ 0, 0, UMODE_o, /* m n o */
+ UMODE_p, 0, UMODE_r, /* p q r */
+ UMODE_s, 0, 0, /* s t u */
+ UMODE_v, UMODE_w, 0, /* v w x */
+ UMODE_y, /* y */
+ UMODE_z, /* z */
+ 0, 0, 0, /* { | } */
+ 0, 0 /* ~ ‚ */
};
char csmodes[128] = {
@@ -212,7 +244,7 @@ CBMode cbmodes[128] = {
{0},
{0}, /* A */
{0}, /* B */
- {0}, /* C */
+ {CMODE_C, 0, NULL, NULL},
{0}, /* D */
{0}, /* E */
{0}, /* F */
@@ -281,6 +313,7 @@ CBModeInfo cbmodeinfos[] = {
{'s', CMODE_s, 0, NULL, NULL},
{'t', CMODE_t, 0, NULL, NULL},
{'A', CMODE_A, 0, NULL, NULL},
+ {'C', CMODE_C, 0, NULL, NULL},
{'K', CMODE_K, 0, NULL, NULL},
{'N', CMODE_N, 0, NULL, NULL},
{'R', CMODE_R, 0, NULL, NULL},
@@ -343,6 +376,16 @@ void anope_cmd_bot_chan_mode(char *nick, char *chan)
nick);
}
+/*
+ :%s SJOIN %lu %s %s %s :%s
+ parv[0] = sender
+ parv[1] = channel TS (channel creation time)
+ parv[2] = channel
+ parv[3] = modes + n arguments (key and/or limit)
+ ... [n] = if(key and/or limit) mode arguments
+ parv[4+n] = flags+nick list (all in one parameter)
+ NOTE: ignore channel modes if we already have the channel with a gr
+*/
int anope_event_sjoin(char *source, int ac, char **av)
{
do_sjoin(source, ac, av);
@@ -355,6 +398,11 @@ int anope_event_sjoin(char *source, int ac, char **av)
* that case serives will *NOT* modify it's internal record for the vhost. We
* need to address this in the future.
*/
+/*
+ :%s NEWMASK %s
+ parv[0] = sender
+ parv[1] = new mask (if no '@', hostname is assumed)
+*/
int anope_event_newmask(char *source, int ac, char **av)
{
User *u;
@@ -387,7 +435,24 @@ int anope_event_newmask(char *source, int ac, char **av)
return MOD_CONT;
}
-
+/*
+ NICK %s %d %lu %s %s %s %s %s :%s
+ parv[1] = nickname
+ parv[2] = hopcount
+ parv[3] = nick TS (nick introduction time)
+ parv[4] = umodes
+ parv[5] = username
+ parv[6] = hostname
+ parv[7] = spoofed hostname
+ parv[8] = server
+ parv[9] = nick info
+*/
+/*
+ Change NICK
+ parv[0] = old nick
+ parv[1] = new nick
+ parv[2] = TS (timestamp from user's server when nick changed was received)
+*/
int anope_event_nick(char *source, int ac, char **av)
{
User *user;
@@ -404,13 +469,21 @@ int anope_event_nick(char *source, int ac, char **av)
return MOD_CONT;
}
+/*
+ :%s SERVER %s %d %s :%s
+ parv[0] = server from where the server was introduced to us
+ parv[1] = server name
+ parv[2] = hop count (1 wen are directly connected)
+ parv[3] = server version
+ parv[4] = server description
+*/
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
if (!stricmp(av[1], "1"))
uplink = sstrdup(av[0]);
- do_server(source, ac, av);
+ do_server(source, av[0], av[1], av[3], NULL);
return MOD_CONT;
}
@@ -431,29 +504,25 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("401", NULL); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
- m = createMessage("INVITE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("INVITE", anope_event_invite); addCoreMessage(IRCD,m);
m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m);
m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m);
m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m);
m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m);
m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m);
- m = createMessage("NOTICE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m);
m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m);
- m = createMessage("PASS", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m);
m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m);
m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m);
m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m);
m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m);
m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m);
- m = createMessage("STATS", m_stats); addCoreMessage(IRCD,m);
- m = createMessage("TIME", m_time); addCoreMessage(IRCD,m);
m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m);
m = createMessage("USER", NULL); addCoreMessage(IRCD,m);
m = createMessage("WALLOPS", NULL); addCoreMessage(IRCD,m);
m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m);
-
- /* DALnet specific messages */
m = createMessage("AKILL", NULL); addCoreMessage(IRCD,m);
m = createMessage("GLOBOPS", NULL); addCoreMessage(IRCD,m);
m = createMessage("GNOTICE", NULL); addCoreMessage(IRCD,m);
@@ -472,6 +541,10 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("SVINFO", anope_event_svinfo); addCoreMessage(IRCD,m);
m = createMessage("SVSINFO", anope_event_svsinfo); addCoreMessage(IRCD,m);
m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m);
+ m = createMessage("REHASH", anope_event_rehash); addCoreMessage(IRCD,m);
+ m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
+ m = createMessage("CREDITS", anope_event_credits); addCoreMessage(IRCD,m);
+
}
/* *INDENT-ON* */
@@ -494,16 +567,40 @@ int anope_event_capab(char *source, int ac, char **av)
return MOD_CONT;
}
+/*
+ :%s SQLINE %s :%s
+ parv[0] = sender
+ parv[1] = sqlined nick/mask
+ parv[2] = reason
+*/
void anope_cmd_sqline(char *mask, char *reason)
{
send_cmd(NULL, "SQLINE %s :%s", mask, reason);
}
+/*
+ :%s SVSADMIN %s :%s
+ parv[0] = sender (services client)
+ parv[1] = target server
+ parv[2] = operation
+ operations:
+ noopers - remove existing opers and disable o:lines
+*/
void anope_cmd_svsnoop(char *server, int set)
{
send_cmd(NULL, "SVSADMIN %s :%s", server, set ? "noopers" : "rehash");
}
+void anope_cmd_svsadmin(char *server, int set)
+{
+ anope_cmd_svsnoop(server, set);
+}
+
+/*
+ :%s UNGLINE %s
+ parv[0] = sender (server if on network synchronization)
+ parv[1] = glined usert@host mask or ALL to remove all glines
+*/
void anope_cmd_remove_akill(char *user, char *host)
{
send_cmd(NULL, "UNGLINE %s@%s", user, host);
@@ -520,6 +617,11 @@ void anope_topic(char *whosets, char *chan, char *whosetit, char *topic,
send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, when, topic);
}
+/*
+ :%s UNSQLINE %s
+ parv[0] = sender
+ parv[1] = sqlined nick/mask
+*/
void anope_cmd_unsqline(char *user)
{
send_cmd(NULL, "UNSQLINE %s", user);
@@ -530,6 +632,14 @@ void anope_cmd_join(char *user, char *channel, time_t chantime)
send_cmd(user, "JOIN %s", channel);
}
+/*
+ :%s GLINE %s %lu %s %s
+ parv[0] = sender (server if on network synchronization)
+ parv[1] = glined usert@host mask
+ parv[2] = gline duration time (seconds)
+ parv[3] = who added the gline
+ parv[4] = reason
+*/
void anope_cmd_akill(char *user, char *host, char *who, time_t when,
time_t expires, char *reason)
{
@@ -560,7 +670,14 @@ void anope_cmd_svskill(char *source, char *user, const char *fmt, ...)
send_cmd(source, "KILL %s :%s", user, buf);
}
-
+/*
+ :%s SVSMODE %s %s :%s
+ parv[0] = sender (services client)
+ parv[1] = target client nick
+ parv[2] = mode changes
+ parv[3] = extra parameter ( if news setting mode(+n) )
+ e.g.: :NickServ SVSMODE Lamego +rn 1991234
+*/
void anope_cmd_svsmode(User * u, int ac, char **av)
{
send_cmd(ServerName, "SVSMODE %s %s%s%s", u->nick, av[0],
@@ -587,27 +704,56 @@ void anope_cmd_connect(int servernum)
anope_cmd_pass(RemotePassword2);
else if (servernum == 3)
anope_cmd_pass(RemotePassword3);
+
+ anope_cmd_capab();
anope_cmd_server(ServerName, 1, ServerDesc);
anope_cmd_svinfo();
anope_cmd_svsinfo();
}
+/*
+ SVINFO %d %d
+ parv[0] = server name
+ parv[1] = minimum supported protocol version (3)
+ parv[2] = current supported protocol version (6)
+*/
void anope_cmd_svinfo()
{
send_cmd(NULL, "SVINFO 3 6 %lu", time(NULL));
}
+/*
+ SVSINFO %lu %d
+ parv[0] = sender (server name)
+ parv[1] = local services data TS
+ parv[1] = max global users
+*/
void anope_cmd_svsinfo()
{
send_cmd(NULL, "SVSINFO %lu %d", time(NULL), maxusercnt);
}
-/* PASS */
+/*
+ PASS %s :TS
+ parv[1] = connection password
+ (TS indicates this is server uses TS protocol and SVINFO will be sent
+ for protocol compatibility checking)
+*/
void anope_cmd_pass(char *pass)
{
send_cmd(NULL, "PASS %s :TS", pass);
}
+/*
+ CAPAB :%s
+ parv[1] = capability list
+*/
+void anope_cmd_capab()
+{
+ send_cmd(NULL, "CAPAB :QS PTS4");
+}
+
+
void anope_cmd_server(char *servname, int hop, char *descript)
{
send_cmd(NULL, "SERVER %s %d Anope.Services%s :%s", servname, hop,
@@ -638,6 +784,14 @@ int anope_event_whois(char *source, int ac, char **av)
return MOD_CONT;
}
+/*
+ :%s TOPIC %s %s %lu :%s
+ parv[0] = sender prefix
+ parv[1] = channel
+ parv[2] = topic nick
+ parv[3] = topic time
+ parv[4] = topic text
+*/
int anope_event_topic(char *source, int ac, char **av)
{
if (ac != 4)
@@ -662,7 +816,12 @@ int anope_event_quit(char *source, int ac, char **av)
return MOD_CONT;
}
-
+/*
+ :%s MODE %s :%s
+ parv[0] = sender
+ parv[1] = target nick (==sender)
+ parv[2] = mode change string
+*/
int anope_event_mode(char *source, int ac, char **av)
{
if (ac < 2)
@@ -1024,8 +1183,21 @@ void anope_cmd_mode(char *source, char *dest, const char *fmt, ...)
send_cmd(source, "MODE %s %s", dest, buf);
}
+/*
+ NICK %s %d %lu %s %s %s %s %s :%s
+ parv[1] = nickname
+ parv[2] = hopcount
+ parv[3] = nick TS (nick introduction time)
+ parv[4] = umodes
+ parv[5] = username
+ parv[6] = hostname
+ parv[7] = spoofed hostname
+ parv[8] = server
+ parv[9] = nick info
+*/
void anope_cmd_nick(char *nick, char *name, char *mode)
{
+ EnforceQlinedNick(nick, NULL);
send_cmd(NULL, "NICK %s 1 %lu %s %s %s %s %s :%s", nick, time(NULL),
mode, ServiceUser, ServiceHost, ServiceHost, ServerName,
name);
@@ -1094,6 +1266,14 @@ void anope_cmd_part(char *nick, char *chan, const char *fmt, ...)
}
}
+/*
+ :%s TOPIC %s %s %lu :%s
+ parv[0] = sender prefix
+ parv[1] = channel
+ parv[2] = topic nick
+ parv[3] = topic time
+ parv[4] = topic text
+*/
void anope_cmd_topic(char *whosets, char *chan, char *whosetit,
char *topic, time_t when)
{
@@ -1228,6 +1408,7 @@ int anope_event_away(char *source, int ac, char **av)
void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real,
char *modes)
{
+ EnforceQlinedNick(nick, s_BotServ);
send_cmd(NULL, "NICK %s 1 %lu %s %s %s %s %s :%s", nick, time(NULL),
modes, user, host, host, ServerName, real);
anope_cmd_sqline(nick, "Reserved for services");
@@ -1253,31 +1434,56 @@ void anope_cmd_release_svshold(char *nick)
/* Not Supported by this IRCD */
}
-/* UNSGLINE */
+/*
+:%s UNSXLINE %s
+ parv[0] = sender
+ parv[1] = info ban mask
+*/
void anope_cmd_unsgline(char *mask)
{
/* Not Supported by this IRCD */
}
-/* UNSZLINE */
+/*
+:%s UNZLINE %s
+ parv[0] = sender
+ parv[1] = zlined host
+*/
void anope_cmd_unszline(char *mask)
{
/* Not Supported by this IRCD */
}
-/* SZLINE */
+/*
+:%s ZLINE %s :%s
+ parv[0] = sender
+ parv[1] = zlined host
+ parv[2] = time
+ parv[3] = reason
+*/
void anope_cmd_szline(char *mask, char *reason)
{
/* Not Supported by this IRCD */
}
-/* SGLINE */
+/*
+:%s SXLINE :%s:%s
+ parv[0] = sender
+ parv[1] = info ban mask:reason
+*/
void anope_cmd_sgline(char *mask, char *reason)
{
/* Not Supported by this IRCD */
}
/* SVSNICK */
+/*
+ :%s SVSNICK %s %s
+ parv[0] = sender (services client)
+ parv[1] = target client nick
+ parv[2] = new nick
+ e.g.: :NickServ SVSNICK Smiler 67455223 _Smiler-
+*/
void anope_cmd_svsnick(char *source, char *guest, time_t when)
{
if (!source || !guest) {
@@ -1332,6 +1538,12 @@ void anope_cmd_svid_umode3(User * u, char *ts)
}
/* NICK <newnick> */
+/*
+ :%s NICK %s %lu
+ parv[0] = old nick
+ parv[1] = new nick
+ parv[2] = TS (timestamp from user's server when nick changed was received)
+*/
void anope_cmd_chg_nick(char *oldnick, char *newnick)
{
if (!oldnick || !newnick) {
@@ -1341,5 +1553,82 @@ void anope_cmd_chg_nick(char *oldnick, char *newnick)
send_cmd(oldnick, "NICK %s", newnick);
}
+/*
+ :%s SVSJOIN %s :%s
+ parv[0] = sender (services client)
+ parv[1] = target client nick
+ parv[2] = channels list
+ :ChanServ SVSJOIN mynick 4163321 #Chan1,#Chan2
+*/
+void anope_cmd_svsjoin(char *source, char *nick, char *chan)
+{
+ send_cmd(source, "SVSJOIN %s :%s", nick, chan);
+}
+
+/*
+ :%s SVSPART %s :%s
+ parv[0] = sender (services client)
+ parv[1] = target client nick
+ parv[2] = channels list
+ e.g.: :ChanServ SVSPART mynick 4163321 #Chan1,#Chan2
+*/
+void anope_cmd_svspart(char *source, char *nick, char *chan)
+{
+ send_cmd(source, "SVSPART %s :%s", nick, chan);
+}
+
+void anope_cmd_swhois(char *source, char *who, char *mask)
+{
+ /* not supported */
+}
+
+int anope_event_notice(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_pass(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_rehash(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_credits(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_admin(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_invite(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_flood_mode_check(char *value)
+{
+ char *dp, *end;
+
+ if (value && *value != ':'
+ && (strtoul((*value == '*' ? value + 1 : value), &dp, 10) > 0)
+ && (*dp == ':') && (*(++dp) != 0) && (strtoul(dp, &end, 10) > 0)
+ && (*end == 0)) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+void anope_cmd_eob()
+{
+ /* not supported */
+}
#endif
diff --git a/src/rageircd.c b/src/rageircd.c
index 109cead4f..3b09a4a35 100644
--- a/src/rageircd.c
+++ b/src/rageircd.c
@@ -89,6 +89,10 @@ IRCDVar ircd[] = {
1,
0, /* No Knock requires +i */
NULL, /* CAPAB Chan Modes */
+ 0, /* We support TOKENS */
+ 1, /* TOKENS are CASE inSensitive */
+ 0, /* TIME STAMPS are BASE64 */
+ 1, /* +I support */
},
{NULL}
};
@@ -174,20 +178,43 @@ char csmodes[128] = {
CMMode cmmodes[128] = {
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
- {NULL},
- {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL},
+ {NULL}, {NULL}, {NULL}, /* BCD */
+ {NULL}, {NULL}, {NULL}, /* EFG */
+ {NULL}, /* H */
+ {add_invite, del_invite},
+ {NULL}, /* J */
+ {NULL}, {NULL}, {NULL}, /* KLM */
+ {NULL}, {NULL}, {NULL}, /* NOP */
+ {NULL}, {NULL}, {NULL}, /* QRS */
+ {NULL}, {NULL}, {NULL}, /* TUV */
+ {NULL}, {NULL}, {NULL}, /* WXY */
+ {NULL}, /* Z */
+ {NULL}, {NULL}, /* (char 91 - 92) */
+ {NULL}, {NULL}, {NULL}, /* (char 93 - 95) */
+ {NULL}, /* ` (char 96) */
+ {NULL}, /* a (char 97) */
{add_ban, del_ban},
{NULL},
{NULL},
@@ -434,6 +461,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("401", NULL); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
+ m = createMessage("482", anope_event_482); addCoreMessage(IRCD,m);
m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
m = createMessage("INVITE", NULL); addCoreMessage(IRCD,m);
m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
@@ -455,7 +483,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("WALLOPS", NULL); addCoreMessage(IRCD,m);
m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m);
m = createMessage("AKILL", NULL); addCoreMessage(IRCD,m);
- m = createMessage("GLOBOPS", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("GLOBOPS", anope_event_globops); addCoreMessage(IRCD,m);
m = createMessage("GOPER", NULL); addCoreMessage(IRCD,m);
m = createMessage("RAKILL", NULL); addCoreMessage(IRCD,m);
m = createMessage("SILENCE", NULL); addCoreMessage(IRCD,m);
@@ -483,10 +511,41 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("VHOST", anope_event_vhost); addCoreMessage(IRCD,m);
m = createMessage("MYID", anope_event_myid); addCoreMessage(IRCD,m);
m = createMessage("GNOTICE", anope_event_notice); addCoreMessage(IRCD,m);
+ m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
+ m = createMessage("BURST", anope_event_burst); addCoreMessage(IRCD,m);
+ m = createMessage("REHASH", anope_event_rehash); addCoreMessage(IRCD,m);
+ m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
+ m = createMessage("CREDITS", anope_event_credits); addCoreMessage(IRCD,m);
+
}
/* *INDENT-ON* */
+int anope_event_error(char *source, int ac, char **av)
+{
+ if (ac >= 1) {
+ if (debug) {
+ alog("ERROR: %s", av[0]);
+ }
+ }
+ return MOD_CONT;
+}
+
+
+int anope_event_burst(char *source, int ac, char **av)
+{
+ Server *s;
+ s = findserver(servlist, source);
+ if (ac > 1) {
+ /* for future use - start burst */
+ } else {
+ if (s) {
+ s->sync = 1;
+ }
+ }
+ return MOD_CONT;
+}
+
void anope_cmd_sqline(char *mask, char *reason)
{
if (!mask || !reason) {
@@ -515,6 +574,11 @@ void anope_cmd_svsnoop(char *server, int set)
send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
}
+void anope_cmd_svsadmin(char *server, int set)
+{
+ anope_cmd_svsnoop(server, set);
+}
+
void anope_cmd_sgline(char *mask, char *reason)
{
send_cmd(NULL, "SGLINE %d :%s:%s", strlen(mask), mask, reason);
@@ -635,6 +699,7 @@ void anope_cmd_connect(int servernum)
anope_cmd_capab();
anope_cmd_server(ServerName, 1, ServerDesc);
anope_cmd_svinfo();
+ anope_cmd_burst();
}
void anope_cmd_svinfo()
@@ -644,7 +709,7 @@ void anope_cmd_svinfo()
void anope_cmd_capab()
{
- send_cmd(NULL, "CAPAB SSJ3 SN2 VHOST");
+ send_cmd(NULL, "CAPAB BURST UNCONNECT SSJ3 SN2 VHOST");
}
void anope_cmd_server(char *servname, int hop, char *descript)
@@ -1117,49 +1182,55 @@ void anope_cmd_211(const char *fmt, ...)
void anope_cmd_nick(char *nick, char *name, char *modes)
{
+ EnforceQlinedNick(nick, NULL);
send_cmd(NULL, "SNICK %s %ld 1 %s %s 0 * %s 0 %s :%s", nick,
time(NULL), ServiceUser, ServiceHost, ServerName, modes,
name);
anope_cmd_sqline(nick, "Reserved for services");
}
+/* EVENT : OS */
int anope_event_os(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_OperServ, av[0]);
return MOD_CONT;
}
+/* EVENT : NS */
int anope_event_ns(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_NickServ, av[0]);
return MOD_CONT;
}
+/* EVENT : MS */
int anope_event_ms(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_MemoServ, av[0]);
return MOD_CONT;
}
+/* EVENT : HS */
int anope_event_hs(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_HostServ, av[0]);
return MOD_CONT;
}
+/* EVENT : CS */
int anope_event_cs(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_ChanServ, av[0]);
return MOD_CONT;
}
@@ -1186,6 +1257,7 @@ void anope_cmd_quit(char *source, const char *fmt, ...)
void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real,
char *modes)
{
+ EnforceQlinedNick(nick, s_BotServ);
send_cmd(NULL, "SNICK %s %ld 1 %s %s 0 * %s 0 %s :%s", nick,
time(NULL), user, host, ServerName, modes, real);
anope_cmd_sqline(nick, "Reserved for services");
@@ -1207,7 +1279,7 @@ int anope_event_server(char *source, int ac, char **av)
if (!stricmp(av[1], "1"))
uplink = sstrdup(av[0]);
- do_server(source, ac, av);
+ do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1236,6 +1308,12 @@ int anope_event_whois(char *source, int ac, char **av)
return MOD_CONT;
}
+
+int anope_event_482(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
int anope_event_topic(char *source, int ac, char **av)
{
if (ac != 4)
@@ -1442,4 +1520,55 @@ int anope_event_sqline(char *source, int ac, char **av)
return MOD_CONT;
}
+void anope_cmd_svsjoin(char *source, char *nick, char *chan)
+{
+ /* Find no reference to it in the code and docs */
+}
+
+void anope_cmd_svspart(char *source, char *nick, char *chan)
+{
+ /* Find no reference to it in the code and docs */
+}
+
+void anope_cmd_swhois(char *source, char *who, char *mask)
+{
+ /* not supported */
+}
+
+int anope_event_rehash(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_credits(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_admin(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_globops(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_flood_mode_check(char *value)
+{
+ return 0;
+}
+
+void anope_cmd_burst()
+{
+ send_cmd(NULL, "BURST");
+}
+
+void anope_cmd_eob()
+{
+ send_cmd(NULL, "BURST 0");
+}
+
+
#endif
diff --git a/src/servers.c b/src/servers.c
index d69ac9afd..4d6a7f461 100644
--- a/src/servers.c
+++ b/src/servers.c
@@ -67,7 +67,7 @@ Server *next_server(int flags)
*/
Server *new_server(Server * uplink, const char *name, const char *desc,
- uint16 flags)
+ uint16 flags, char *suid)
{
Server *serv;
@@ -78,6 +78,8 @@ Server *new_server(Server * uplink, const char *name, const char *desc,
serv->desc = sstrdup(desc);
serv->flags = flags;
serv->uplink = uplink;
+ serv->suid = suid;
+ serv->sync = -1;
serv->links = NULL;
serv->prev = NULL;
@@ -197,18 +199,41 @@ Server *findserver(Server * s, const char *name)
return s;
}
+/*
+ Not Synced = -1
+ Error = 0
+ Synced = 1
+*/
+
+int anope_check_sync(const char *name)
+{
+ Server *s;
+ s = findserver(servlist, name);
+
+ if (!s) {
+ return 0;
+ }
+ if (s->sync) {
+ return s->sync;
+ } else {
+ return 0;
+ }
+}
+
/*************************************************************************/
/* :<introducing server> SERVER <servername> <hops> :<description>
*/
-void do_server(const char *source, int ac, char **av)
+void do_server(const char *source, char *servername, char *hops,
+ char *descript, char *numeric)
{
- Server *s;
+ Server *s, *s2;
if (debug) {
if (!*source) {
- alog("debug: Server introduced (%s)", av[0]);
+ alog("debug: Server introduced (%s)", servername);
} else {
- alog("debug: Server introduced (%s) from %s", av[0], source);
+ alog("debug: Server introduced (%s) from %s", servername,
+ source);
}
}
@@ -216,23 +241,8 @@ void do_server(const char *source, int ac, char **av)
s = me_server;
else
s = findserver(servlist, source);
- if (ircd->numservargs == 4) {
- if (ac < 4)
- alog("Malformed SERVER received (less than 4 params)");
- else
- new_server(s, av[0], av[3], 0);
- }
- if (ircd->numservargs == 7) {
- if (ac < 7)
- alog("Malformed SERVER received (less than 7 params)");
- else
- new_server(s, av[0], av[6], 0);
- } else {
- if (ac < 3)
- alog("Malformed SERVER received (less than 3 params)");
- else
- new_server(s, av[0], av[2], 0);
- }
+
+ new_server(s, servername, descript, 0, numeric);
}
/*************************************************************************/
@@ -293,6 +303,10 @@ void capab_parse(int ac, char **av)
}
if (!stricmp(s, "NICKIP")) {
uplink_capab |= CAPAB_NICKIP;
+ /* Update the struct so that we know we can get NICKIP */
+ if (!ircd->nickip) {
+ ircd->nickip = 1;
+ }
}
if (!stricmp(s, "SSJOIN")) {
uplink_capab |= CAPAB_NSJOIN;
@@ -352,6 +366,11 @@ void capab_parse(int ac, char **av)
uplink_capab |= CAPAB_SSJ3;
}
+ if (!stricmp(s, "SJB64")) {
+ uplink_capab |= CAPAB_SJB64;
+
+ }
+
if (!stricmp(s, "CHANMODES")) {
uplink_capab |= CAPAB_CHANMODE;
if (tmp) {
diff --git a/src/ultimate2.c b/src/ultimate2.c
index d9777b8ca..127e2acd5 100644
--- a/src/ultimate2.c
+++ b/src/ultimate2.c
@@ -89,6 +89,10 @@ IRCDVar ircd[] = {
0,
1, /* No Knock requires +i */
NULL, /* CAPAB Chan Modes */
+ 1, /* We support TOKENS */
+ 0, /* TOKENS are CASE inSensitive */
+ 0, /* TIME STAMPS are BASE64 */
+ 0, /* +I support */
}
,
{NULL}
@@ -564,47 +568,175 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("401", NULL); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("6", anope_event_away); addCoreMessage(IRCD,m);
+ }
m = createMessage("INVITE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("*", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("C", anope_event_join); addCoreMessage(IRCD,m);
+ }
m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("H", anope_event_kick); addCoreMessage(IRCD,m);
+ }
m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage(".", anope_event_kill); addCoreMessage(IRCD,m);
+ }
m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("G", anope_event_mode); addCoreMessage(IRCD,m);
+ }
m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("F", anope_event_motd); addCoreMessage(IRCD,m);
+ }
m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("&", anope_event_nick); addCoreMessage(IRCD,m);
+ }
m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("B", anope_event_notice); addCoreMessage(IRCD,m);
+ }
m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("D", anope_event_part); addCoreMessage(IRCD,m);
+ }
m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("<", anope_event_pass); addCoreMessage(IRCD,m);
+ }
m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("9", anope_event_ping); addCoreMessage(IRCD,m);
+ }
m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("!", anope_event_privmsg); addCoreMessage(IRCD,m);
+ }
m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage(",", anope_event_quit); addCoreMessage(IRCD,m);
+ }
m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("'", anope_event_server); addCoreMessage(IRCD,m);
+ }
m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("-", anope_event_squit); addCoreMessage(IRCD,m);
+ }
m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage(")", anope_event_topic); addCoreMessage(IRCD,m);
+ }
m = createMessage("USER", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("%", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("WALLOPS", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("=", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("#", anope_event_whois); addCoreMessage(IRCD,m);
+ }
m = createMessage("AKILL", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("V", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("GLOBOPS", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("]", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("GNOTICE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("Z", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("GOPER", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("[", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("RAKILL", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("Y", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("SILENCE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("U", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("SVSKILL", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("h", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("SVSMODE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("n", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("SVSNICK", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("e", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("SVSNOOP", NULL); addCoreMessage(IRCD,m);
- m = createMessage("SQLINE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("f", NULL); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("SQLINE", anope_event_sqline); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("c", anope_event_sqline); addCoreMessage(IRCD,m);
+ }
m = createMessage("UNSQLINE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("d", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("PROTOCTL", anope_event_capab); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("_", anope_event_capab); addCoreMessage(IRCD,m);
+ }
m = createMessage("CHGHOST", anope_event_chghost); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("!<", anope_event_chghost); addCoreMessage(IRCD,m);
+ }
m = createMessage("CHGIDENT", anope_event_chgident); addCoreMessage(IRCD,m);
- m = createMessage("CHGNAME", anope_event_chgname); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("!=", anope_event_chgident); addCoreMessage(IRCD,m);
+ }
m = createMessage("NETINFO", anope_event_netinfo); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("u", anope_event_netinfo); addCoreMessage(IRCD,m);
+ }
m = createMessage("SNETINFO", anope_event_snetinfo); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("!1", anope_event_snetinfo); addCoreMessage(IRCD,m);
+ }
m = createMessage("SETHOST", anope_event_sethost); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("!8", anope_event_sethost); addCoreMessage(IRCD,m);
+ }
m = createMessage("SETIDENT", anope_event_setident); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("!9", anope_event_setident); addCoreMessage(IRCD,m);
+ }
m = createMessage("SETNAME", anope_event_setname); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("!;", anope_event_setname); addCoreMessage(IRCD,m);
+ }
m = createMessage("VCTRL", anope_event_vctrl); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("!I", anope_event_vctrl); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("REHASH", anope_event_rehash); addCoreMessage(IRCD,m);
+ m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
+ m = createMessage("CREDITS", anope_event_credits); addCoreMessage(IRCD,m);
+ m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
+
+
}
/* *INDENT-ON* */
@@ -626,6 +758,11 @@ void anope_cmd_svsnoop(char *server, int set)
send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
}
+void anope_cmd_svsadmin(char *server, int set)
+{
+ anope_cmd_svsnoop(server, set);
+}
+
void anope_cmd_remove_akill(char *user, char *host)
{
send_cmd(NULL, "RAKILL %s %s", host, user);
@@ -694,6 +831,7 @@ void anope_cmd_svsmode(User * u, int ac, char **av)
void anope_cmd_connect(int servernum)
{
+ anope_cmd_capab();
if (servernum == 1)
anope_cmd_pass(RemotePassword);
if (servernum == 2)
@@ -703,6 +841,15 @@ void anope_cmd_connect(int servernum)
anope_cmd_server(ServerName, 1, ServerDesc);
}
+void anope_cmd_capab()
+{
+ if (UseTokens) {
+ send_cmd(NULL, "PROTOCTL NOQUIT TOKEN SILENCE KNOCK");
+ } else {
+ send_cmd(NULL, "PROTOCTL NOQUIT SILENCE KNOCK");
+ }
+}
+
/* PASS */
void anope_cmd_pass(char *pass)
@@ -1131,7 +1278,7 @@ int anope_event_server(char *source, int ac, char **av)
if (!stricmp(av[1], "1"))
uplink = sstrdup(av[0]);
- do_server(source, ac, av);
+ do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1261,6 +1408,7 @@ void anope_cmd_serv_privmsg(char *source, char *dest, char *msg)
void anope_cmd_nick(char *nick, char *name, char *mode)
{
+ EnforceQlinedNick(nick, NULL);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", nick, time(NULL),
ServiceUser, ServiceHost, ServerName, name);
anope_cmd_mode(nick, nick, "%s", mode);
@@ -1315,9 +1463,10 @@ void anope_cmd_mode(char *source, char *dest, const char *fmt, ...)
void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real,
char *modes)
{
+ EnforceQlinedNick(nick, s_BotServ);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", nick, time(NULL),
user, host, ServerName, real);
- anope_cmd_mode(nick, "MODE %s %s", nick, modes);
+ anope_cmd_mode(nick, nick, "%s", modes);
anope_cmd_sqline(nick, "Reserved for services");
}
@@ -1452,4 +1601,82 @@ int anope_event_snetinfo(char *source, int ac, char **av)
return MOD_CONT;
}
+int anope_event_sqline(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+/*
+** svsjoin
+**
+** parv[0] - sender
+** parv[1] - nick to make join
+** parv[2] - channel(s) to join
+*/
+void anope_cmd_svsjoin(char *source, char *nick, char *chan)
+{
+ send_cmd(source, "SVSJOIN %s %s", nick, chan);
+}
+
+/*
+** svspart
+**
+** parv[0] - sender
+** parv[1] - nick to make part
+** parv[2] - channel(s) to part
+*/
+void anope_cmd_svspart(char *source, char *nick, char *chan)
+{
+ send_cmd(source, "SVSPART %s %s", nick, chan);
+}
+
+void anope_cmd_swhois(char *source, char *who, char *mask)
+{
+ /* not supported */
+}
+
+void anope_cmd_eob()
+{
+ /* not supported */
+}
+
+int anope_event_rehash(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_credits(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_admin(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_flood_mode_check(char *value)
+{
+ char *dp, *end;
+
+ if (value && *value != ':'
+ && (strtoul((*value == '*' ? value + 1 : value), &dp, 10) > 0)
+ && (*dp == ':') && (*(++dp) != 0) && (strtoul(dp, &end, 10) > 0)
+ && (*end == 0)) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+int anope_event_error(char *source, int ac, char **av)
+{
+ if (av[0]) {
+ if (debug) {
+ alog("ERROR: %s", av[0]);
+ }
+ }
+ return MOD_CONT;
+}
+
#endif
diff --git a/src/ultimate3.c b/src/ultimate3.c
index 05b524db5..96197c674 100644
--- a/src/ultimate3.c
+++ b/src/ultimate3.c
@@ -40,7 +40,7 @@ IRCDVar ircd[] = {
"+io", /* Global alias mode */
"+S", /* Used by BotServ Bots */
5, /* Chan Max Symbols */
- "-iklmnpstRKAO", /* Modes to Remove */
+ "-iklmnpqstRKAO", /* Modes to Remove */
"+ao", /* Channel Umode used by Botserv bots */
1, /* SVSNICK */
1, /* Vhost */
@@ -89,8 +89,9 @@ IRCDVar ircd[] = {
1, /* On nick change check if they could be identified */
1, /* No Knock requires +i */
NULL, /* CAPAB Chan Modes */
- 1, /* No Knock requires +i */
- NULL, /* CAPAB Chan Modes */
+ 0, /* We support TOKENS */
+ 1, /* TOKENS are CASE inSensitive */
+ 1, /* validate - to the #:# standard */
},
{NULL}
};
@@ -221,26 +222,54 @@ void anope_set_umode(User * user, int ac, char **av)
}
unsigned long umodes[128] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, UMODE_A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- UMODE_P,
- 0,
- 0,
- 0, 0, 0, 0, 0, 0, 0,
- UMODE_Z,
- 0, 0, 0, 0, 0,
- 0, UMODE_a, 0, 0, 0, 0, 0,
- 0,
- UMODE_h, UMODE_i, 0, 0, 0, 0, 0, UMODE_o,
- UMODE_p,
- 0, UMODE_r, 0, 0, 0, 0, UMODE_w,
- UMODE_x,
- 0,
- 0,
- 0, 0, 0, 0, 0
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Horzontal Tab */
+ 0, 0, 0, /* Line Feed, Unused, Unused */
+ 0, 0, 0, /* Carriage Return, Unused, Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Space */
+ 0, 0, 0, /* ! " # */
+ 0, 0, 0, /* $ % & */
+ 0, 0, 0, /* ! ( ) */
+ 0, 0, 0, /* * + , */
+ 0, 0, 0, /* - . / */
+ 0, 0, /* 0 1 */
+ 0, 0, /* 2 3 */
+ 0, 0, /* 4 5 */
+ 0, 0, /* 6 7 */
+ 0, 0, /* 8 9 */
+ 0, 0, /* : ; */
+ 0, 0, 0, /* < = > */
+ 0, 0, /* ? @ */
+ UMODE_A, 0, 0, /* A B C */
+ UMODE_D, 0, 0, /* D E F */
+ 0, 0, 0, /* G H I */
+ 0, 0, 0, /* J K L */
+ 0, 0, UMODE_0, /* M N O */
+ UMODE_P, 0, 0, /* P Q R */
+ UMODE_S, 0, 0, /* S T U */
+ 0, UMODE_W, 0, /* V W X */
+ 0, /* Y */
+ UMODE_Z, /* Z */
+ 0, 0, 0, /* [ \ ] */
+ 0, 0, 0, /* ^ _ ` */
+ UMODE_a, 0, 0, /* a b c */
+ UMODE_d, 0, 0, /* d e f */
+ 0, UMODE_h, UMODE_i, /* g h i */
+ 0, 0, 0, /* j k l */
+ 0, 0, UMODE_o, /* m n o */
+ UMODE_p, 0, UMODE_r, /* p q r */
+ 0, 0, 0, /* s t u */
+ 0, UMODE_w, UMODE_x, /* v w x */
+ 0, /* y */
+ 0, /* z */
+ 0, 0, 0, /* { | } */
+ 0, 0 /* ~ ‚ */
};
@@ -346,7 +375,7 @@ CBMode cbmodes[128] = {
{CMODE_n, 0, NULL, NULL},
{0}, /* o */
{CMODE_p, 0, NULL, NULL},
- {0}, /* q */
+ {CMODE_q, 0, NULL, NULL},
{CMODE_r, CBM_NO_MLOCK, NULL, NULL},
{CMODE_s, 0, NULL, NULL},
{CMODE_t, 0, NULL, NULL},
@@ -367,6 +396,7 @@ CBModeInfo cbmodeinfos[] = {
{'m', CMODE_m, 0, NULL, NULL},
{'n', CMODE_n, 0, NULL, NULL},
{'p', CMODE_p, 0, NULL, NULL},
+ {'q', CMODE_q, 0, NULL, NULL},
{'r', CMODE_r, 0, NULL, NULL},
{'s', CMODE_s, 0, NULL, NULL},
{'t', CMODE_t, 0, NULL, NULL},
@@ -535,7 +565,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("401", NULL); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
- m = createMessage("INVITE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("INVITE", anope_event_invite); addCoreMessage(IRCD,m);
m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m);
m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m);
@@ -583,11 +613,17 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("SETHOST", anope_event_sethost); addCoreMessage(IRCD,m);
m = createMessage("NETINFO", NULL); addCoreMessage(IRCD,m);
m = createMessage("GCONNECT", NULL); addCoreMessage(IRCD,m);
- m = createMessage("NETGLOBAL", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("NETGLOBAL", anope_event_netglobal); addCoreMessage(IRCD,m);
m = createMessage("CHATOPS", NULL); addCoreMessage(IRCD,m);
m = createMessage("NETCTRL", anope_event_netctrl); addCoreMessage(IRCD,m);
m = createMessage("CLIENT", anope_event_client); addCoreMessage(IRCD,m);
m = createMessage("SMODE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
+ m = createMessage("BURST", anope_event_burst); addCoreMessage(IRCD,m);
+ m = createMessage("REHASH", anope_event_rehash); addCoreMessage(IRCD,m);
+ m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
+ m = createMessage("CREDITS", anope_event_credits); addCoreMessage(IRCD,m);
+ m = createMessage("SMODE", anope_event_mode); addCoreMessage(IRCD,m);
}
/* *INDENT-ON* */
@@ -621,6 +657,11 @@ void anope_cmd_svsnoop(char *server, int set)
send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
}
+void anope_cmd_svsadmin(char *server, int set)
+{
+ anope_cmd_svsnoop(server, set);
+}
+
void anope_cmd_sgline(char *mask, char *reason)
{
send_cmd(NULL, "SGLINE %d :%s:%s", strlen(mask), mask, reason);
@@ -758,43 +799,48 @@ int anope_event_mode(char *source, int ac, char **av)
return MOD_CONT;
}
+/* EVENT : OS */
int anope_event_os(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_OperServ, av[0]);
return MOD_CONT;
}
+/* EVENT : NS */
int anope_event_ns(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_NickServ, av[0]);
return MOD_CONT;
}
+/* EVENT : MS */
int anope_event_ms(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_MemoServ, av[0]);
return MOD_CONT;
}
+/* EVENT : HS */
int anope_event_hs(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_HostServ, av[0]);
return MOD_CONT;
}
+/* EVENT : CS */
int anope_event_cs(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_ChanServ, av[0]);
return MOD_CONT;
}
@@ -909,7 +955,7 @@ int anope_event_server(char *source, int ac, char **av)
if (!stricmp(av[1], "1"))
uplink = sstrdup(av[0]);
- do_server(source, ac, av);
+ do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -968,6 +1014,7 @@ void anope_cmd_376(char *source)
void anope_cmd_nick(char *nick, char *name, char *modes)
{
+ EnforceQlinedNick(nick, NULL);
send_cmd(NULL, "CLIENT %s 1 %ld %s + %s %s * %s 0 0 :%s", nick,
time(NULL), modes, ServiceUser, ServiceHost, ServerName,
name);
@@ -1002,6 +1049,7 @@ void anope_cmd_mode(char *source, char *dest, const char *fmt, ...)
void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real,
char *modes)
{
+ EnforceQlinedNick(nick, s_BotServ);
send_cmd(NULL, "CLIENT %s 1 %ld %s + %s %s * %s 0 0 :%s", nick,
time(NULL), modes, user, host, ServerName, real);
anope_cmd_sqline(nick, "Reserved for services");
@@ -1144,7 +1192,8 @@ void anope_cmd_quit(char *source, const char *fmt, ...)
/* PROTOCTL */
void anope_cmd_capab()
{
- send_cmd(NULL, "CAPAB NICKIP SSJ5 TS5 CLIENT");
+ send_cmd(NULL,
+ "CAPAB TS5 NOQUIT SSJ5 BURST UNCONNECT TSMODE NICKIP CLIENT");
}
/* PASS */
@@ -1499,6 +1548,8 @@ void anope_cmd_connect(int servernum)
}
anope_cmd_capab();
anope_cmd_server(ServerName, 1, ServerDesc);
+ anope_cmd_svinfo();
+ anope_cmd_burst();
}
/* SVSHOLD - set */
@@ -1530,7 +1581,7 @@ void anope_cmd_nc_change(User * u)
/* SVSMODE +d */
void anope_cmd_svid_umode2(User * u, char *ts)
{
- /* not used by bahamut ircds */
+ // not used by bahamut ircds
}
void anope_cmd_svid_umode3(User * u, char *ts)
@@ -1549,6 +1600,19 @@ int anope_event_svinfo(char *source, int ac, char **av)
return MOD_CONT;
}
+/*
+ * SVINFO
+ * parv[0] = sender prefix
+ * parv[1] = TS_CURRENT for the server
+ * parv[2] = TS_MIN for the server
+ * parv[3] = server is standalone or connected to non-TS only
+ * parv[4] = server's idea of UTC time
+ */
+void anope_cmd_svinfo()
+{
+ send_cmd(NULL, "SVINFO 5 3 0 :%ld", time(NULL));
+}
+
int anope_event_pass(char *source, int ac, char **av)
{
/* currently not used but removes the message : unknown message from server */
@@ -1579,4 +1643,85 @@ int anope_event_sqline(char *source, int ac, char **av)
return MOD_CONT;
}
+void anope_cmd_svsjoin(char *source, char *nick, char *chan)
+{
+ /* Not Supported by this IRCD */
+}
+
+void anope_cmd_svspart(char *source, char *nick, char *chan)
+{
+ /* Not Supported by this IRCD */
+}
+
+void anope_cmd_swhois(char *source, char *who, char *mask)
+{
+ /* not supported */
+}
+
+
+void anope_cmd_eob()
+{
+ send_cmd(NULL, "BURST 0");
+}
+
+void anope_cmd_burst()
+{
+ send_cmd(NULL, "BURST");
+}
+
+int anope_event_error(char *source, int ac, char **av)
+{
+ if (ac >= 1) {
+ if (debug) {
+ alog("ERROR: %s", av[0]);
+ }
+ }
+ return MOD_CONT;
+}
+
+int anope_event_burst(char *source, int ac, char **av)
+{
+ Server *s;
+ s = findserver(servlist, source);
+ if (!ac) {
+ /* for future use - start burst */
+ } else {
+ if (s) {
+ s->sync = 1;
+ }
+ }
+ return MOD_CONT;
+}
+
+int anope_event_rehash(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_credits(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_admin(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_netglobal(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_invite(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_flood_mode_check(char *value)
+{
+ return 0;
+}
+
+
#endif
diff --git a/src/unreal31.c b/src/unreal31.c
index 4fcd64b0a..80e5bb62b 100644
--- a/src/unreal31.c
+++ b/src/unreal31.c
@@ -91,6 +91,9 @@ IRCDVar ircd[] = {
0,
1, /* No Knock requires +i */
NULL, /* CAPAB Chan Modes */
+ 0, /* We support Unreal TOKENS */
+ 1, /* TOKENS are CASE inSensitive */
+ 1, /* validate - to the #:# standard */
},
{NULL}
};
@@ -451,6 +454,18 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("SETHOST", anope_event_sethost); addCoreMessage(IRCD,m);
m = createMessage("SETIDENT", anope_event_setident); addCoreMessage(IRCD,m);
m = createMessage("SETNAME", anope_event_setname); addCoreMessage(IRCD,m);
+ m = createMessage("REHASH", anope_event_rehash); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("O", anope_event_rehash); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("@", anope_event_admin); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("CREDITS", anope_event_credits); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("AJ", anope_event_credits); addCoreMessage(IRCD,m);
+ }
}
/* *INDENT-ON* */
@@ -467,6 +482,11 @@ void anope_cmd_svsnoop(char *server, int set)
send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
}
+void anope_cmd_svsadmin(char *server, int set)
+{
+ anope_cmd_svsnoop(server, set);
+}
+
void anope_cmd_remove_akill(char *user, char *host)
{
send_cmd(NULL, "TKL - G %s %s %s", user, host, s_OperServ);
@@ -547,6 +567,7 @@ void anope_cmd_376(char *source)
void anope_cmd_nick(char *nick, char *name, char *modes)
{
+ EnforceQlinedNick(nick, NULL);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 %s * :%s", nick, time(NULL),
ServiceUser, ServiceHost, ServerName, modes, name);
anope_cmd_sqline(nick, "Reserved for services");
@@ -580,6 +601,7 @@ void anope_cmd_mode(char *source, char *dest, const char *fmt, ...)
void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real,
char *modes)
{
+ EnforceQlinedNick(nick, s_BotServ);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 %s * :%s", nick, time(NULL),
user, host, ServerName, modes, real);
anope_cmd_sqline(nick, "Reserved for services");
@@ -1356,7 +1378,7 @@ int anope_event_server(char *source, int ac, char **av)
if (!stricmp(av[1], "1"))
uplink = sstrdup(av[0]);
- do_server(source, ac, av);
+ do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1455,4 +1477,64 @@ void anope_cmd_svid_umode3(User * u, char *ts)
/* not used */
}
+/* svsjoin
+ parv[0] - sender
+ parv[1] - nick to make join
+ parv[2] - channel(s) to join
+*/
+void anope_cmd_svsjoin(char *source, char *nick, char *chan)
+{
+ send_cmd(source, "SVSJOIN %s :%s", nick, chan);
+}
+
+/* svspart
+ parv[0] - sender
+ parv[1] - nick to make part
+ parv[2] - channel(s) to part
+*/
+void anope_cmd_svspart(char *source, char *nick, char *chan)
+{
+ send_cmd(source, "SVSPART %s :%s", nick, chan);
+}
+
+void anope_cmd_swhois(char *source, char *who, char *mask)
+{
+ /* Can anyone tell me if 3.1 has this? */
+}
+
+void anope_cmd_eob()
+{
+ /* Can anyone tell me if 3.1 has this? */
+}
+
+
+int anope_event_rehash(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_credits(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_admin(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_flood_mode_check(char *value)
+{
+ char *dp, *end;
+
+ if (value && *value != ':'
+ && (strtoul((*value == '*' ? value + 1 : value), &dp, 10) > 0)
+ && (*dp == ':') && (*(++dp) != 0) && (strtoul(dp, &end, 10) > 0)
+ && (*end == 0)) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
#endif
diff --git a/src/unreal32.c b/src/unreal32.c
index 753ca5b39..0c942677e 100644
--- a/src/unreal32.c
+++ b/src/unreal32.c
@@ -91,6 +91,10 @@ IRCDVar ircd[] = {
0, /* On nick change check if they could be identified */
1, /* No Knock requires +i */
NULL, /* CAPAB Chan Modes */
+ 1, /* We support Unreal TOKENS */
+ 0, /* TOKENS are CASE Sensitive */
+ 1, /* TIME STAMPS are BASE64 */
+ 0, /* +I support */
},
{NULL}
};
@@ -129,30 +133,58 @@ IRCDCAPAB ircdcap[] = {
}
};
+
unsigned long umodes[128] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, UMODE_A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,
- 0,
- 0,
- 0, 0, 0, 0, 0, 0, 0,
- 0,
- 0, 0, 0, 0, 0,
- 0, UMODE_a, 0, 0, 0, 0, 0,
- UMODE_g,
- UMODE_h, UMODE_i, 0, 0, 0, 0, 0, UMODE_o,
- 0,
- 0, UMODE_r, 0, 0, 0, 0, UMODE_w,
- UMODE_x,
- 0,
- 0,
- 0, 0, 0, 0, 0
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Horzontal Tab */
+ 0, 0, 0, /* Line Feed, Unused, Unused */
+ 0, 0, 0, /* Carriage Return, Unused, Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused */
+ 0, 0, 0, /* Unused, Unused, Space */
+ 0, 0, 0, /* ! " # */
+ 0, 0, 0, /* $ % & */
+ 0, 0, 0, /* ! ( ) */
+ 0, 0, 0, /* * + , */
+ 0, 0, 0, /* - . / */
+ 0, 0, /* 0 1 */
+ 0, 0, /* 2 3 */
+ 0, 0, /* 4 5 */
+ 0, 0, /* 6 7 */
+ 0, 0, /* 8 9 */
+ 0, 0, /* : ; */
+ 0, 0, 0, /* < = > */
+ 0, 0, /* ? @ */
+ UMODE_A, UMODE_B, UMODE_C, /* A B C */
+ 0, 0, 0, /* D E F */
+ UMODE_G, UMODE_H, 0, /* G H I */
+ 0, 0, 0, /* J K L */
+ 0, UMODE_N, UMODE_O, /* M N O */
+ 0, 0, UMODE_R, /* P Q R */
+ UMODE_S, UMODE_T, 0, /* S T U */
+ UMODE_V, UMODE_W, 0, /* V W X */
+ 0, /* Y */
+ 0, /* Z */
+ 0, 0, 0, /* [ \ ] */
+ 0, 0, 0, /* ^ _ ` */
+ UMODE_a, 0, 0, /* a b c */
+ UMODE_d, 0, 0, /* d e f */
+ UMODE_g, UMODE_h, UMODE_i, /* g h i */
+ 0, 0, 0, /* j k l */
+ 0, 0, UMODE_o, /* m n o */
+ UMODE_p, UMODE_q, UMODE_r, /* p q r */
+ UMODE_s, UMODE_t, 0, /* s t u */
+ UMODE_v, UMODE_w, UMODE_x, /* v w x */
+ 0, /* y */
+ UMODE_z, /* z */
+ 0, 0, 0, /* { | } */
+ 0, 0 /* ~ ‚ */
};
-
char csmodes[128] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -160,9 +192,10 @@ char csmodes[128] = {
0,
0,
0, 0, 0,
- 0,
- 0, 0, 0, 0,
- 0,
+ 'h', /* (37) % Channel halfops */
+ 'b', /* (38) & Channel halfops */
+ 0, 0, 0,
+ 'q',
'v', 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -171,7 +204,7 @@ char csmodes[128] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'a', 'a', 0
};
CMMode cmmodes[128] = {
@@ -219,12 +252,12 @@ CBMode cbmodes[128] = {
{0}, /* E */
{0}, /* F */
{CMODE_G, 0, NULL, NULL},
- {CMODE_H, CBM_NO_USER_MLOCK, NULL, NULL},
+ {0},
{0}, /* I */
{0}, /* J */
{CMODE_K, 0, NULL, NULL},
{CMODE_L, 0, set_redirect, cs_set_redirect},
- {0}, /* M */
+ {CMODE_M, 0, NULL, NULL}, /* M */
{CMODE_N, 0, NULL, NULL},
{CMODE_O, CBM_NO_USER_MLOCK, NULL, NULL},
{0}, /* P */
@@ -285,9 +318,9 @@ CBModeInfo cbmodeinfos[] = {
{'A', CMODE_A, 0, NULL, NULL},
{'C', CMODE_C, 0, NULL, NULL},
{'G', CMODE_G, 0, NULL, NULL},
- {'H', CMODE_H, 0, NULL, NULL},
{'K', CMODE_K, 0, NULL, NULL},
{'L', CMODE_L, 0, get_redirect, cs_get_redirect},
+ {'M', CMODE_M, 0, NULL, NULL},
{'N', CMODE_N, 0, NULL, NULL},
{'O', CMODE_O, 0, NULL, NULL},
{'Q', CMODE_Q, 0, NULL, NULL},
@@ -353,6 +386,11 @@ void anope_set_umode(User * user, int ac, char **av)
ac--;
+ if (!user || !modes) {
+ /* Prevent NULLs from doing bad things */
+ return;
+ }
+
if (debug)
alog("debug: Changing mode for %s to %s", user->nick, modes);
@@ -393,7 +431,13 @@ void anope_set_umode(User * user, int ac, char **av)
break;
case 'r':
if (add && !nick_identified(user)) {
- send_cmd(ServerName, "SVSMODE %s -r", user->nick);
+ if (UseSVS2MODE) {
+ send_cmd(ServerName, "%s %s -r",
+ send_token("SVS2MODE", "v"), user->nick);
+ } else {
+ send_cmd(ServerName, "%s %s -r",
+ send_token("SVSMODE", "n"), user->nick);
+ }
user->mode &= ~UMODE_r;
}
break;
@@ -411,49 +455,214 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("401", NULL); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("6", anope_event_away); addCoreMessage(IRCD,m);
+ }
m = createMessage("INVITE", NULL); addCoreMessage(IRCD,m);
m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("C", anope_event_join); addCoreMessage(IRCD,m);
+ }
m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("H", anope_event_kick); addCoreMessage(IRCD,m);
+ }
m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage(".", anope_event_kill); addCoreMessage(IRCD,m);
+ }
m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("G", anope_event_mode); addCoreMessage(IRCD,m);
+ }
m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("F", anope_event_motd); addCoreMessage(IRCD,m);
+ }
m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("&", anope_event_nick); addCoreMessage(IRCD,m);
+ }
m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("B", anope_event_notice); addCoreMessage(IRCD,m);
+ }
m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("D", anope_event_part); addCoreMessage(IRCD,m);
+ }
m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("8", anope_event_ping); addCoreMessage(IRCD,m);
+ }
m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("!", anope_event_privmsg); addCoreMessage(IRCD,m);
+ }
m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage(",", anope_event_quit); addCoreMessage(IRCD,m);
+ }
m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("'", anope_event_server); addCoreMessage(IRCD,m);
+ }
m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("-", anope_event_squit); addCoreMessage(IRCD,m);
+ }
m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage(")", anope_event_topic); addCoreMessage(IRCD,m);
+ }
m = createMessage("USER", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("%", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("WALLOPS", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("=", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("#", anope_event_whois); addCoreMessage(IRCD,m);
+ }
m = createMessage("AKILL", NULL); addCoreMessage(IRCD,m);
- m = createMessage("GLOBOPS", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("V", NULL); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("GLOBOPS", anope_event_globops); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("]", anope_event_globops); addCoreMessage(IRCD,m);
+ }
m = createMessage("GNOTICE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("Z", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("GOPER", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("[", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("RAKILL", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("Y", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("SILENCE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("U", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("SVSKILL", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("h", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("SVSMODE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("n", NULL); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("SVS2MODE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("v", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("SVSNICK", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("e", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("SVSNOOP", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("f", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("SQLINE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("c", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("UNSQLINE", NULL); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("d", NULL); addCoreMessage(IRCD,m);
+ }
m = createMessage("PROTOCTL", anope_event_capab); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("_", anope_event_capab); addCoreMessage(IRCD,m);
+ }
m = createMessage("CHGHOST", anope_event_chghost); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("AL", anope_event_chghost); addCoreMessage(IRCD,m);
+ }
m = createMessage("CHGIDENT", anope_event_chgident); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("AZ", anope_event_chgident); addCoreMessage(IRCD,m);
+ }
m = createMessage("CHGNAME", anope_event_chgname); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("BK", anope_event_chgname); addCoreMessage(IRCD,m);
+ }
m = createMessage("NETINFO", anope_event_netinfo); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("AO", anope_event_netinfo); addCoreMessage(IRCD,m);
+ }
m = createMessage("SETHOST", anope_event_sethost); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("AA", anope_event_sethost); addCoreMessage(IRCD,m);
+ }
m = createMessage("SETIDENT", anope_event_setident); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("AD", anope_event_setident); addCoreMessage(IRCD,m);
+ }
m = createMessage("SETNAME", anope_event_setname); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("AE", anope_event_setname); addCoreMessage(IRCD,m);
+ }
m = createMessage("TKL", anope_event_tkl); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("BD", anope_event_tkl); addCoreMessage(IRCD,m);
+ }
m = createMessage("EOS", anope_event_eos); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("ES", anope_event_eos); addCoreMessage(IRCD,m);
+ }
m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("<", anope_event_pass); addCoreMessage(IRCD,m);
+ }
m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("5", anope_event_error); addCoreMessage(IRCD,m);
+ }
+ /* SMO has no token */
m = createMessage("SMO", anope_event_smo); addCoreMessage(IRCD,m);
+ m = createMessage("UMODE2", anope_event_umode2); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("|", anope_event_umode2); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("SWHOIS", anope_event_swhois); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("BA", anope_event_swhois); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("~", anope_event_sjoin); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("REHASH", anope_event_rehash); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("O", anope_event_rehash); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("@", anope_event_admin); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("CREDITS", anope_event_credits); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("AJ", anope_event_credits); addCoreMessage(IRCD,m);
+ }
+ m = createMessage("SDESC", anope_event_sdesc); addCoreMessage(IRCD,m);
+ if (UseTokens) {
+ m = createMessage("AG", anope_event_sdesc); addCoreMessage(IRCD,m);
+ }
+ /* The none token version of these is in messages.c */
+ if (UseTokens) {
+ m = createMessage("2", m_stats); addCoreMessage(IRCD,m);
+ m = createMessage(">", m_time); addCoreMessage(IRCD,m);
+ m = createMessage("+", m_version); addCoreMessage(IRCD,m);
+ }
}
/* *INDENT-ON* */
@@ -469,32 +678,52 @@ int anope_event_capab(char *source, int ac, char **av)
/* SVSNOOP */
void anope_cmd_svsnoop(char *server, int set)
{
- send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
+ send_cmd(NULL, "%s %s %s", send_token("SVSNOOP", "f"), server,
+ (set ? "+" : "-"));
+}
+
+void anope_cmd_svsadmin(char *server, int set)
+{
+ anope_cmd_svsnoop(server, set);
}
void anope_cmd_remove_akill(char *user, char *host)
{
- send_cmd(NULL, "TKL - G %s %s %s", user, host, s_OperServ);
+ send_cmd(NULL, "%s - G %s %s %s", send_token("TKL", "BD"), user, host,
+ s_OperServ);
}
void anope_cmd_topic(char *whosets, char *chan, char *whosetit,
char *topic, time_t when)
{
- send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, when, topic);
+ send_cmd(whosets, "%s %s %s %lu :%s", send_token("TOPIC", ")"), chan,
+ whosetit, when, topic);
}
void anope_cmd_vhost_off(char *nick)
{
- send_cmd(s_HostServ, "SVSMODE %s -xt", nick);
+ if (UseSVS2MODE) {
+ send_cmd(s_HostServ, "%s %s -xt", send_token("SVS2MODE", "v"),
+ nick);
+ } else {
+ send_cmd(s_HostServ, "%s %s -xt", send_token("SVSMODE", "n"),
+ nick);
+ }
}
void anope_cmd_akill(char *user, char *host, char *who, time_t when,
time_t expires, char *reason)
{
- send_cmd(NULL, "TKL + G %s %s %s %ld %ld :%s", user, host, who,
- time(NULL) + 86400 * 2, when, reason);
+ send_cmd(NULL, "%s + G %s %s %s %ld %ld :%s", send_token("TKL", "BD"),
+ user, host, who, time(NULL) + 86400 * 2, when, reason);
}
+/*
+** svskill
+** parv[0] = servername
+** parv[1] = client
+** parv[2] = kill message
+*/
void anope_cmd_svskill(char *source, char *user, const char *fmt, ...)
{
va_list args;
@@ -513,13 +742,32 @@ void anope_cmd_svskill(char *source, char *user, const char *fmt, ...)
return;
}
- send_cmd(source, "SVSKILL %s :%s", user, buf);
+ send_cmd(source, "%s %s :%s", send_token("SVSKILL", "h"), user, buf);
}
+/*
+ * m_svsmode() added by taz
+ * parv[0] - sender
+ * parv[1] - username to change mode for
+ * parv[2] - modes to change
+ * parv[3] - Service Stamp (if mode == d)
+ */
void anope_cmd_svsmode(User * u, int ac, char **av)
{
- send_cmd(ServerName, "SVSMODE %s %s%s%s", u->nick, av[0],
- (ac == 2 ? " " : ""), (ac == 2 ? av[1] : ""));
+ if (ac > 1) {
+ if (!u || !av[0]) {
+ return;
+ }
+ if (UseSVS2MODE) {
+ send_cmd(ServerName, "%s %s %s%s%s",
+ send_token("SVS2MODE", "v"), u->nick, av[0],
+ (ac == 2 ? " " : ""), (ac == 2 ? av[1] : ""));
+ } else {
+ send_cmd(ServerName, "%s %s %s%s%s",
+ send_token("SVSMODE", "n"), u->nick, av[0],
+ (ac == 2 ? " " : ""), (ac == 2 ? av[1] : ""));
+ }
+ }
}
/* 372 */
@@ -547,16 +795,19 @@ void anope_cmd_376(char *source)
void anope_cmd_nick(char *nick, char *name, char *modes)
{
- send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 %s * :%s", nick, time(NULL),
- ServiceUser, ServiceHost, ServerName, modes, name);
+ EnforceQlinedNick(nick, NULL);
+ send_cmd(NULL, "%s %s 1 %ld %s %s %s 0 %s * :%s",
+ send_token("NICK", "&"), nick, time(NULL), ServiceUser,
+ ServiceHost, ServerName, modes, name);
anope_cmd_sqline(nick, "Reserved for services");
}
void anope_cmd_guest_nick(char *nick, char *user, char *host, char *real,
char *modes)
{
- send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 %s * :%s", nick, time(NULL),
- user, host, ServerName, modes, real);
+ send_cmd(NULL, "%s %s 1 %ld %s %s %s 0 %s * :%s",
+ send_token("NICK", "&"), nick, time(NULL), user, host,
+ ServerName, modes, real);
}
void anope_cmd_mode(char *source, char *dest, const char *fmt, ...)
@@ -574,14 +825,16 @@ void anope_cmd_mode(char *source, char *dest, const char *fmt, ...)
return;
}
- send_cmd(source, "MODE %s %s", dest, buf);
+ send_cmd(source, "%s %s %s", send_token("MODE", "G"), dest, buf);
}
void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real,
char *modes)
{
- send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 %s * :%s", nick, time(NULL),
- user, host, ServerName, modes, real);
+ EnforceQlinedNick(nick, s_BotServ);
+ send_cmd(NULL, "%s %s 1 %ld %s %s %s 0 %s * :%s",
+ send_token("NICK", "&"), nick, time(NULL), user, host,
+ ServerName, modes, real);
anope_cmd_sqline(nick, "Reserved for services");
}
@@ -599,9 +852,10 @@ void anope_cmd_kick(char *source, char *chan, char *user, const char *fmt,
}
if (buf) {
- send_cmd(source, "KICK %s %s :%s", chan, user, buf);
+ send_cmd(source, "%s %s %s :%s", send_token("KICK", "H"), chan,
+ user, buf);
} else {
- send_cmd(source, "KICK %s %s", chan, user);
+ send_cmd(source, "%s %s %s", send_token("KICK", "H"), chan, user);
}
}
@@ -620,7 +874,7 @@ void anope_cmd_notice_ops(char *source, char *dest, const char *fmt, ...)
return;
}
- send_cmd(NULL, "NOTICE @%s :%s", dest, buf);
+ send_cmd(NULL, "%s @%s :%s", send_token("NOTICE", "B"), dest, buf);
}
@@ -642,13 +896,14 @@ void anope_cmd_notice(char *source, char *dest, const char *fmt, ...)
if (UsePrivmsg) {
anope_cmd_privmsg2(source, dest, buf);
} else {
- send_cmd(source, "NOTICE %s :%s", dest, buf);
+ send_cmd(source, "%s %s :%s", send_token("NOTICE", "B"), dest,
+ buf);
}
}
void anope_cmd_notice2(char *source, char *dest, char *msg)
{
- send_cmd(source, "NOTICE %s :%s", dest, msg);
+ send_cmd(source, "%s %s :%s", send_token("NOTICE", "B"), dest, msg);
}
void anope_cmd_privmsg(char *source, char *dest, const char *fmt, ...)
@@ -666,22 +921,22 @@ void anope_cmd_privmsg(char *source, char *dest, const char *fmt, ...)
return;
}
- send_cmd(source, "PRIVMSG %s :%s", dest, buf);
+ send_cmd(source, "%s %s :%s", send_token("PRIVMSG", "!"), dest, buf);
}
void anope_cmd_privmsg2(char *source, char *dest, char *msg)
{
- send_cmd(source, "PRIVMSG %s :%s", dest, msg);
+ send_cmd(source, "%s %s :%s", send_token("PRIVMSG", "!"), dest, msg);
}
void anope_cmd_serv_notice(char *source, char *dest, char *msg)
{
- send_cmd(source, "NOTICE $%s :%s", dest, msg);
+ send_cmd(source, "%s $%s :%s", send_token("NOTICE", "B"), dest, msg);
}
void anope_cmd_serv_privmsg(char *source, char *dest, char *msg)
{
- send_cmd(source, "PRIVMSG $%s :%s", dest, msg);
+ send_cmd(source, "%s $%s :%s", send_token("PRIVMSG", "!"), dest, msg);
}
void anope_cmd_bot_chan_mode(char *nick, char *chan)
@@ -710,20 +965,36 @@ void anope_cmd_quit(char *source, const char *fmt, ...)
}
if (buf) {
- send_cmd(source, "QUIT :%s", buf);
+ send_cmd(source, "%s :%s", send_token("QUIT", ","), buf);
} else {
- send_cmd(source, "QUIT");
+ send_cmd(source, "%s", send_token("QUIT", ","));
}
}
/* PROTOCTL */
-void anope_cmd_protoctl()
+/*
+ NICKv2 = Nick Version 2
+ VHP = Sends hidden host
+ UMODE2 = sends UMODE2 on user modes
+ NICKIP = Sends IP on NICK
+ TOKEN = Use tokens to talk
+ SJ3 = Supports SJOIN
+ NOQUIT = No Quit
+ TKLEXT = Extended TKL we don't use it but best to have it
+ SJB64 = Base64 encoded time stamps
+ VL = Version Info
+ NS = Numeric Server
+
+*/
+void anope_cmd_capab()
{
- /*
- See Unreal's protoctl.txt for reference
- VHP - Send hostnames in NICKv2 even if not sethosted
- */
- send_cmd(NULL, "PROTOCTL NICKv2 VHP");
+ if (UseTokens) {
+ send_cmd(NULL,
+ "PROTOCTL NICKv2 VHP UMODE2 NICKIP TOKEN SJOIN SJOIN2 SJ3 NOQUIT TKLEXT SJB64");
+ } else {
+ send_cmd(NULL,
+ "PROTOCTL NICKv2 VHP UMODE2 NICKIP SJOIN SJOIN2 SJ3 NOQUIT TKLEXT SJB64");
+ }
}
/* PASS */
@@ -742,7 +1013,7 @@ void anope_cmd_server(char *servname, int hop, char *descript)
/* PONG */
void anope_cmd_pong(char *servname, char *who)
{
- send_cmd(servname, "PONG %s", who);
+ send_cmd(servname, "%s %s", send_token("PONG", "9"), who);
}
/* JOIN */
@@ -750,16 +1021,19 @@ void anope_cmd_pong(char *servname, char *who)
we get it in the common function call */
void anope_cmd_join(char *user, char *channel, time_t chantime)
{
- send_cmd(user, "JOIN %s", channel);
+ send_cmd(user, "%s %s", send_token("JOIN", "C"), channel);
}
-/* UNSQLINE */
+/* unsqline
+** parv[0] = sender
+** parv[1] = nickmask
+*/
void anope_cmd_unsqline(char *user)
{
if (!user) {
return;
}
- send_cmd(NULL, "UNSQLINE %s", user);
+ send_cmd(NULL, "%s %s", send_token("UNSQLINE", "d"), user);
}
/* CHGHOST */
@@ -768,7 +1042,8 @@ void anope_cmd_chghost(char *nick, char *vhost)
if (!nick || !vhost) {
return;
}
- send_cmd(ServerName, "CHGHOST %s %s", nick, vhost);
+ send_cmd(ServerName, "%s %s %s", send_token("CHGHOST", "AL"), nick,
+ vhost);
}
/* CHGIDENT */
@@ -777,7 +1052,8 @@ void anope_cmd_chgident(char *nick, char *vIdent)
if (!nick || !vIdent) {
return;
}
- send_cmd(ServerName, "CHGIDENT %s %s", nick, vIdent);
+ send_cmd(ServerName, "%s %s %s", send_token("CHGIDENT", "AZ"), nick,
+ vIdent);
}
/* INVITE */
@@ -787,7 +1063,7 @@ void anope_cmd_invite(char *source, char *chan, char *nick)
return;
}
- send_cmd(source, "INVITE %s %s", nick, chan);
+ send_cmd(source, "%s %s %s", send_token("INVITE", "*"), nick, chan);
}
/* PART */
@@ -808,9 +1084,9 @@ void anope_cmd_part(char *nick, char *chan, const char *fmt, ...)
}
if (buf) {
- send_cmd(nick, "PART %s :%s", chan, buf);
+ send_cmd(nick, "%s %s :%s", send_token("PART", "D"), chan, buf);
} else {
- send_cmd(nick, "PART %s", chan);
+ send_cmd(nick, "%s %s", send_token("PART", "D"), chan);
}
}
@@ -1025,17 +1301,26 @@ void anope_cmd_global(char *source, const char *fmt, ...)
return;
}
- send_cmd(source ? source : ServerName, "GLOBOPS :%s", buf);
+ send_cmd(source ? source : ServerName, "%s :%s",
+ send_token("GLOBOPS", "]"), buf);
}
/* SQLINE */
+/*
+** parv[0] = sender
+** parv[1] = nickmask
+** parv[2] = reason
+**
+** - Unreal will translate this to TKL for us
+**
+*/
void anope_cmd_sqline(char *mask, char *reason)
{
if (!mask || !reason) {
return;
}
- send_cmd(NULL, "SQLINE %s :%s", mask, reason);
+ send_cmd(NULL, "%s %s :%s", send_token("SQLINE", "c"), mask, reason);
}
/* SQUIT */
@@ -1045,17 +1330,23 @@ void anope_cmd_squit(char *servname, char *message)
return;
}
- send_cmd(servname, "SQUIT %s :%s", servname, message);
+ send_cmd(servname, "%s %s :%s", send_token("SQUIT", "-"), servname,
+ message);
}
-/* SVSO */
+/*
+** svso
+** parv[0] = sender prefix
+** parv[1] = nick
+** parv[2] = options
+*/
void anope_cmd_svso(char *source, char *nick, char *flag)
{
if (!source || !nick || !flag) {
return;
}
- send_cmd(source, "SVSO %s %s", nick, flag);
+ send_cmd(source, "%s %s %s", send_token("SVSO", "BB"), nick, flag);
}
/* NICK <newnick> */
@@ -1065,16 +1356,23 @@ void anope_cmd_chg_nick(char *oldnick, char *newnick)
return;
}
- send_cmd(oldnick, "NICK %s", newnick);
+ send_cmd(oldnick, "%s %s", send_token("NICK", "&"), newnick);
}
/* SVSNICK */
+/*
+** parv[0] = sender
+** parv[1] = old nickname
+** parv[2] = new nickname
+** parv[3] = timestamp
+*/
void anope_cmd_svsnick(char *source, char *guest, time_t when)
{
if (!source || !guest) {
return;
}
- send_cmd(NULL, "SVSNICK %s %s :%ld", source, guest, when);
+ send_cmd(NULL, "%S %s %s :%ld", send_token("SVSNICK", "e"), source,
+ guest, when);
}
/* Functions that use serval cmd functions */
@@ -1096,7 +1394,7 @@ void anope_cmd_connect(int servernum)
servernum = 1;
}
- anope_cmd_protoctl();
+ anope_cmd_capab();
if (servernum == 1) {
anope_cmd_pass(RemotePassword);
}
@@ -1137,8 +1435,8 @@ int anope_event_netinfo(char *source, int ac, char **av)
void anope_cmd_netinfo(int ac, char **av)
{
- send_cmd(NULL, "NETINFO 0 %d %d %s 0 0 0 :%s", atoi(av[1]),
- atoi(av[2]), av[3], av[7]);
+ send_cmd(NULL, "%s 0 %d %d %s 0 0 0 :%s", send_token("NETINFO", "AO"),
+ atoi(av[1]), atoi(av[2]), av[3], av[7]);
}
/* TKL
@@ -1162,6 +1460,11 @@ int anope_event_tkl(char *source, int ac, char **av)
int anope_event_eos(char *source, int ac, char **av)
{
+ Server *s;
+ s = findserver(servlist, source);
+ if (s) {
+ s->sync = 1;
+ }
return MOD_CONT;
}
@@ -1246,6 +1549,20 @@ int anope_event_mode(char *source, int ac, char **av)
return MOD_CONT;
}
+/* Unreal sends USER modes with this */
+/*
+ umode2
+ parv[0] - sender
+ parv[1] - modes to change
+*/
+int anope_event_umode2(char *source, int ac, char **av)
+{
+ if (ac < 1)
+ return MOD_CONT;
+
+ do_umode2(source, ac, av);
+ return MOD_CONT;
+}
int anope_event_kill(char *source, int ac, char **av)
{
@@ -1395,6 +1712,11 @@ int anope_event_sethost(char *source, int ac, char **av)
** parv[0] = new nickname
** parv[1] = hopcount
*/
+/*
+ do_nick(const char *source, char *nick, char *username, char *host,
+ char *server, char *realname, time_t ts, uint32 svid,
+ uint32 ip, char *vhost, char *uid)
+*/
int anope_event_nick(char *source, int ac, char **av)
{
User *user;
@@ -1409,7 +1731,17 @@ int anope_event_nick(char *source, int ac, char **av)
*/
do_nick(source, av[0], av[3], av[4], av[5], av[6],
strtoul(av[2], NULL, 10), 0, 0, "*", NULL);
+
+ } else if (ac == 11) {
+ user = do_nick(source, av[0], av[3], av[4], av[5], av[10],
+ strtoul(av[2], NULL, 10), strtoul(av[6], NULL,
+ 0),
+ base64dec(av[9]), av[8], NULL);
+ if (user)
+ anope_set_umode(user, 1, &av[7]);
+
} else {
+ /* NON NICKIP */
user = do_nick(source, av[0], av[3], av[4], av[5], av[9],
strtoul(av[2], NULL, 10), strtoul(av[6], NULL,
0), 0, av[8],
@@ -1446,10 +1778,18 @@ int anope_event_chghost(char *source, int ac, char **av)
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
+ char *desc;
+ char *vl;
+ char *numeric;
if (!stricmp(av[1], "1"))
uplink = sstrdup(av[0]);
- do_server(source, ac, av);
+
+ vl = myStrGetToken(av[2], ' ', 0);
+ numeric = myStrGetToken(vl, '-', 2);
+ desc = myStrGetTokenRemainder(av[2], ' ', 1);
+ do_server(source, av[0], av[1], desc, numeric);
+
return MOD_CONT;
}
@@ -1523,7 +1863,13 @@ void anope_cmd_unban(char *name, char *nick)
/* sent if svid is something weird */
void anope_cmd_svid_umode(char *nick, time_t ts)
{
- send_cmd(ServerName, "SVSMODE %s +d 1", nick);
+ if (UseSVS2MODE) {
+ send_cmd(ServerName, "%s %s +d 1", send_token("SVS2MODE", "v"),
+ nick);
+ } else {
+ send_cmd(ServerName, "%s %s +d 1", send_token("SVSMODE", "n"),
+ nick);
+ }
}
/* SVSMODE +d */
@@ -1545,7 +1891,7 @@ void anope_cmd_svid_umode2(User * u, char *ts)
void anope_cmd_svid_umode3(User * u, char *ts)
{
- /* not used */
+ // not used
}
int anope_event_error(char *source, int ac, char **av)
@@ -1568,4 +1914,145 @@ int anope_event_smo(char *source, int ac, char **av)
return MOD_CONT;
}
+/* svsjoin
+ parv[0] - sender
+ parv[1] - nick to make join
+ parv[2] - channel(s) to join
+ parv[3] - (optional) channel key(s)
+ - current we do not support the keys part
+*/
+void anope_cmd_svsjoin(char *source, char *nick, char *chan)
+{
+ send_cmd(source, "%s %s :%s", send_token("SVSJOIN", "BR"), nick, chan);
+}
+
+/* svspart
+ parv[0] - sender
+ parv[1] - nick to make part
+ parv[2] - channel(s) to part
+*/
+void anope_cmd_svspart(char *source, char *nick, char *chan)
+{
+ send_cmd(source, "%s %s :%s", send_token("SVSPART", "BT"), nick, chan);
+}
+
+int anope_event_globops(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_swhois(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+
+int anope_event_rehash(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_credits(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_admin(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+
+int anope_event_sdesc(char *source, int ac, char **av)
+{
+ Server *s;
+ s = findserver(servlist, source);
+
+ if (s) {
+ s->desc = av[0];
+ }
+
+ return MOD_CONT;
+}
+
+
+int anope_event_sjoin(char *source, int ac, char **av)
+{
+ do_sjoin(source, ac, av);
+ return MOD_CONT;
+}
+
+
+void anope_cmd_swhois(char *source, char *who, char *mask)
+{
+ send_cmd(source, "SWHOIS %s :%s", who, mask);
+}
+
+void anope_cmd_eob()
+{
+ send_cmd(ServerName, "EOS");
+}
+
+
+/* svswatch
+ * parv[0] - sender
+ * parv[1] - target nick
+ * parv[2] - parameters
+ */
+void anope_cmd_svswatch(char *sender, char *nick, char *parm)
+{
+ send_cmd(sender, "SVSWATCH %s :%s", nick, parm);
+}
+
+/* check if +f mode is valid for the ircd */
+/* borrowed part of the new check from channels.c in Unreal */
+int anope_flood_mode_check(char *value)
+{
+ char *dp, *end;
+ /* NEW +F */
+ char xbuf[256], *p, *p2, *x = xbuf + 1;
+ int v;
+
+ if (!value) {
+ return 0;
+ }
+
+ if (*value != ':'
+ && (strtoul((*value == '*' ? value + 1 : value), &dp, 10) > 0)
+ && (*dp == ':') && (*(++dp) != 0) && (strtoul(dp, &end, 10) > 0)
+ && (*end == 0)) {
+ return 1;
+ } else {
+ /* '['<number><1 letter>[optional: '#'+1 letter],[next..]']'':'<number> */
+ strncpy(xbuf, value, sizeof(xbuf));
+ p2 = strchr(xbuf + 1, ']');
+ if (!p2) {
+ return 0;
+ }
+ *p2 = '\0';
+ if (*(p2 + 1) != ':') {
+ return 0;
+ }
+ for (x = strtok(xbuf + 1, ","); x; x = strtok(NULL, ",")) {
+ /* <number><1 letter>[optional: '#'+1 letter] */
+ p = x;
+ while (isdigit(*p)) {
+ p++;
+ }
+ if ((*p == '\0')
+ || !((*p == 'c') || (*p == 'j') || (*p == 'k')
+ || (*p == 'm') || (*p == 'n') || (*p == 't'))) {
+ continue; /* continue instead of break for forward compatability. */
+ }
+ *p = '\0';
+ v = atoi(x);
+ if ((v < 1) || (v > 999)) {
+ return 0;
+ }
+ p++;
+ }
+ return 1;
+ }
+}
+
#endif
diff --git a/src/users.c b/src/users.c
index a3b4fa8fe..bcbc56b69 100644
--- a/src/users.c
+++ b/src/users.c
@@ -383,6 +383,12 @@ User *do_nick(const char *source, char *nick, char *username, char *host,
if (debug)
alog("debug: new user: %s", nick);
+ if (ircd->nickip && ip) {
+ addr.s_addr = htonl(ip);
+ ntoa(addr, ipbuf, sizeof(ipbuf));
+ }
+
+
if (LogUsers) {
/**
* Ugly swap routine for Flop's bug :)
@@ -398,11 +404,6 @@ User *do_nick(const char *source, char *nick, char *username, char *host,
* End of ugly swap
**/
- if (ircd->nickip) {
- addr.s_addr = htonl(ip);
- ntoa(addr, ipbuf, sizeof(ipbuf));
- }
-
if (ircd->nickvhost) {
if (ircd->nickip) {
alog("LOGUSERS: %s (%s@%s => %s) (%s) [%s] connected to the network (%s).", nick, username, host, vhost, realname, ipbuf, server);
@@ -647,6 +648,24 @@ void do_umode(const char *source, int ac, char **av)
anope_set_umode(user, ac - 1, &av[1]);
}
+/* Handle a UMODE2 command for a user.
+ * av[0] = modes
+ */
+
+void do_umode2(const char *source, int ac, char **av)
+{
+ User *user;
+
+ user = finduser(source);
+ if (!user) {
+ alog("user: MODE %s for nonexistent nick %s: %s", av[0], source,
+ merge_args(ac, av));
+ return;
+ }
+
+ anope_set_umode(user, ac - 1, &av[0]);
+}
+
/*************************************************************************/
/* Handle a QUIT command.
@@ -835,6 +854,45 @@ int match_usermask(const char *mask, User * user)
return result;
}
+
+/*************************************************************************/
+
+/* simlar to match_usermask, except here we pass the host as the IP */
+
+int match_userip(const char *mask, User * user, char *iphost)
+{
+ char *mask2 = sstrdup(mask);
+ char *nick, *username, *host;
+ int result;
+
+ if (strchr(mask2, '!')) {
+ nick = strtok(mask2, "!");
+ username = strtok(NULL, "@");
+ } else {
+ nick = NULL;
+ username = strtok(mask2, "@");
+ }
+ host = strtok(NULL, "");
+ if (!username || !host) {
+ free(mask2);
+ return 0;
+ }
+
+ if (nick) {
+ result = match_wild_nocase(nick, user->nick)
+ && match_wild_nocase(username, user->username)
+ && (match_wild_nocase(host, iphost)
+ || match_wild_nocase(host, user->vhost));
+ } else {
+ result = match_wild_nocase(username, user->username)
+ && (match_wild_nocase(host, iphost)
+ || match_wild_nocase(host, user->vhost));
+ }
+
+ free(mask2);
+ return result;
+}
+
/*************************************************************************/
/* Split a usermask up into its constitutent parts. Returned strings are
diff --git a/src/viagra.c b/src/viagra.c
index 528db9dd5..9a4cd1393 100644
--- a/src/viagra.c
+++ b/src/viagra.c
@@ -89,6 +89,9 @@ IRCDVar ircd[] = {
1,
1, /* No Knock requires +i */
NULL, /* CAPAB Chan Modes */
+ 0, /* We support TOKENS */
+ 1, /* TOKENS are CASE inSensitive */
+ 1, /* validate - to the #:# standard */
}
,
{NULL}
@@ -222,7 +225,7 @@ char csmodes[128] = {
0,
0,
0, 0, 0,
- 0,
+ 'h',
0, 0, 0, 0,
0,
'v', 0, 0, 0, 0,
@@ -474,7 +477,11 @@ int anope_event_chgident(char *source, int ac, char **av)
return MOD_CONT;
}
-
+/*
+ * sethost
+ * parv[0] = sender
+ * parv[1] = newhost
+ */
int anope_event_sethost(char *source, int ac, char **av)
{
User *u;
@@ -555,6 +562,69 @@ int anope_event_436(char *source, int ac, char **av)
return MOD_CONT;
}
+int anope_event_notice(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_pass(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_svinfo(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+/*
+ * gnotice
+ * parv[0] = sender prefix
+ * parv[1] = message text
+ */
+int anope_event_gnotice(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_sqline(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_burst(char *source, int ac, char **av)
+{
+ Server *s;
+ s = findserver(servlist, source);
+ if (!ac) {
+ /* for future use - start burst */
+ } else {
+ if (s) {
+ s->sync = 1;
+ }
+ }
+ return MOD_CONT;
+}
+
+int anope_event_tctrl(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+/*
+ * error
+ * parv[0] = sender prefix
+ * parv[*] = parameters
+ */
+int anope_event_error(char *source, int ac, char **av)
+{
+ if (ac >= 1) {
+ if (debug) {
+ alog("ERROR: %s", av[0]);
+ }
+ }
+ return MOD_CONT;
+}
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
@@ -563,16 +633,16 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("401", NULL); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
- m = createMessage("INVITE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("INVITE", anope_event_invite); addCoreMessage(IRCD,m);
m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m);
m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m);
m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m);
m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m);
m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m);
- m = createMessage("NOTICE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m);
m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m);
- m = createMessage("PASS", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m);
m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m);
m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m);
m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m);
@@ -583,7 +653,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m);
m = createMessage("AKILL", NULL); addCoreMessage(IRCD,m);
m = createMessage("GLOBOPS", NULL); addCoreMessage(IRCD,m);
- m = createMessage("GNOTICE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("GNOTICE", anope_event_gnotice); addCoreMessage(IRCD,m);
m = createMessage("GOPER", NULL); addCoreMessage(IRCD,m);
m = createMessage("RAKILL", NULL); addCoreMessage(IRCD,m);
m = createMessage("SILENCE", NULL); addCoreMessage(IRCD,m);
@@ -591,9 +661,8 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("SVSMODE", NULL); addCoreMessage(IRCD,m);
m = createMessage("SVSNICK", NULL); addCoreMessage(IRCD,m);
m = createMessage("SVSNOOP", NULL); addCoreMessage(IRCD,m);
- m = createMessage("SQLINE", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("SQLINE", anope_event_sqline); addCoreMessage(IRCD,m);
m = createMessage("UNSQLINE", NULL); addCoreMessage(IRCD,m);
-
m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m);
m = createMessage("CS", anope_event_cs); addCoreMessage(IRCD,m);
m = createMessage("HS", anope_event_hs); addCoreMessage(IRCD,m);
@@ -604,7 +673,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("SGLINE", NULL); addCoreMessage(IRCD,m);
m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m);
m = createMessage("SS", NULL); addCoreMessage(IRCD,m);
- m = createMessage("SVINFO", NULL); addCoreMessage(IRCD,m);
+ m = createMessage("SVINFO", anope_event_svinfo); addCoreMessage(IRCD,m);
m = createMessage("SZLINE", NULL); addCoreMessage(IRCD,m);
m = createMessage("UNSGLINE", NULL); addCoreMessage(IRCD,m);
m = createMessage("UNSZLINE", NULL); addCoreMessage(IRCD,m);
@@ -615,6 +684,12 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("SETIDENT", anope_event_setident); addCoreMessage(IRCD,m);
m = createMessage("SETNAME", anope_event_setname); addCoreMessage(IRCD,m);
m = createMessage("VS", anope_event_vs); addCoreMessage(IRCD,m);
+ m = createMessage("BURST", anope_event_burst); addCoreMessage(IRCD,m);
+ m = createMessage("TCTRL", anope_event_tctrl); addCoreMessage(IRCD,m);
+ m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
+ m = createMessage("REHASH", anope_event_rehash); addCoreMessage(IRCD,m);
+ m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
+ m = createMessage("SNOTICE", anope_event_snotice); addCoreMessage(IRCD,m);
}
/* *INDENT-ON* */
@@ -650,6 +725,11 @@ void anope_cmd_svsnoop(char *server, int set)
send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
}
+void anope_cmd_svsadmin(char *server, int set)
+{
+ anope_cmd_svsnoop(server, set);
+}
+
void anope_cmd_sgline(char *mask, char *reason)
{
send_cmd(NULL, "SGLINE %d :%s:%s", strlen(mask), mask, reason);
@@ -714,6 +794,16 @@ void anope_cmd_join(char *user, char *channel, time_t chantime)
send_cmd(user, "SJOIN %ld %s", chantime, channel);
}
+
+/*
+ * m_akill()
+ * parv[1]=host
+ * parv[2]=user
+ * parv[3]=length
+ * parv[4]=akiller
+ * parv[5]=time set
+ * parv[6]=reason
+ */
void anope_cmd_akill(char *user, char *host, char *who, time_t when,
time_t expires, char *reason)
{
@@ -721,6 +811,14 @@ void anope_cmd_akill(char *user, char *host, char *who, time_t when,
time(NULL), reason);
}
+
+/*
+ * svskill
+ * parv[0] = servername
+ * parv[1] = client
+ * parv[2] = nick stamp
+ * parv[3] = kill message
+ */
void anope_cmd_svskill(char *source, char *user, const char *fmt, ...)
{
va_list args;
@@ -836,18 +934,26 @@ void anope_cmd_connect(int servernum)
anope_cmd_capab();
anope_cmd_server(ServerName, 1, ServerDesc);
anope_cmd_svinfo();
+ anope_cmd_burst();
}
-/* SVINFO */
+/*
+ * svinfo
+ * parv[0] = sender prefix
+ * parv[1] = TS_CURRENT for the server
+ * parv[2] = TS_MIN for the server
+ * parv[3] = server is standalone or connected to non-TS only
+ * parv[4] = server's idea of UTC time
+ */
void anope_cmd_svinfo()
{
- send_cmd(NULL, "SVINFO 3 1 0 :%ld", time(NULL));
+ send_cmd(NULL, "SVINFO 5 3 0 :%ld", time(NULL));
}
/* CAPAB */
void anope_cmd_capab()
{
- send_cmd(NULL, "CAPAB NICKIP SSJOIN TS3 NOQUIT TSMODE UNCONNECT");
+ send_cmd(NULL, "CAPAB TS5 NOQUIT SSJOIN BURST UNCONNECT NICKIP");
}
/* PASS */
@@ -862,43 +968,48 @@ void anope_cmd_server(char *servname, int hop, char *descript)
send_cmd(NULL, "SERVER %s %d :%s", ServerName, hop, ServerDesc);
}
+/* EVENT : OS */
int anope_event_os(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_OperServ, av[0]);
return MOD_CONT;
}
+/* EVENT : NS */
int anope_event_ns(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_NickServ, av[0]);
return MOD_CONT;
}
+/* EVENT : MS */
int anope_event_ms(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_MemoServ, av[0]);
return MOD_CONT;
}
+/* EVENT : HS */
int anope_event_hs(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_HostServ, av[0]);
return MOD_CONT;
}
+/* EVENT : CS */
int anope_event_cs(char *source, int ac, char **av)
{
if (ac < 1)
return MOD_CONT;
- m_privmsg(source, av[0], av[1]);
+ m_privmsg(source, s_ChanServ, av[0]);
return MOD_CONT;
}
@@ -909,7 +1020,7 @@ int anope_event_server(char *source, int ac, char **av)
if (!stricmp(av[1], "1")) {
uplink = sstrdup(av[0]);
}
- do_server(source, ac, av);
+ do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1321,6 +1432,7 @@ void anope_cmd_351(char *source)
void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real,
char *modes)
{
+ EnforceQlinedNick(nick, s_BotServ);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, time(NULL),
modes, user, host, ServerName, real);
anope_cmd_sqline(nick, "Reserved for services");
@@ -1348,6 +1460,7 @@ void anope_cmd_kick(char *source, char *chan, char *user, const char *fmt,
void anope_cmd_nick(char *nick, char *name, char *modes)
{
+ EnforceQlinedNick(nick, NULL);
send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, time(NULL),
modes, ServiceUser, ServiceHost, ServerName, name);
anope_cmd_sqline(nick, "Reserved for services");
@@ -1474,4 +1587,66 @@ void anope_cmd_chg_nick(char *oldnick, char *newnick)
send_cmd(oldnick, "NICK %s", newnick);
}
+/*
+ * svsjoin
+ * parv[0] = sender
+ * parv[1] = nick to make join
+ * parv[2] = channel(s) to join
+ */
+void anope_cmd_svsjoin(char *source, char *nick, char *chan)
+{
+ send_cmd(source, "SVSJOIN %s :%s", nick, chan);
+}
+
+/*
+ * svspart
+ * parv[0] = sender
+ * parv[1] = nick to make part
+ * parv[2] = channel(s) to part
+ */
+void anope_cmd_svspart(char *source, char *nick, char *chan)
+{
+ send_cmd(source, "SVSPART %s :%s", nick, chan);
+}
+
+void anope_cmd_swhois(char *source, char *who, char *mask)
+{
+ /* not supported */
+}
+
+int anope_flood_mode_check(char *value)
+{
+ return 0;
+}
+
+int anope_event_rehash(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_admin(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_snotice(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+int anope_event_invite(char *source, int ac, char **av)
+{
+ return MOD_CONT;
+}
+
+void anope_cmd_burst()
+{
+ send_cmd(NULL, "BURST");
+}
+
+void anope_cmd_eob()
+{
+ send_cmd(NULL, "BURST 0");
+}
+
#endif
diff --git a/version.log b/version.log
index a7f645867..4dfaf4109 100644
--- a/version.log
+++ b/version.log
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="5"
-VERSION_BUILD="356"
+VERSION_BUILD="362"
# $Log$
#
+# BUILD : 1.7.5 (362)
+# BUGS : 17 143 147 166 172 173
+# NOTES : Applied patch 927 provided by Trystan.
+#
# BUILD : 1.7.5 (356)
# BUGS : N/A
# NOTES : Fuixed mysql include issue, it should now detect to use mysql/mysql/h or not