1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 10:06:38 +02:00

Rejoin our clients if kicked on TS6 IRCDs and made ratbox protocol module use account tracking

This commit is contained in:
Adam
2011-02-23 18:52:13 -05:00
parent a4c81c72c1
commit 54acc25eb3
4 changed files with 85 additions and 21 deletions
+8
View File
@@ -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
+74 -20
View File
@@ -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;
}
+1
View File
@@ -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);
+2 -1
View File
@@ -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