summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/cmd_notice.cpp8
-rw-r--r--src/commands/cmd_privmsg.cpp8
-rw-r--r--src/commands/cmd_stats.cpp3
-rw-r--r--src/commands/cmd_whois.cpp5
4 files changed, 15 insertions, 9 deletions
diff --git a/src/commands/cmd_notice.cpp b/src/commands/cmd_notice.cpp
index d5ef7ba1d..d0845a051 100644
--- a/src/commands/cmd_notice.cpp
+++ b/src/commands/cmd_notice.cpp
@@ -57,7 +57,9 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
CUList exempt_list;
- user->idle_lastmsg = ServerInstance->Time();
+ LocalUser* localuser = IS_LOCAL(user);
+ if (localuser)
+ localuser->idle_lastmsg = ServerInstance->Time();
if (ServerInstance->Parser->LoopCall(user, this, parameters, 0))
return CMD_SUCCESS;
@@ -98,7 +100,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
if (chan)
{
- if (IS_LOCAL(user))
+ if (localuser)
{
if ((chan->IsModeSet('n')) && (!chan->HasUser(user)))
{
@@ -166,7 +168,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
const char* destnick = parameters[0].c_str();
- if (IS_LOCAL(user))
+ if (localuser)
{
const char* targetserver = strchr(destnick, '@');
diff --git a/src/commands/cmd_privmsg.cpp b/src/commands/cmd_privmsg.cpp
index cefdd4800..09314e8a9 100644
--- a/src/commands/cmd_privmsg.cpp
+++ b/src/commands/cmd_privmsg.cpp
@@ -56,7 +56,9 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
Channel *chan;
CUList except_list;
- user->idle_lastmsg = ServerInstance->Time();
+ LocalUser* localuser = IS_LOCAL(user);
+ if (localuser)
+ localuser->idle_lastmsg = ServerInstance->Time();
if (ServerInstance->Parser->LoopCall(user, this, parameters, 0))
return CMD_SUCCESS;
@@ -99,7 +101,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
if (chan)
{
- if (IS_LOCAL(user) && chan->GetPrefixValue(user) < VOICE_VALUE)
+ if (localuser && chan->GetPrefixValue(user) < VOICE_VALUE)
{
if (chan->IsModeSet('n') && !chan->HasUser(user))
{
@@ -169,7 +171,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
const char* destnick = parameters[0].c_str();
- if (IS_LOCAL(user))
+ if (localuser)
{
const char* targetserver = strchr(destnick, '@');
diff --git a/src/commands/cmd_stats.cpp b/src/commands/cmd_stats.cpp
index 898e89a7d..c37b041a9 100644
--- a/src/commands/cmd_stats.cpp
+++ b/src/commands/cmd_stats.cpp
@@ -167,8 +167,9 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results)
User* oper = *i;
if (!ServerInstance->ULine(oper->server))
{
+ LocalUser* lu = IS_LOCAL(oper);
results.push_back(sn+" 249 " + user->nick + " :" + oper->nick + " (" + oper->ident + "@" + oper->dhost + ") Idle: " +
- (IS_LOCAL(oper) ? ConvToStr(ServerInstance->Time() - oper->idle_lastmsg) + " secs" : "unavailable"));
+ (lu ? ConvToStr(ServerInstance->Time() - lu->idle_lastmsg) + " secs" : "unavailable"));
idx++;
}
}
diff --git a/src/commands/cmd_whois.cpp b/src/commands/cmd_whois.cpp
index ba2ad9c15..3a07fce7b 100644
--- a/src/commands/cmd_whois.cpp
+++ b/src/commands/cmd_whois.cpp
@@ -74,9 +74,10 @@ CmdResult CommandWhois::Handle (const std::vector<std::string>& parameters, User
* For remote users (/w remoteuser remoteuser), spanningtree will handle calling do_whois, so we can ignore this case.
* Thanks to djGrrr for not being impatient while I have a crap day coding. :p -- w00t
*/
- if (IS_LOCAL(dest) && (ServerInstance->Config->HideWhoisServer.empty() || parameters.size() > 1))
+ LocalUser* localuser = IS_LOCAL(dest);
+ if (localuser && (ServerInstance->Config->HideWhoisServer.empty() || parameters.size() > 1))
{
- idle = abs((long)((dest->idle_lastmsg)-ServerInstance->Time()));
+ idle = abs((long)((localuser->idle_lastmsg)-ServerInstance->Time()));
signon = dest->signon;
}