X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_watch.cpp;h=9cb31a6d88e3460bbc7fc042ce851d3bc2fe3cfd;hb=4bb972550e79292c5571714103780d873f5e82aa;hp=6c7000a77b5df50a9547b0cfada915560673b3c0;hpb=e244cb2c63b1ac1d85bdbb4691f7b1bd940ae804;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 6c7000a77..9cb31a6d8 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -119,7 +119,7 @@ class CommandSVSWatch : public Command if (IS_LOCAL(u)) { - ServerInstance->Parser->CallHandler("WATCH", parameters, u); + ServerInstance->Parser.CallHandler("WATCH", parameters, u); } return CMD_SUCCESS; @@ -156,9 +156,6 @@ class CommandWatch : public Command /* Yup, is on my list */ watchlist::iterator n = wl->find(nick); - if (!wl) - return CMD_FAILURE; - if (n != wl->end()) { if (!n->second.empty()) @@ -207,7 +204,7 @@ class CommandWatch : public Command ext.set(user, wl); } - if (wl->size() == MAX_WATCH) + if (wl->size() >= MAX_WATCH) { user->WriteNumeric(512, "%s :Too many WATCH entries", nick); return CMD_FAILURE; @@ -231,7 +228,7 @@ class CommandWatch : public Command } User* target = ServerInstance->FindNick(nick); - if (target) + if ((target) && (target->registered == REG_ALL)) { (*wl)[nick] = std::string(target->ident).append(" ").append(target->dhost).append(" ").append(ConvToStr(target->age)); user->WriteNumeric(604, "%s %s :is online", nick, (*wl)[nick].c_str()); @@ -308,10 +305,10 @@ class CommandWatch : public Command { for (watchlist::iterator q = wl->begin(); q != wl->end(); q++) { - if (!q->second.empty()) + User* targ = ServerInstance->FindNick(q->first.c_str()); + if (targ && !q->second.empty()) { user->WriteNumeric(604, "%s %s :is online", q->first.c_str(), q->second.c_str()); - User *targ = ServerInstance->FindNick(q->first.c_str()); if (targ->IsAway()) { user->WriteNumeric(609, "%s %s %s %lu :is away", targ->nick.c_str(), targ->ident.c_str(), targ->dhost.c_str(), (unsigned long) targ->awaytime);