X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fhelperfuncs.cpp;h=80feae464c6e52468463de830163772c3d8a58be;hb=58895f9b1daa1e13927462d046a36dec853a40e0;hp=26a5db07c282111c338669c61875a397eda08812;hpb=0036e3a70cabea02e9ec2103ed1dfdf5c799289f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 26a5db07c..80feae464 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -125,20 +125,16 @@ void InspIRCd::SendError(const std::string &s) { for (std::vector::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(); } } @@ -150,11 +146,11 @@ long InspIRCd::ChannelCount() bool InspIRCd::IsValidMask(const std::string &mask) { - char* dest = (char*)mask.c_str(); + const char* dest = mask.c_str(); int exclamation = 0; int atsign = 0; - for (char* i = dest; *i; i++) + for (const char* i = dest; *i; i++) { /* out of range character, bad mask */ if (*i < 32 || *i > 126) @@ -344,8 +340,8 @@ 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(this, OnWhoisLine, MOD_RESULT, (user, dest, numeric, copy_text)); if (!MOD_RESULT) user->WriteServ("%d %s", numeric, copy_text.c_str());