Add <options:cyclehostsfromuser> to configure source for mode changes on host cycle and autoop

This commit is contained in:
Daniel De Graaf 2010-03-17 09:32:27 -05:00
parent 1f7c0573f4
commit 11f1aa031d
4 changed files with 10 additions and 3 deletions

View File

@ -464,6 +464,11 @@ class CoreExport ServerConfig
*/
bool CycleHosts;
/** If set to true, the CycleHosts mode change will be sourced from the user,
* rather than the server
*/
bool CycleHostsFromUser;
/** If set to true, prefixed channel NOTICEs and PRIVMSGs will have the prefix
* added to the outgoing text for undernet style msg prefixing.
*/

View File

@ -385,9 +385,8 @@ Channel* Channel::ForceChan(Channel* Ptr, User* user, const std::string &privs,
for(unsigned int i=0; i < memb->modes.length(); i++)
ms.append(" ").append(user->nick);
if ((Ptr->GetUserCounter() > 1) && (ms.length()))
Ptr->WriteAllExceptSender(user, true, 0, "MODE %s +%s", Ptr->name.c_str(), ms.c_str());
Ptr->WriteAllExceptSender(user, ServerInstance->Config->CycleHostsFromUser, 0, "MODE %s +%s", Ptr->name.c_str(), ms.c_str());
/* Major improvement by Brain - we dont need to be calculating all this pointlessly for remote users */
if (IS_LOCAL(user))
{
if (Ptr->topicset)

View File

@ -420,6 +420,7 @@ void ServerConfig::Fill()
NoUserDns = ConfValue("performance")->getBool("nouserdns");
SyntaxHints = options->getBool("syntaxhints");
CycleHosts = options->getBool("cyclehosts");
CycleHostsFromUser = options->getBool("cyclehostsfromuser");
UndernetMsgPrefix = options->getBool("ircumsgprefix");
FullHostInTopic = options->getBool("hostintopic");
MaxTargets = security->getInt("maxtargets", 20);

View File

@ -1411,7 +1411,9 @@ void User::DoHostCycle(const std::string &quitline)
{
for(unsigned int i=0; i < memb->modes.length(); i++)
modeline.append(" ").append(nick);
snprintf(buffer, MAXBUF, ":%s MODE %s +%s", GetFullHost().c_str(), c->name.c_str(), modeline.c_str());
snprintf(buffer, MAXBUF, ":%s MODE %s +%s",
ServerInstance->Config->CycleHostsFromUser ? GetFullHost().c_str() : ServerInstance->Config->ServerName.c_str(),
c->name.c_str(), modeline.c_str());
modeline = buffer;
}