diff options
| author | Adam <Adam@anope.org> | 2013-01-06 16:13:35 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-01-06 16:13:35 -0500 |
| commit | ed719c80e75f36475626233207a530de2659a063 (patch) | |
| tree | 303c53ce36324b286e10a3e76d98a5e22a13fe1c /modules/protocol | |
| parent | 77dc2e474669d8f0bee3cc047a10ddcfc4faf700 (diff) | |
Buggy compilers are buggy
Diffstat (limited to 'modules/protocol')
| -rw-r--r-- | modules/protocol/bahamut.cpp | 8 | ||||
| -rw-r--r-- | modules/protocol/hybrid.cpp | 8 | ||||
| -rw-r--r-- | modules/protocol/inspircd11.cpp | 8 | ||||
| -rw-r--r-- | modules/protocol/plexus.cpp | 8 | ||||
| -rw-r--r-- | modules/protocol/unreal.cpp | 8 |
5 files changed, 25 insertions, 15 deletions
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index 8ca8ded7b..56e45d6f9 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -371,7 +371,9 @@ struct IRCDMessageMode : IRCDMessage */ struct IRCDMessageNick : IRCDMessage { - IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + ServiceReference<NickServService> NSService; + + IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2), NSService("NickServService", "NickServ") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { @@ -388,8 +390,8 @@ struct IRCDMessageNick : IRCDMessage try { NickAlias *na; - if (NickServService && user->signon == convertTo<time_t>(params[7]) && (na = NickAlias::Find(user->nick))) - NickServService->Login(user, na); + if (NSService && user->signon == convertTo<time_t>(params[7]) && (na = NickAlias::Find(user->nick))) + NSService->Login(user, na); } catch (const ConvertException &) { } } diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index bc4fd55f4..a4711c708 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -485,7 +485,9 @@ struct IRCDMessageTMode : IRCDMessage struct IRCDMessageUID : IRCDMessage { - IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 10) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } + ServiceReference<NickServService> NSService; + + IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 10), NSService("NickServService", "NickServ") { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } /* 0 1 2 3 4 5 6 7 8 9 */ /* :0MC UID Steve 1 1350157102 +oi ~steve resolved.host 10.0.0.1 0MCAAAAAB 1350157108 :Mining all the time */ @@ -502,11 +504,11 @@ struct IRCDMessageUID : IRCDMessage params[9], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : 0, params[3], params[7]); - if (NickServService && params[8] != "0") + if (NSService && params[8] != "0") { NickAlias *na = NickAlias::Find(params[8]); if (na != NULL) - NickServService->Login(user, na); + NSService->Login(user, na); } } }; diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp index 5a6d19af7..024e70cb9 100644 --- a/modules/protocol/inspircd11.cpp +++ b/modules/protocol/inspircd11.cpp @@ -752,7 +752,9 @@ struct IRCDMessageMode : IRCDMessage struct IRCDMessageNick : IRCDMessage { - IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + ServiceReference<NickServService> NSService; + + IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 1), NSService("NickServService", "NickServ") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { @@ -761,12 +763,12 @@ struct IRCDMessageNick : IRCDMessage time_t ts = Anope::string(params[0]).is_pos_number_only() ? convertTo<time_t>(params[0]) : Anope::CurTime; User *user = new User(params[1], params[4], params[2], params[3], params[6], source.GetServer(), params[7], ts, params[5]); - if (NickServService) + if (NSService) { NickAlias *na = NickAlias::Find(user->nick); Anope::string *svidbuf = na ? na->nc->GetExt<ExtensibleItemClass<Anope::string> *>("authenticationtoken") : NULL; if (na && svidbuf && *svidbuf == params[0]) - NickServService->Login(user, na); + NSService->Login(user, na); } } else if (params.size() == 1 && source.GetUser()) diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index 5cb248bab..448c30042 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -238,7 +238,9 @@ struct IRCDMessageServer : IRCDMessage struct IRCDMessageUID : IRCDMessage { - IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 11) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } + ServiceReference<NickServService> NSService; + + IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 11), NSService("NickServService", "NickServ") { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } /* params[0] = nick @@ -274,11 +276,11 @@ struct IRCDMessageUID : IRCDMessage User *user = new User(params[0], params[4], params[9], params[5], ip, source.GetServer(), params[10], ts, params[3], params[7]); try { - if (NickServService && params[8].is_pos_number_only() && convertTo<time_t>(params[8]) == user->timestamp) + if (NSService && params[8].is_pos_number_only() && convertTo<time_t>(params[8]) == user->timestamp) { NickAlias *na = NickAlias::Find(user->nick); if (na) - NickServService->Login(user, na); + NSService->Login(user, na); } } catch (const ConvertException &) { } diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index bba15deec..4621b3bc4 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -750,7 +750,9 @@ struct IRCDMessageNetInfo : IRCDMessage struct IRCDMessageNick : IRCDMessage { - IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + ServiceReference<NickServService> NSService; + + IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2), NSService("NickServService", "NickServ") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } /* ** NICK - new @@ -817,8 +819,8 @@ struct IRCDMessageNick : IRCDMessage na = NickAlias::Find(params[6]); } - if (na && NickServService) - NickServService->Login(user, na); + if (na && NSService) + NSService->Login(user, na); } else source.GetUser()->ChangeNick(params[0]); |
