diff options
Diffstat (limited to 'src/cmd_whowas.cpp')
-rw-r--r-- | src/cmd_whowas.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cmd_whowas.cpp b/src/cmd_whowas.cpp index fe3171fc5..399214d70 100644 --- a/src/cmd_whowas.cpp +++ b/src/cmd_whowas.cpp @@ -18,8 +18,6 @@ #include "users.h" #include "commands/cmd_whowas.h" - - extern "C" command_t* init_command(InspIRCd* Instance) { return new cmd_whowas(Instance); @@ -29,18 +27,24 @@ CmdResult cmd_whowas::Handle (const char** parameters, int pcnt, userrec* user) { irc::whowas::whowas_users::iterator i = ServerInstance->whowas.find(parameters[0]); + ServerInstance->Log(DEBUG,"Entered cmd_whowas"); + if (i == ServerInstance->whowas.end()) { + ServerInstance->Log(DEBUG,"No such nick in whowas"); user->WriteServ("406 %s %s :There was no such nickname",user->nick,parameters[0]); + user->WriteServ("369 %s %s :End of WHOWAS",user->nick,parameters[0]); return CMD_FAILURE; } else { + ServerInstance->Log(DEBUG,"Whowas set found"); irc::whowas::whowas_set* grp = i->second; if (grp->size()) { for (irc::whowas::whowas_set::iterator ux = grp->begin(); ux != grp->end(); ux++) { + ServerInstance->Log(DEBUG,"Spool whowas entry"); irc::whowas::WhoWasGroup* u = *ux; time_t rawtime = u->signon; tm *timeinfo; @@ -65,12 +69,13 @@ CmdResult cmd_whowas::Handle (const char** parameters, int pcnt, userrec* user) } else { + ServerInstance->Log(DEBUG,"Oops, empty whowas set found"); user->WriteServ("406 %s %s :There was no such nickname",user->nick,parameters[0]); + user->WriteServ("369 %s %s :End of WHOWAS",user->nick,parameters[0]); return CMD_FAILURE; } } - - user->WriteServ("369 %s %s :End of WHOWAS",user->nick,parameters[0]); + user->WriteServ("369 %s %s :End of WHOWAS",user->nick,parameters[0]); return CMD_SUCCESS; } |