diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-04-01 17:05:12 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-04-01 17:05:12 +0200 |
commit | 80e88c163dbd77b06b61d4fd734d51249cc0e172 (patch) | |
tree | 2ee3fa3fea938c56f3c7d4fc31bea02eaa664d7e /src/modules | |
parent | c1b376cd396f56e4d0eb3eafc04ff169e509ffc7 (diff) |
Move member variables from User to LocalUser
- idle_lastmsg
- dns_done
- quitting_sendq
- exempt
- lastping
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_cgiirc.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_check.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_rline.cpp | 5 | ||||
-rw-r--r-- | src/modules/m_setidle.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_shun.cpp | 5 | ||||
-rw-r--r-- | src/modules/m_spanningtree/idle.cpp | 3 |
6 files changed, 17 insertions, 10 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index d4ef602b3..39833f1a0 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -136,6 +136,10 @@ class CGIResolver : public Resolver User* them = ServerInstance->FindUUID(theiruid); if ((them) && (!them->quitting)) { + LocalUser* lu = IS_LOCAL(them); + if (!lu) + return; + if (notify) ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", them->nick.c_str(), them->host.c_str(), result.c_str(), typ.c_str()); @@ -144,7 +148,7 @@ class CGIResolver : public Resolver them->host = result; them->dhost = result; them->InvalidateCache(); - them->CheckLines(true); + lu->CheckLines(true); } } diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 07276445f..2c46401ae 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -96,7 +96,7 @@ class CommandCheck : public Command user->SendText(checkstr + " signon " + timestring(targuser->signon)); user->SendText(checkstr + " nickts " + timestring(targuser->age)); if (loctarg) - user->SendText(checkstr + " lastmsg " + timestring(targuser->idle_lastmsg)); + user->SendText(checkstr + " lastmsg " + timestring(loctarg->idle_lastmsg)); if (IS_AWAY(targuser)) { diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp index a234c02c6..68e3594a5 100644 --- a/src/modules/m_rline.cpp +++ b/src/modules/m_rline.cpp @@ -61,7 +61,8 @@ class RLine : public XLine bool Matches(User *u) { - if (u->exempt) + LocalUser* lu = IS_LOCAL(u); + if (lu && lu->exempt) return false; std::string compare = u->nick + "!" + u->ident + "@" + u->host + " " + u->fullname; @@ -117,7 +118,7 @@ class RLineFactory : public XLineFactory RLineFactory(dynamic_reference<RegexFactory>& rx) : XLineFactory("R"), rxfactory(rx) { } - + /** Generate a RLine */ XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask) diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp index fdb29d14f..7423e2672 100644 --- a/src/modules/m_setidle.cpp +++ b/src/modules/m_setidle.cpp @@ -25,16 +25,16 @@ /** Handle /SETIDLE */ -class CommandSetidle : public Command +class CommandSetidle : public SplitCommand { public: - CommandSetidle(Module* Creator) : Command(Creator,"SETIDLE", 1) + CommandSetidle(Module* Creator) : SplitCommand(Creator,"SETIDLE", 1) { flags_needed = 'o'; syntax = "<duration>"; TRANSLATE2(TR_TEXT, TR_END); } - CmdResult Handle (const std::vector<std::string>& parameters, User *user) + CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) { time_t idle = ServerInstance->Duration(parameters[0]); if (idle < 1) diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 21959e400..c858e62ec 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -43,7 +43,8 @@ public: bool Matches(User *u) { // E: overrides shun - if (u->exempt) + LocalUser* lu = IS_LOCAL(u); + if (lu && lu->exempt) return false; if (InspIRCd::Match(u->GetFullHost(), matchtext) || InspIRCd::Match(u->GetFullRealHost(), matchtext) || InspIRCd::Match(u->nick+"!"+u->ident+"@"+u->GetIPString(), matchtext)) @@ -107,7 +108,7 @@ class CommandShun : public Command /* 'time' is a human-readable timestring, like 2d3h2s. */ std::string target = parameters[0]; - + User *find = ServerInstance->FindNick(target); if ((find) && (find->registered == REG_ALL)) target = std::string("*!*@") + find->GetIPString(); diff --git a/src/modules/m_spanningtree/idle.cpp b/src/modules/m_spanningtree/idle.cpp index 8bc0cd2bb..70453b975 100644 --- a/src/modules/m_spanningtree/idle.cpp +++ b/src/modules/m_spanningtree/idle.cpp @@ -40,7 +40,8 @@ bool TreeSocket::Whois(const std::string &prefix, parameterlist ¶ms) User* x = ServerInstance->FindNick(params[0]); if ((x) && (IS_LOCAL(x))) { - long idle = abs((long)((x->idle_lastmsg) - ServerInstance->Time())); + LocalUser* lu = IS_LOCAL(x); + long idle = abs((long)((lu->idle_lastmsg) - ServerInstance->Time())); parameterlist par; par.push_back(prefix); par.push_back(ConvToStr(x->signon)); |