]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
ENCAP removal for supported protocol 1201 commands
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 1d5bf574f7c51380d1247efa66817ddd0c10d1bc..155e29dd465b7ec6e664f580c6a32b8f3ad0b92f 100644 (file)
@@ -21,7 +21,7 @@ std::string InspIRCd::GetServerDescription(const char* servername)
 {
        std::string description;
 
-       FOREACH_MOD_I(this,I_OnGetServerDescription,OnGetServerDescription(servername,description));
+       FOREACH_MOD(I_OnGetServerDescription,OnGetServerDescription(servername,description));
 
        if (!description.empty())
        {
@@ -125,20 +125,16 @@ void InspIRCd::SendError(const std::string &s)
 {
        for (std::vector<User*>::const_iterator i = this->Users->local_users.begin(); i != this->Users->local_users.end(); i++)
        {
-               if ((*i)->registered == REG_ALL)
+               User* u = *i;
+               if (u->registered == REG_ALL)
                {
-                       (*i)->WriteServ("NOTICE %s :%s",(*i)->nick.c_str(),s.c_str());
+                       u->WriteServ("NOTICE %s :%s",u->nick.c_str(),s.c_str());
                }
                else
                {
                        /* Unregistered connections receive ERROR, not a NOTICE */
-                       (*i)->Write("ERROR :" + s);
+                       u->Write("ERROR :" + s);
                }
-               /* This might generate a whole load of EAGAIN, but we dont really
-                * care about this, as if we call SendError something catastrophic
-                * has occured anyway, and we wont receive the events for these.
-                */
-               (*i)->FlushWriteBuf();
        }
 }
 
@@ -322,8 +318,8 @@ bool InspIRCd::OpenLog(char**, int)
                return false;
        }
 
-       FileWriter* fw = new FileWriter(this, Config->log_file);
-       FileLogStream *f = new FileLogStream(this, (Config->forcedebug ? DEBUG : DEFAULT), fw);
+       FileWriter* fw = new FileWriter(Config->log_file);
+       FileLogStream *f = new FileLogStream((Config->forcedebug ? DEBUG : DEFAULT), fw);
 
        this->Logs->AddLogType("*", f, true);
 
@@ -344,10 +340,10 @@ void InspIRCd::SendWhoisLine(User* user, User* dest, int numeric, const std::str
 {
        std::string copy_text = text;
 
-       int MOD_RESULT = 0;
-       FOREACH_RESULT_I(this, I_OnWhoisLine, OnWhoisLine(user, dest, numeric, copy_text));
+       ModResult MOD_RESULT;
+       FIRST_MOD_RESULT(OnWhoisLine, MOD_RESULT, (user, dest, numeric, copy_text));
 
-       if (!MOD_RESULT)
+       if (MOD_RESULT != MOD_RES_DENY)
                user->WriteServ("%d %s", numeric, copy_text.c_str());
 }