From 1730bfb2bc2a664f6b555152c1251384669ee661 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 30 Oct 2012 21:22:10 -0400 Subject: Send uids everywhere when setting modes on clients --- modules/commands/cs_clone.cpp | 4 ++-- modules/commands/cs_mode.cpp | 8 ++++---- modules/commands/cs_modes.cpp | 4 ++-- modules/commands/cs_register.cpp | 4 ++-- modules/commands/os_mode.cpp | 7 +++++-- modules/protocol/bahamut.cpp | 2 +- modules/protocol/inspircd-ts6.h | 2 +- modules/protocol/inspircd11.cpp | 2 +- modules/protocol/ngircd.cpp | 2 +- modules/protocol/plexus.cpp | 2 +- modules/protocol/unreal.cpp | 2 +- 11 files changed, 21 insertions(+), 18 deletions(-) (limited to 'modules') diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp index bbc06c7be..aef48ea4c 100644 --- a/modules/commands/cs_clone.cpp +++ b/modules/commands/cs_clone.cpp @@ -75,9 +75,9 @@ public: { /* On most ircds you do not receive the admin/owner mode till its registered */ if ((cm = ModeManager::FindChannelModeByName(CMODE_OWNER))) - target_ci->c->SetMode(NULL, cm, u->nick); + target_ci->c->SetMode(NULL, cm, u->GetUID()); else if ((cm = ModeManager::FindChannelModeByName(CMODE_PROTECT))) - target_ci->c->RemoveMode(NULL, cm, u->nick); + target_ci->c->RemoveMode(NULL, cm, u->GetUID()); } /* Mark the channel as persistent */ diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 6b8df2cc9..840912aaf 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -280,9 +280,9 @@ class CommandCSMode : public Command if (Anope::Match(uc->user->GetMask(), param)) { if (adding) - ci->c->SetMode(NULL, cm, uc->user->nick); + ci->c->SetMode(NULL, cm, uc->user->GetUID()); else - ci->c->RemoveMode(NULL, cm, uc->user->nick); + ci->c->RemoveMode(NULL, cm, uc->user->GetUID()); } } } @@ -303,9 +303,9 @@ class CommandCSMode : public Command } if (adding) - ci->c->SetMode(NULL, cm, param); + ci->c->SetMode(NULL, cm, target->GetUID()); else - ci->c->RemoveMode(NULL, cm, param); + ci->c->RemoveMode(NULL, cm, target->GetUID()); } break; } diff --git a/modules/commands/cs_modes.cpp b/modules/commands/cs_modes.cpp index b398e1e8e..2775e92bc 100644 --- a/modules/commands/cs_modes.cpp +++ b/modules/commands/cs_modes.cpp @@ -55,9 +55,9 @@ class CommandModeBase : public Command else { if (set) - c->SetMode(NULL, cm, u2->nick); + c->SetMode(NULL, cm, u2->GetUID()); else - c->RemoveMode(NULL, cm, u2->nick); + c->RemoveMode(NULL, cm, u2->GetUID()); Log(LOG_COMMAND, source, com, ci) << "for " << u2->nick; } diff --git a/modules/commands/cs_register.cpp b/modules/commands/cs_register.cpp index 7528a96c0..28fb931f5 100644 --- a/modules/commands/cs_register.cpp +++ b/modules/commands/cs_register.cpp @@ -85,9 +85,9 @@ class CommandCSRegister : public Command { /* On most ircds you do not receive the admin/owner mode till its registered */ if ((cm = ModeManager::FindChannelModeByName(CMODE_OWNER))) - c->SetMode(NULL, cm, u->nick); + c->SetMode(NULL, cm, u->GetUID()); else if ((cm = ModeManager::FindChannelModeByName(CMODE_PROTECT))) - c->RemoveMode(NULL, cm, u->nick); + c->RemoveMode(NULL, cm, u->GetUID()); } /* Mark the channel as persistent */ diff --git a/modules/commands/os_mode.cpp b/modules/commands/os_mode.cpp index 67ef1c8d4..a0195d497 100644 --- a/modules/commands/os_mode.cpp +++ b/modules/commands/os_mode.cpp @@ -61,23 +61,26 @@ class CommandOSMode : public Command if (!cm) continue; - Anope::string param; + Anope::string param, param_log; if (cm->Type != MODE_REGULAR) { if (!sep.GetToken(param)) continue; + param_log = param; + if (cm->Type == MODE_STATUS) { User *targ = finduser(param); if (targ == NULL || c->FindUser(targ) == NULL) continue; + param = targ->GetUID(); } } log_modes += cm->ModeChar; if (!param.empty()) - log_params += " " + param; + log_params += " " + param_log; if (add) c->SetMode(source.service, cm, param, false); diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index 5a5e650cc..c5be3c3fa 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -187,7 +187,7 @@ class BahamutIRCdProto : public IRCDProto BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) if (cs.HasFlag(ModeManager::ChannelModes[i]->Name)) - c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false); + c->SetMode(setter, ModeManager::ChannelModes[i], user->GetUID(), false); } } diff --git a/modules/protocol/inspircd-ts6.h b/modules/protocol/inspircd-ts6.h index e03f5fa1f..a10deea4f 100644 --- a/modules/protocol/inspircd-ts6.h +++ b/modules/protocol/inspircd-ts6.h @@ -232,7 +232,7 @@ class InspIRCdTS6Proto : public IRCDProto BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) if (cs.HasFlag(ModeManager::ChannelModes[i]->Name)) - c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false); + c->SetMode(setter, ModeManager::ChannelModes[i], user->GetUID(), false); } } diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp index ee625ac36..d1ee82bbb 100644 --- a/modules/protocol/inspircd11.cpp +++ b/modules/protocol/inspircd11.cpp @@ -219,7 +219,7 @@ class InspIRCdProto : public IRCDProto BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) if (cs.HasFlag(ModeManager::ChannelModes[i]->Name)) - c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false); + c->SetMode(setter, ModeManager::ChannelModes[i], user->GetUID(), false); } } diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index 2d69c5f30..d05f4741a 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -92,7 +92,7 @@ class ngIRCdProto : public IRCDProto BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) if (cs.HasFlag(ModeManager::ChannelModes[i]->Name)) - c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false); + c->SetMode(setter, ModeManager::ChannelModes[i], user->GetUID(), false); } } diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index 2444d3569..803eed99c 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -94,7 +94,7 @@ class PlexusProto : public IRCDProto BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) if (cs.HasFlag(ModeManager::ChannelModes[i]->Name)) - c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false); + c->SetMode(setter, ModeManager::ChannelModes[i], user->GetUID(), false); } } diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index b54df1863..1e89f4795 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -170,7 +170,7 @@ class UnrealIRCdProto : public IRCDProto BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) if (cs.HasFlag(ModeManager::ChannelModes[i]->Name)) - c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false); + c->SetMode(setter, ModeManager::ChannelModes[i], user->GetUID(), false); } } -- cgit