LocalUser* l = IS_LOCAL(this);
std::string vhost = oper->getConfig("vhost");
if (!vhost.empty())
- l->ChangeDisplayedHost(vhost.c_str());
+ l->ChangeDisplayedHost(vhost);
std::string opClass = oper->getConfig("class");
if (!opClass.empty())
l->SetClass(opClass);
if (MOD_RESULT == MOD_RES_DENY)
return;
- this->Write(BuildNumeric(ServerInstance->Config->ServerName, this, numeric.GetNumeric(), numeric.GetParams()));
+ const std::string& servername = (numeric.GetServer() ? numeric.GetServer()->GetName() : ServerInstance->Config->ServerName);
+ this->Write(BuildNumeric(servername, this, numeric.GetNumeric(), numeric.GetParams()));
}
void User::WriteFrom(User *user, const std::string &text)
this->WriteFrom(user, textbuffer);
}
+void User::WriteRemoteNotice(const std::string& text)
+{
+ ServerInstance->PI->SendUserNotice(this, text);
+}
+
+void LocalUser::WriteRemoteNotice(const std::string& text)
+{
+ WriteNotice(text);
+}
+
namespace
{
class WriteCommonRawHandler : public User::ForEachNeighborHandler
SendText(line);
}
-void User::SendText(const std::string& linePrefix, std::stringstream& textStream)
+void User::WriteRemoteNumeric(const Numeric::Numeric& numeric)
{
- std::string line;
- std::string word;
- while (textStream >> word)
- {
- size_t lineLength = linePrefix.length() + line.length() + word.length() + 3; // "\s\n\r"
- if (lineLength > ServerInstance->Config->Limits.MaxLine)
- {
- SendText(linePrefix + line);
- line.clear();
- }
- line += " " + word;
- }
- SendText(linePrefix + line);
+ WriteNumeric(numeric);
}
/* return 0 or 1 depending if users u and u2 share one or more common channels