summaryrefslogtreecommitdiff
path: root/modules/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'modules/protocol')
-rw-r--r--modules/protocol/bahamut.cpp9
-rw-r--r--modules/protocol/inspircd11.cpp6
-rw-r--r--modules/protocol/inspircd12.cpp9
-rw-r--r--modules/protocol/inspircd20.cpp9
-rw-r--r--modules/protocol/ratbox.cpp7
-rw-r--r--modules/protocol/unreal32.cpp28
6 files changed, 29 insertions, 39 deletions
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index c1a223672..efe5e4d16 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -33,7 +33,6 @@ IRCDVar myIrcd[] = {
1, /* time stamp on mode */
0, /* O:LINE */
1, /* UMODE */
- 0, /* VHOST ON NICK */
1, /* No Knock requires +i */
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
@@ -446,23 +445,21 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
if (ac != 2)
{
- user = do_nick(source, av[0], av[4], av[5], av[6], av[9], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, av[8], "", "");
+ user = do_nick(source, av[0], av[4], av[5], av[6], av[9], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, av[8], "", "", av[3]);
if (user)
{
- UserSetInternalModes(user, 1, &av[3]);
-
NickAlias *na;
if (user->timestamp == convertTo<time_t>(av[7]) && (na = findnick(user->nick)))
{
user->Login(na->nc);
- user->SetMode(NickServ, CMODE_REGISTERED);
+ user->SetMode(NickServ, UMODE_REGISTERED);
}
else
validate_user(user);
}
}
else
- do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, "", "", "");
+ do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, "", "", "", "");
return MOD_CONT;
}
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp
index 8053a577a..c468c0f9a 100644
--- a/modules/protocol/inspircd11.cpp
+++ b/modules/protocol/inspircd11.cpp
@@ -34,7 +34,6 @@ IRCDVar myIrcd[] = {
0, /* time stamp on mode */
1, /* O:LINE */
1, /* UMODE */
- 1, /* VHOST ON NICK */
1, /* No Knock requires +i */
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
@@ -693,10 +692,9 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
{
time_t ts = Anope::string(av[0]).is_pos_number_only() ? convertTo<time_t>(av[0]) : 0;
- user = do_nick("", av[1], av[4], av[2], source, av[7], ts, av[6], av[3], "");
+ user = do_nick("", av[1], av[4], av[2], source, av[7], ts, av[6], av[3], "", av[5]);
if (user)
{
- UserSetInternalModes(user, 1, &av[5]);
user->SetCloakedHost(av[3]);
NickAlias *na = findnick(user->nick);
@@ -712,7 +710,7 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
}
}
else
- do_nick(source, av[0], "", "", "", "", 0, "", "", "");
+ do_nick(source, av[0], "", "", "", "", 0, "", "", "", "");
return MOD_CONT;
}
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp
index 574fa7791..dc5e0f613 100644
--- a/modules/protocol/inspircd12.cpp
+++ b/modules/protocol/inspircd12.cpp
@@ -34,7 +34,6 @@ IRCDVar myIrcd[] = {
0, /* time stamp on mode */
0, /* O:LINE */
1, /* UMODE */
- 1, /* VHOST ON NICK */
1, /* No Knock requires +i */
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
@@ -695,7 +694,7 @@ int anope_event_sethost(const Anope::string &source, int ac, const char **av)
int anope_event_nick(const Anope::string &source, int ac, const char **av)
{
- do_nick(source, av[0], "", "", "", "", 0, "", "", "");
+ do_nick(source, av[0], "", "", "", "", 0, "", "", "", "");
return MOD_CONT;
}
@@ -738,10 +737,12 @@ int anope_event_uid(const Anope::string &source, int ac, const char **av)
user->SetMode(NickServ, UMODE_REGISTERED);
}
- user = do_nick("", av[2], av[5], av[3], s->GetName(), av[ac - 1], ts, av[6], av[4], av[0]);
+ Anope::string modes = av[8];
+ for (int i = 9; i < ac - 1; ++i)
+ modes += Anope::string(" ") + av[i];
+ user = do_nick("", av[2], av[5], av[3], s->GetName(), av[ac - 1], ts, av[6], av[4], av[0], modes);
if (user)
{
- UserSetInternalModes(user, 1, &av[8]);
if (!user->server->IsSynced())
prev_u_intro = user;
else
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index 4ebd9711c..5740c43b8 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -34,7 +34,6 @@ IRCDVar myIrcd[] = {
0, /* time stamp on mode */
0, /* O:LINE */
1, /* UMODE */
- 1, /* VHOST ON NICK */
1, /* No Knock requires +i */
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
@@ -692,7 +691,7 @@ int anope_event_sethost(const Anope::string &source, int ac, const char **av)
int anope_event_nick(const Anope::string &source, int ac, const char **av)
{
- do_nick(source, av[0], "", "", "", "", 0, "", "", "");
+ do_nick(source, av[0], "", "", "", "", 0, "", "", "", "");
return MOD_CONT;
}
@@ -735,10 +734,12 @@ int anope_event_uid(const Anope::string &source, int ac, const char **av)
user->SetMode(NickServ, UMODE_REGISTERED);
}
- user = do_nick("", av[2], av[5], av[3], s->GetName(), av[ac - 1], ts, av[6], av[4], av[0]);
+ Anope::string modes = av[8];
+ for (int i = 9; i < ac - 1; ++i)
+ modes += Anope::string(" ") + av[i];
+ user = do_nick("", av[2], av[5], av[3], s->GetName(), av[ac - 1], ts, av[6], av[4], av[0], modes);
if (user)
{
- UserSetInternalModes(user, 1, &av[8]);
if (!user->server->IsSynced())
prev_u_intro = user;
else
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp
index 807abf202..cb937cf02 100644
--- a/modules/protocol/ratbox.cpp
+++ b/modules/protocol/ratbox.cpp
@@ -33,7 +33,6 @@ IRCDVar myIrcd[] = {
0, /* time stamp on mode */
0, /* UMODE */
0, /* O:LINE */
- 0, /* VHOST ON NICK */
0, /* No Knock requires +i */
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
@@ -405,11 +404,9 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
{
Server *s = Server::Find(source);
/* Source is always the server */
- user = do_nick("", av[0], av[4], av[5], s->GetName(), av[8], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, av[6], "*", av[7]);
+ user = do_nick("", av[0], av[4], av[5], s->GetName(), av[8], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, av[6], "*", av[7], av[3]);
if (user)
{
- UserSetInternalModes(user, 1, &av[3]);
-
NickAlias *na = findnick(user->nick);
Anope::string svidbuf;
if (na && na->nc->GetExtRegular("authenticationtoken", svidbuf) && svidbuf == av[2])
@@ -421,7 +418,7 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
}
}
else if (ac == 2)
- do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, "", "", "");
+ do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, "", "", "", "");
return MOD_CONT;
}
diff --git a/modules/protocol/unreal32.cpp b/modules/protocol/unreal32.cpp
index 81bd74aaa..d44eeca4b 100644
--- a/modules/protocol/unreal32.cpp
+++ b/modules/protocol/unreal32.cpp
@@ -33,7 +33,6 @@ IRCDVar myIrcd[] = {
1, /* time stamp on mode */
1, /* O:LINE */
1, /* UMODE */
- 1, /* VHOST ON NICK */
1, /* No Knock requires +i */
1, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
@@ -679,10 +678,10 @@ int anope_event_umode2(const Anope::string &source, int ac, const char **av)
if (ac < 1)
return MOD_CONT;
- const char *newav[4];
+ const char *newav[2];
newav[0] = source.c_str();
newav[1] = av[0];
- do_umode(source, ac, newav);
+ do_umode(source, 2, newav);
return MOD_CONT;
}
@@ -841,11 +840,6 @@ int anope_event_sethost(const Anope::string &source, int ac, const 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 ip, char *vhost, char *uid)
-*/
int anope_event_nick(const Anope::string &source, int ac, const char **av)
{
User *user;
@@ -860,7 +854,7 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
<codemastr> it's sent when a nick collision occurs
- so we have to leave it around for now -TSL
*/
- do_nick(source, av[0], av[3], av[4], av[5], av[6], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, "", "*", "");
+ do_nick(source, av[0], av[3], av[4], av[5], av[6], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, "", "*", "", "");
}
else if (ac == 11)
{
@@ -869,12 +863,13 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
sockaddrs ip;
ip.ntop(strlen(av[9]) == 8 ? AF_INET : AF_INET6, decoded_ip.c_str());
+
+ if (av[8] && !strcmp(av[8], "*"))
+ av[8] = "";
- user = do_nick(source, av[0], av[3], av[4], av[5], av[10], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, ip.addr(), av[8], "");
+ user = do_nick(source, av[0], av[3], av[4], av[5], av[10], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, ip.addr(), av[8], "", av[7]);
if (user)
{
- UserSetInternalModes(user, 1, &av[7]);
-
NickAlias *na = findnick(user->nick);
if (na && user->timestamp == convertTo<time_t>(av[6]))
@@ -888,12 +883,13 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
}
else
{
+ if (av[8] && !strcmp(av[8], "*"))
+ av[8] = "";
+
/* NON NICKIP */
- user = do_nick(source, av[0], av[3], av[4], av[5], av[9], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, "", av[8], "");
+ user = do_nick(source, av[0], av[3], av[4], av[5], av[9], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, "", av[8], "", av[7]);
if (user)
{
- UserSetInternalModes(user, 1, &av[7]);
-
NickAlias *na = findnick(user->nick);
if (na && user->timestamp == convertTo<time_t>(av[6]))
@@ -907,7 +903,7 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
}
}
else
- do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, "", "", "");
+ do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, "", "", "", "");
return MOD_CONT;
}