diff options
author | Adam <Adam@anope.org> | 2011-10-26 16:52:00 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-10-26 16:52:00 -0400 |
commit | b14f5ea884e17500d5a08e3ca18957a8fb2a79f6 (patch) | |
tree | 77be632813b2c4d428cf40b907ac0eb542031a5f | |
parent | bf66336e2c7a34aa62f86681f2d20078b2be99a8 (diff) |
Fixed accidentally clearing botmodes when joins are sent
-rw-r--r-- | include/services.h | 2 | ||||
-rw-r--r-- | modules/protocol/bahamut.cpp | 10 | ||||
-rw-r--r-- | modules/protocol/inspircd-ts6.h | 10 | ||||
-rw-r--r-- | modules/protocol/inspircd11.cpp | 10 | ||||
-rw-r--r-- | modules/protocol/plexus.cpp | 10 | ||||
-rw-r--r-- | modules/protocol/ratbox.cpp | 2 | ||||
-rw-r--r-- | modules/protocol/unreal.cpp | 10 |
7 files changed, 42 insertions, 12 deletions
diff --git a/include/services.h b/include/services.h index 6004532d1..1179068b5 100644 --- a/include/services.h +++ b/include/services.h @@ -819,7 +819,7 @@ class CoreExport IRCDProto virtual void SendQuit(const User *u, const char *fmt, ...); virtual void SendPing(const Anope::string &servname, const Anope::string &who); virtual void SendPong(const Anope::string &servname, const Anope::string &who); - virtual void SendJoin(User *, Channel *, ChannelStatus *) = 0; + virtual void SendJoin(User *, Channel *, const ChannelStatus *) = 0; virtual void SendSQLineDel(const XLine *x) { } virtual void SendInvite(const BotInfo *bi, const Anope::string &chan, const Anope::string &nick); virtual void SendPart(const BotInfo *bi, const Channel *chan, const char *fmt, ...); diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index aec200850..10c9a6454 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -162,13 +162,19 @@ class BahamutIRCdProto : public IRCDProto } /* JOIN - SJOIN */ - void SendJoin(User *user, Channel *c, ChannelStatus *status) + void SendJoin(User *user, Channel *c, const ChannelStatus *status) { send_cmd(user->nick, "SJOIN %ld %s", static_cast<long>(c->creation_time), c->name.c_str()); if (status) { + /* First save the channel status incase uc->Status == status */ ChannelStatus cs = *status; - status->ClearFlags(); + /* If the user is internally on the channel with flags, kill them so that + * the stacker will allow this. + */ + UserContainer *uc = c->FindUser(user); + if (uc != NULL) + uc->Status->ClearFlags(); BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) diff --git a/modules/protocol/inspircd-ts6.h b/modules/protocol/inspircd-ts6.h index f8e64e935..6cc5661a7 100644 --- a/modules/protocol/inspircd-ts6.h +++ b/modules/protocol/inspircd-ts6.h @@ -124,7 +124,7 @@ class InspIRCdTS6Proto : public IRCDProto } /* JOIN */ - void SendJoin(User *user, Channel *c, ChannelStatus *status) + void SendJoin(User *user, Channel *c, const ChannelStatus *status) { send_cmd(Config->Numeric, "FJOIN %s %ld +%s :,%s", c->name.c_str(), static_cast<long>(c->creation_time), c->GetModes(true, true).c_str(), user->GetUID().c_str()); /* Note that we can send this with the FJOIN but choose not to @@ -133,8 +133,14 @@ class InspIRCdTS6Proto : public IRCDProto */ if (status) { + /* First save the channel status incase uc->Status == status */ ChannelStatus cs = *status; - status->ClearFlags(); + /* If the user is internally on the channel with flags, kill them so that + * the stacker will allow this. + */ + UserContainer *uc = c->FindUser(user); + if (uc != NULL) + uc->Status->ClearFlags(); BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp index 4c1776097..77b619f64 100644 --- a/modules/protocol/inspircd11.cpp +++ b/modules/protocol/inspircd11.cpp @@ -157,13 +157,19 @@ class InspIRCdProto : public IRCDProto } /* JOIN */ - void SendJoin(User *user, Channel *c, ChannelStatus *status) + void SendJoin(User *user, Channel *c, const ChannelStatus *status) { send_cmd(user->nick, "JOIN %s %ld", c->name.c_str(), static_cast<long>(c->creation_time)); if (status) { + /* First save the channel status incase uc->Status == status */ ChannelStatus cs = *status; - status->ClearFlags(); + /* If the user is internally on the channel with flags, kill them so that + * the stacker will allow this. + */ + UserContainer *uc = c->FindUser(user); + if (uc != NULL) + uc->Status->ClearFlags(); BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index 356adfe2c..9d6902080 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -123,13 +123,19 @@ class PlexusProto : public IRCDProto send_cmd(Config->Numeric, "UNRESV * %s", x->Mask.c_str()); } - void SendJoin(User *user, Channel *c, ChannelStatus *status) + void SendJoin(User *user, Channel *c, const ChannelStatus *status) { send_cmd(Config->Numeric, "SJOIN %ld %s +%s :%s", static_cast<long>(c->creation_time), c->name.c_str(), c->GetModes(true, true).c_str(), user->GetUID().c_str()); if (status) { + /* First save the channel status incase uc->Status == status */ ChannelStatus cs = *status; - status->ClearFlags(); + /* If the user is internally on the channel with flags, kill them so that + * the stacker will allow this. + */ + UserContainer *uc = c->FindUser(user); + if (uc != NULL) + uc->Status->ClearFlags(); BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index fb65b80b4..32acfc3e1 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -126,7 +126,7 @@ class RatboxProto : public IRCDProto send_cmd(Config->Numeric, "UNRESV * %s", x->Mask.c_str()); } - void SendJoin(User *user, Channel *c, ChannelStatus *status) + void SendJoin(User *user, Channel *c, const ChannelStatus *status) { /* Note that we must send our modes with the SJOIN and * can not add them to the mode stacker because ratbox diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index aa806fe21..6b4d844d5 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -165,13 +165,19 @@ class UnrealIRCdProto : public IRCDProto } /* JOIN */ - void SendJoin(User *user, Channel *c, ChannelStatus *status) + void SendJoin(User *user, Channel *c, const ChannelStatus *status) { send_cmd(Config->ServerName, "~ %ld %s :%s", static_cast<long>(c->creation_time), c->name.c_str(), user->nick.c_str()); if (status) { + /* First save the channel status incase uc->Status == status */ ChannelStatus cs = *status; - status->ClearFlags(); + /* If the user is internally on the channel with flags, kill them so that + * the stacker will allow this. + */ + UserContainer *uc = c->FindUser(user); + if (uc != NULL) + uc->Status->ClearFlags(); BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) |