diff options
author | Daniel De Graaf <danieldg@inspircd.org> | 2010-08-03 09:18:44 -0400 |
---|---|---|
committer | Daniel De Graaf <danieldg@inspircd.org> | 2010-08-03 09:19:14 -0400 |
commit | 7b65a0101fc167a9be0ec8e8e4e0742f16b9e3ed (patch) | |
tree | 859a098eb133ceebd12f89a01f6dc9952768d6b3 | |
parent | 170ab71ba1cf8c6dd9bc09bc26ad454f1385999e (diff) |
Fix rehash message sending for remote rehashes
-rw-r--r-- | src/configreader.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index c93bbd41f..d6b479874 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -691,19 +691,16 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) { std::string line; getline(errstr, line, '\n'); - if (!line.empty()) - { - if (user) - user->WriteServ("NOTICE %s :*** %s", user->nick.c_str(), line.c_str()); - else - ServerInstance->SNO->WriteGlobalSno('a', line); - } - + if (line.empty()) + continue; + // On startup, print out to console (still attached at this point) if (!old) - { - // Starting up, so print it out so it's seen. XXX this is a bit of a hack. printf("%s\n", line.c_str()); - } + // If a user is rehashing, tell them directly + if (user) + user->SendText(":%s NOTICE %s :*** %s", ServerInstance->Config->ServerName.c_str(), user->nick.c_str(), line.c_str()); + // Also tell opers + ServerInstance->SNO->WriteGlobalSno('a', line); } errstr.clear(); @@ -727,7 +724,8 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) ApplyModules(user); if (user) - user->WriteServ("NOTICE %s :*** Successfully rehashed server.", user->nick.c_str()); + user->SendText(":%s NOTICE %s :*** Successfully rehashed server.", + ServerInstance->Config->ServerName.c_str(), user->nick.c_str()); ServerInstance->SNO->WriteGlobalSno('a', "*** Successfully rehashed server."); } |