]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_callerid.cpp
Remove m_testcommand too
[user/henk/code/inspircd.git] / src / modules / m_callerid.cpp
index 03849fc2b5956b72793a5e1e66c56f19dcb51232..a80246d64d0bd0a9ebb28fd51ff3d2bc3a7a2f09 100644 (file)
@@ -286,7 +286,7 @@ public:
                if (!dat2)
                {
                        // How the fuck is this possible.
-                       return NULL;
+                       return false;
                }
 
                for (std::list<callerid_data *>::iterator it = dat2->wholistsme.begin(); it != dat2->wholistsme.end(); it++)
@@ -344,7 +344,7 @@ private:
 public:
        ModuleCallerID(InspIRCd* Me) : Module(Me)
        {
-               OnRehash(NULL, "");
+               OnRehash(NULL);
                mycommand = new CommandAccept(ServerInstance, maxaccepts);
                myumode = new User_g(ServerInstance);
 
@@ -400,14 +400,18 @@ public:
                {
                        time_t now = ServerInstance->Time();
                        /* +g and *not* accepted */
-                       if (IS_LOCAL(user))
-                               user->WriteNumeric(716, "%s %s :is in +g mode (server-side ignore).", user->nick.c_str(), dest->nick.c_str());
-                       else
-                               ServerInstance->PI->PushToClient(user, std::string("::") + ServerInstance->Config->ServerName + " 716 " + user->nick + dest->nick + " :is in +g mode (server-side ignore).");
+                       user->WriteNumeric(716, "%s %s :is in +g mode (server-side ignore).", user->nick.c_str(), dest->nick.c_str());
                        if (now > (dat->lastnotify + (time_t)notify_cooldown))
                        {
                                user->WriteNumeric(717, "%s %s :has been informed that you messaged them.", user->nick.c_str(), dest->nick.c_str());
-                               dest->WriteNumeric(718, "%s %s %s@%s :is messaging you, and you have umode +g. Use /ACCEPT +%s to allow.", dest->nick.c_str(), user->nick.c_str(), user->ident.c_str(), user->dhost.c_str(), user->nick.c_str());
+                               if (IS_LOCAL(dest))
+                               {
+                                       dest->WriteNumeric(718, "%s %s %s@%s :is messaging you, and you have umode +g. Use /ACCEPT +%s to allow.", dest->nick.c_str(), user->nick.c_str(), user->ident.c_str(), user->dhost.c_str(), user->nick.c_str());
+                               }
+                               else
+                               {
+                                       ServerInstance->PI->PushToClient(dest, std::string("::") + ServerInstance->Config->ServerName + " 718 " + dest->nick + " " + user->nick + " " + user->ident + "@" + user->dhost + " :is messaging you,  and you have umode +g. Use /ACCEPT +" + user->nick + " to allow.");
+                               }
                                dat->lastnotify = now;
                        }
                        return 1;
@@ -477,7 +481,7 @@ public:
                RemoveData(user);
        }
 
-       virtual void OnRehash(User* user, const std::string& parameter)
+       virtual void OnRehash(User* user)
        {
                ConfigReader Conf(ServerInstance);
                maxaccepts = Conf.ReadInteger("callerid", "maxaccepts", "16", 0, true);