#include "xline.h"
#include "exitcodes.h"
-std::string InspIRCd::GetServerDescription(const char* servername)
+std::string InspIRCd::GetServerDescription(const std::string& servername)
{
std::string description;
- FOREACH_MOD_I(this,I_OnGetServerDescription,OnGetServerDescription(servername,description));
+ FOREACH_MOD(I_OnGetServerDescription,OnGetServerDescription(servername,description));
if (!description.empty())
{
{
this->Logs->SetupNoFork();
}
- Config->MyDir = Config->GetFullProgDir();
-
- /* Attempt to find home directory, portable to windows */
- const char* home = getenv("HOME");
- if (!home)
- {
- /* No $HOME, log to %USERPROFILE% */
- home = getenv("USERPROFILE");
- if (!home)
- {
- /* Nothing could be found at all, log to current dir */
- Config->logpath = "./startup.log";
- }
- }
if (!Config->writelog) return true; // Skip opening default log if -nolog
{
if (Config->logpath.empty())
{
- Config->logpath = "./startup.log";
+ Config->logpath = "logs/startup.log";
}
if (!Config->log_file)
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);
std::string copy_text = text;
ModResult MOD_RESULT;
- FIRST_MOD_RESULT(this, OnWhoisLine, MOD_RESULT, (user, dest, numeric, copy_text));
+ 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());
}
return total + subtotal;
}
-bool InspIRCd::ULine(const char* sserver)
+bool InspIRCd::ULine(const std::string& sserver)
{
- if (!sserver)
- return false;
- if (!*sserver)
+ if (sserver.empty())
return true;
- return (Config->ulines.find(sserver) != Config->ulines.end());
+ return (Config->ulines.find(sserver.c_str()) != Config->ulines.end());
}
-bool InspIRCd::SilentULine(const char* sserver)
+bool InspIRCd::SilentULine(const std::string& sserver)
{
- std::map<irc::string,bool>::iterator n = Config->ulines.find(sserver);
+ std::map<irc::string,bool>::iterator n = Config->ulines.find(sserver.c_str());
if (n != Config->ulines.end())
return n->second;
- else return false;
+ else
+ return false;
}
std::string InspIRCd::TimeString(time_t curtime)