X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_callerid.cpp;h=f24c38b653acbfa074eee188a393497e84dd25e8;hb=9c5629085ae4914f9db514ca6fbd94e8d58c6f31;hp=7c80aa6577ffa1a97b869ca89c22dbf2fb33dbf9;hpb=c38e2fcdc8404f7a6505f2f9c7c6fc26edf5ad87;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 7c80aa657..f24c38b65 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -22,7 +22,7 @@ #include "inspircd.h" -/* $ModDesc: Implementation of callerid (umode +g & /accept, ala hybrid etc) */ +/* $ModDesc: Implementation of callerid, usermode +g, /accept */ class callerid_data { @@ -54,11 +54,8 @@ class callerid_data } User *u = ServerInstance->FindNick(tok); - if (!u) - { - continue; - } - accepting.insert(u); + if ((u) && (u->registered == REG_ALL) && (!u->quitting) && (!IS_SERVER(u))) + accepting.insert(u); } } @@ -165,18 +162,12 @@ public: tok.erase(0, 1); // Remove the dash. } User* u = ServerInstance->FindNick(tok); - if (u) - { - if (dash) - out.append("-"); - out.append(u->uuid); - } - else - { - if (dash) - out.append("-"); - out.append(tok); - } + if ((!u) || (u->registered != REG_ALL) || (u->quitting) || (IS_SERVER(u))) + continue; + + if (dash) + out.append("-"); + out.append(u->uuid); } parameter = out; } @@ -212,7 +203,7 @@ public: else { User* whotoadd = ServerInstance->FindNick(tok[0] == '+' ? tok.substr(1) : tok); - if (whotoadd) + if ((whotoadd) && (whotoadd->registered == REG_ALL) && (!whotoadd->quitting) && (!IS_SERVER(whotoadd))) return (AddAccept(user, whotoadd) ? CMD_SUCCESS : CMD_FAILURE); else { @@ -346,7 +337,7 @@ public: ServerInstance->Modules->AddService(cmd); ServerInstance->Modules->AddService(cmd.extInfo); - Implementation eventlist[] = { I_OnRehash, I_OnUserPreNick, I_OnUserQuit, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage }; + Implementation eventlist[] = { I_OnRehash, I_OnUserPostNick, I_OnUserQuit, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage }; ServerInstance->Modules->Attach(eventlist, this, 6); } @@ -356,7 +347,7 @@ public: virtual Version GetVersion() { - return Version("Implementation of callerid (umode +g & /accept, ala hybrid etc)", VF_COMMON | VF_VENDOR); + return Version("Implementation of callerid, usermode +g, /accept", VF_COMMON | VF_VENDOR); } virtual void On005Numeric(std::string& output) @@ -408,11 +399,10 @@ public: return MOD_RES_PASSTHRU; } - ModResult OnUserPreNick(User* user, const std::string& newnick) + void OnUserPostNick(User* user, const std::string& oldnick) { if (!tracknick) RemoveFromAllAccepts(user); - return MOD_RES_PASSTHRU; } void OnUserQuit(User* user, const std::string& message, const std::string& oper_message)