summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-02-23 18:52:13 -0500
committerAdam <Adam@anope.org>2011-02-23 18:52:13 -0500
commit54acc25eb3bd81c09261cc14258da5436c1a803d (patch)
tree01c8e662cc48fd212ba40a167da2883b05e8abcb
parenta4c81c72c12a8ab73649c9fbf4987e6cbe3e7c97 (diff)
Rejoin our clients if kicked on TS6 IRCDs and made ratbox protocol module use account tracking
-rw-r--r--src/channels.c8
-rw-r--r--src/protocol/ratbox.c94
-rw-r--r--src/protocol/ratbox.h1
-rw-r--r--version.log3
4 files changed, 85 insertions, 21 deletions
diff --git a/src/channels.c b/src/channels.c
index a2f11b7c6..59efc7d92 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -640,6 +640,7 @@ void do_kick(const char *source, int ac, char **av)
User *user;
char *s, *t;
struct u_chanlist *c;
+ Uid *uid;
t = av[1];
while (*(s = t)) {
@@ -647,6 +648,13 @@ void do_kick(const char *source, int ac, char **av)
if (*t)
*t++ = 0;
+ if (ircd->ts6 && UseTS6)
+ {
+ uid = find_nickuid(s);
+ if (uid)
+ s = uid->nick;
+ }
+
/* If it is the bot that is being kicked, we make it rejoin the
* channel and stop immediately.
* --lara
diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c
index 587868026..18ccbe0fe 100644
--- a/src/protocol/ratbox.c
+++ b/src/protocol/ratbox.c
@@ -18,25 +18,25 @@
IRCDVar myIrcd[] = {
{"Ratbox 2.0+", /* ircd name */
- "+oi", /* nickserv mode */
- "+oi", /* chanserv mode */
- "+oi", /* memoserv mode */
- "+oi", /* hostserv mode */
- "+oai", /* operserv mode */
- "+oi", /* botserv mode */
- "+oi", /* helpserv mode */
- "+oi", /* Dev/Null mode */
- "+oi", /* Global mode */
- "+oi", /* nickserv alias mode */
- "+oi", /* chanserv alias mode */
- "+oi", /* memoserv alias mode */
- "+oi", /* hostserv alias mode */
- "+oai", /* operserv alias mode */
- "+oi", /* botserv alias mode */
- "+oi", /* helpserv alias mode */
- "+oi", /* Dev/Null alias mode */
- "+oi", /* Global alias mode */
- "+oi", /* Used by BotServ Bots */
+ "+oiS", /* nickserv mode */
+ "+oiS", /* chanserv mode */
+ "+oiS", /* memoserv mode */
+ "+oiS", /* hostserv mode */
+ "+oaiS", /* operserv mode */
+ "+oiS", /* botserv mode */
+ "+oiS", /* helpserv mode */
+ "+oiS", /* Dev/Null mode */
+ "+oiS", /* Global mode */
+ "+oiS", /* nickserv alias mode */
+ "+oiS", /* chanserv alias mode */
+ "+oiS", /* memoserv alias mode */
+ "+oiS", /* hostserv alias mode */
+ "+oaiS", /* operserv alias mode */
+ "+oiS", /* botserv alias mode */
+ "+oiS", /* helpserv alias mode */
+ "+oiS", /* Dev/Null alias mode */
+ "+oiS", /* Global alias mode */
+ "+oiS", /* Used by BotServ Bots */
2, /* Chan Max Symbols */
"-acilmnpst", /* Modes to Remove */
"+o", /* Channel Umode used by Botserv bots */
@@ -550,6 +550,20 @@ void ratbox_cmd_global_legacy(char *source, char *fmt)
send_cmd(source ? source : ServerName, "OPERWALL :%s", fmt);
}
+int ratbox_login(int argc, char **argv)
+{
+ send_cmd((UseTS6 ? TS6SID : ServerName), "ENCAP * SU %s :%s", argv[0], argv[0]);
+
+ return MOD_CONT;
+}
+
+int ratbox_logout(int argc, char **argv)
+{
+ send_cmd((UseTS6 ? TS6SID : ServerName), "ENCAP * SU %s", argv[0]);
+
+ return MOD_CONT;
+}
+
int anope_event_sjoin(char *source, int ac, char **av)
{
do_sjoin(source, ac, av);
@@ -762,7 +776,7 @@ void moduleAddIRCDMsgs(void)
m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
m = createMessage("421", anope_event_null); addCoreMessage(IRCD,m);
- m = createMessage("ENCAP", anope_event_null); addCoreMessage(IRCD,m);
+ m = createMessage("ENCAP", anope_event_encap); addCoreMessage(IRCD,m);
m = createMessage("SID", anope_event_sid); addCoreMessage(IRCD,m);
}
@@ -1154,6 +1168,36 @@ int anope_event_server(char *source, int ac, char **av)
return MOD_CONT;
}
+int anope_event_encap(char *source, int ac, char **av)
+{
+ if (ac > 2 && !strcmp(av[1], "LOGIN"))
+ {
+ User *u = NULL;
+ if (UseTS6)
+ u = find_byuid(source);
+ if (!u)
+ u = finduser(source);
+ if (u && u->na && !nick_identified(u) && !strcmp(u->nick, av[2]))
+ {
+ u->na->status |= NS_IDENTIFIED;
+ check_memos(u);
+
+ if (NSNickTracking)
+ nsStartNickTracking(u);
+
+ u->na->last_seen = time(NULL);
+ if (u->na->last_usermask)
+ free(u->na->last_usermask);
+ u->na->last_usermask = smalloc(strlen(common_get_vident(u)) + strlen(common_get_vhost(u)) + 2);
+ sprintf(u->na->last_usermask, "%s@%s", common_get_vident(u), common_get_vhost(u));
+
+ alog("%s: %s!%s@%s automatically identified for nick %s", s_NickServ, u->nick, u->username, u->host, u->nick);
+ }
+ }
+
+ return MOD_CONT;
+}
+
int anope_event_sid(char *source, int ac, char **av)
{
Server *s;
@@ -1873,6 +1917,7 @@ void moduleAddAnopeCmds()
**/
int AnopeInit(int argc, char **argv)
{
+ EvtHook *hk;
moduleAddAuthor("Anope");
moduleAddVersion(VERSION_STRING);
@@ -1903,5 +1948,14 @@ int AnopeInit(int argc, char **argv)
moduleAddAnopeCmds();
moduleAddIRCDMsgs();
+ hk = createEventHook(EVENT_NICK_IDENTIFY, ratbox_login);
+ moduleAddEventHook(hk);
+
+ hk = createEventHook(EVENT_NICK_REGISTERED, ratbox_login);
+ moduleAddEventHook(hk);
+
+ hk = createEventHook(EVENT_NICK_LOGOUT, ratbox_logout);
+ moduleAddEventHook(hk);
+
return MOD_CONT;
}
diff --git a/src/protocol/ratbox.h b/src/protocol/ratbox.h
index 922e45959..0253896cb 100644
--- a/src/protocol/ratbox.h
+++ b/src/protocol/ratbox.h
@@ -117,4 +117,5 @@ void ratbox_cmd_jupe(char *jserver, char *who, char *reason);
int ratbox_valid_nick(char *nick);
void ratbox_cmd_ctcp(char *source, char *dest, char *buf);
+int anope_event_encap(char *source, int ac, char **av);
diff --git a/version.log b/version.log
index 946db3a30..ad6bab901 100644
--- a/version.log
+++ b/version.log
@@ -8,9 +8,10 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="5"
VERSION_EXTRA="-git"
-VERSION_BUILD="3060"
+VERSION_BUILD="3061"
# $Log$ # Changes since 1.8.5 Release
+#Revision 3061 - Rejoin our clients if kicked on TS6 IRCDs and made ratbox protocol module use account tracking
#Revision 3060 - Fixed bug 1248, an error in fr.l - reported by SaKa
#Revision 3059 - Fixed the wiki URLs in install.js
#Revision 3058 - Fixed not introducing our clients with usermode +k on InspIRCd 2.0