diff options
| author | 2010-08-03 09:18:44 -0400 | |
|---|---|---|
| committer | 2010-08-03 17:32:43 -0400 | |
| commit | 1ec06badac315cfc527f4b9be6efaad6d6ce7d2c (patch) | |
| tree | abe609f0cbb379f926667bd4efda15e55327dcd2 /src/configreader.cpp | |
| parent | Fix incorrect default on <alias:channelcommand> (diff) | |
Fix rehash message sending for remote rehashes
Diffstat (limited to 'src/configreader.cpp')
| -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 4f3e76352..e4ddb4719 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -620,19 +620,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(); @@ -656,7 +653,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."); } |
