diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-21 23:45:08 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-21 23:45:08 +0000 |
commit | 5d03657b63b0b77edc25cd566d9aab134d930bf7 (patch) | |
tree | 64f33e61eaae31bf99db7e32ff8df7764d3fd713 /src/modules | |
parent | bbb5f6ee63b4a226e6679119a1ee8c725d7d2abc (diff) |
Move some local-only fields to LocalUser
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11942 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_check.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_close.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_hostchange.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_httpd_stats.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_ident.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_services_account.cpp | 4 |
6 files changed, 17 insertions, 13 deletions
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 0b222ba89..51fee9fe5 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -101,12 +101,13 @@ class CommandCheck : public Command user->SendText(checkstr + " opertype " + irc::Spacify(targuser->oper.c_str())); } - if (IS_LOCAL(targuser)) + LocalUser* loctarg = IS_LOCAL(targuser); + if (loctarg) { - user->SendText(checkstr + " clientaddr " + irc::sockets::satouser(&targuser->client_sa)); - user->SendText(checkstr + " serveraddr " + irc::sockets::satouser(&targuser->server_sa)); + user->SendText(checkstr + " clientaddr " + irc::sockets::satouser(&loctarg->client_sa)); + user->SendText(checkstr + " serveraddr " + irc::sockets::satouser(&loctarg->server_sa)); - std::string classname = targuser->GetClass()->name; + std::string classname = loctarg->GetClass()->name; if (!classname.empty()) user->SendText(checkstr + " connectclass " + classname); } diff --git a/src/modules/m_close.cpp b/src/modules/m_close.cpp index 5c0c0188b..3a4ee66f0 100644 --- a/src/modules/m_close.cpp +++ b/src/modules/m_close.cpp @@ -40,7 +40,7 @@ class CommandClose : public Command std::vector<LocalUser*>::reverse_iterator u = ServerInstance->Users->local_users.rbegin(); while (u != ServerInstance->Users->local_users.rend()) { - User* user = *u++; + LocalUser* user = *u++; if (user->registered != REG_ALL) { ServerInstance->Users->QuitUser(user, "Closing all unknown connections per request"); diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index 75260d325..7d998e267 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -91,8 +91,9 @@ class ModuleHostChange : public Module return Version("Provides masking of user hostnames in a different way to m_cloaking", VF_VENDOR); } - virtual void OnUserConnect(User* user) + virtual void OnUserConnect(User* iuser) { + LocalUser* user = (LocalUser*)iuser; for (hostchanges_t::iterator i = hostchanges.begin(); i != hostchanges.end(); i++) { if (((InspIRCd::MatchCIDR(user->MakeHost(), i->first)) || (InspIRCd::MatchCIDR(user->MakeHostIP(), i->first)))) diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 5288130ce..3339a9ca8 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -169,8 +169,10 @@ class ModuleHttpStats : public Module if (IS_OPER(u)) data << "<opertype>" << Sanitize(u->oper) << "</opertype>"; data << "<modes>" << u->FormatModes() << "</modes><ident>" << Sanitize(u->ident) << "</ident>"; - if (IS_LOCAL(u)) - data << "<port>" << u->GetServerPort() << "</port><servaddr>" << irc::sockets::satouser(&u->server_sa) << "</servaddr>"; + LocalUser* lu = IS_LOCAL(u); + if (lu) + data << "<port>" << lu->GetServerPort() << "</port><servaddr>" + << irc::sockets::satouser(&lu->server_sa) << "</servaddr>"; data << "<ipaddress>" << u->GetIPString() << "</ipaddress>"; DumpMeta(data, u); diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 95a0529c9..8df849902 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -74,13 +74,13 @@ class IdentRequestSocket : public EventHandler { private: - User *user; /* User we are attached to */ + LocalUser *user; /* User we are attached to */ bool done; /* True if lookup is finished */ std::string result; /* Holds the ident string if done */ public: time_t age; - IdentRequestSocket(User* u) : user(u), result(u->ident) + IdentRequestSocket(LocalUser* u) : user(u), result(u->ident) { age = ServerInstance->Time(); socklen_t size = 0; @@ -319,7 +319,7 @@ class ModuleIdent : public Module try { - IdentRequestSocket *isock = new IdentRequestSocket(user); + IdentRequestSocket *isock = new IdentRequestSocket(IS_LOCAL(user)); ext.set(user, isock); } catch (ModuleException &e) diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 58bacb7c8..568fcafb6 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -27,7 +27,7 @@ class Channel_r : public ModeHandler ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) { // only a u-lined server may add or remove the +r mode. - if (IS_REMOTE(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server)) + if (!IS_LOCAL(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server)) { // Only change the mode if it's not redundant if ((adding && !channel->IsModeSet('r')) || (!adding && channel->IsModeSet('r'))) @@ -56,7 +56,7 @@ class User_r : public ModeHandler ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) { - if (IS_REMOTE(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server)) + if (!IS_LOCAL(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server)) { if ((adding && !dest->IsModeSet('r')) || (!adding && dest->IsModeSet('r'))) { |