break;
}
}
+ if (send_to_user)
+ t->WriteServ("NOTICE %s :%s",t->nick,textbuffer);
}
- if (send_to_user)
- t->WriteServ("NOTICE %s :%s",t->nick,textbuffer);
}
else
if (flags == WM_OR)
break;
}
}
+ if (send_to_user)
+ t->WriteServ("NOTICE %s :%s",t->nick,textbuffer);
}
- if (send_to_user)
- t->WriteServ("NOTICE %s :%s",t->nick,textbuffer);
}
}
{
Config->logpath = ServerConfig::GetFullProgDir(argv,argc) + "/ircd.log";
}
+
+ Config->log_file = fopen(Config->logpath.c_str(),"a+");
}
else
{
Config->log_file = fopen(this->LogFileName,"a+");
-
- if (!Config->log_file)
- {
- printf("ERROR: Could not write to logfile %s, bailing!\n\n",Config->logpath.c_str());
- Exit(ERROR);
- }
-
- this->Logger = new FileLogger(this, Config->log_file);
- return;
}
- Config->log_file = fopen(Config->logpath.c_str(),"a+");
-
if (!Config->log_file)
{
- printf("ERROR: Could not write to logfile %s, bailing!\n\n",Config->logpath.c_str());
+ printf("ERROR: Could not write to logfile %s: %s\n\n", Config->logpath.c_str(), strerror(errno));
Exit(ERROR);
}
this->Log(DEFAULT,"Total loaded modules: %d", this->ModCount+1);
}
+void InspIRCd::SendWhoisLine(userrec* user, userrec* dest, int numeric, const std::string &text)
+{
+ std::string copy_text = text;
+
+ int MOD_RESULT = 0;
+ FOREACH_RESULT_I(this, I_OnWhoisLine, OnWhoisLine(user, dest, numeric, copy_text));
+
+ if (!MOD_RESULT)
+ user->WriteServ("%d %s", numeric, copy_text.c_str());
+}
+
+void InspIRCd::SendWhoisLine(userrec* user, userrec* dest, int numeric, const char* format, ...)
+{
+ char textbuffer[MAXBUF];
+ va_list argsPtr;
+ va_start (argsPtr, format);
+ vsnprintf(textbuffer, MAXBUF, format, argsPtr);
+ va_end(argsPtr);
+
+ this->SendWhoisLine(user, dest, numeric, std::string(textbuffer));
+}
+