summaryrefslogtreecommitdiff
path: root/modules/protocol/inspircd20.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/protocol/inspircd20.cpp')
-rw-r--r--modules/protocol/inspircd20.cpp39
1 files changed, 24 insertions, 15 deletions
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index 5d0f9436e..4ebd9711c 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -713,7 +713,6 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
int anope_event_uid(const Anope::string &source, int ac, const char **av)
{
User *user;
- NickAlias *na;
Server *s = Server::Find(source);
time_t ts = Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0;
@@ -721,15 +720,20 @@ int anope_event_uid(const Anope::string &source, int ac, const char **av)
* If not, validate the user. ~ Viper*/
user = prev_u_intro;
prev_u_intro = NULL;
- if (user)
- na = findnick(user->nick);
- if (user && !user->server->IsSynced() && (!na || na->nc != user->Account()))
+ if (user && !user->server->IsSynced())
{
- validate_user(user);
- if (user->HasMode(UMODE_REGISTERED))
- user->RemoveMode(NickServ, UMODE_REGISTERED);
+ NickAlias *na = findnick(user->nick);
+
+ if (!na || na->nc != user->Account())
+ {
+ validate_user(user);
+ if (user->HasMode(UMODE_REGISTERED))
+ user->RemoveMode(NickServ, UMODE_REGISTERED);
+ }
+ else
+ /* Set them +r (to negate a possible -r on the stack) */
+ user->SetMode(NickServ, UMODE_REGISTERED);
}
- user = NULL;
user = do_nick("", av[2], av[5], av[3], s->GetName(), av[ac - 1], ts, av[6], av[4], av[0]);
if (user)
@@ -1123,7 +1127,6 @@ int anope_event_capab(const Anope::string &source, int ac, const char **av)
int anope_event_endburst(const Anope::string &source, int ac, const char **av)
{
- NickAlias *na;
User *u = prev_u_intro;
Server *s = Server::Find(source);
@@ -1133,13 +1136,19 @@ int anope_event_endburst(const Anope::string &source, int ac, const char **av)
/* Check if the previously introduced user was Id'd for the nickgroup of the nick he s currently using.
* If not, validate the user. ~ Viper*/
prev_u_intro = NULL;
- if (u)
- na = findnick(u->nick);
- if (u && !u->server->IsSynced() && (!na || na->nc != u->Account()))
+ if (u && !u->server->IsSynced())
{
- validate_user(u);
- if (u->HasMode(UMODE_REGISTERED))
- u->RemoveMode(NickServ, UMODE_REGISTERED);
+ NickAlias *na = findnick(u->nick);
+
+ if (!na || na->nc != u->Account())
+ {
+ validate_user(u);
+ if (u->HasMode(UMODE_REGISTERED))
+ u->RemoveMode(NickServ, UMODE_REGISTERED);
+ }
+ else
+ /* Set them +r (to negate a possible -r on the stack) */
+ u->SetMode(NickServ, UMODE_REGISTERED);
}
Log(LOG_DEBUG) << "Processed ENDBURST for " << s->GetName();