summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/protocol/bahamut.cpp10
-rw-r--r--modules/protocol/inspircd-ts6.h10
-rw-r--r--modules/protocol/inspircd11.cpp10
-rw-r--r--modules/protocol/plexus.cpp10
-rw-r--r--modules/protocol/ratbox.cpp2
-rw-r--r--modules/protocol/unreal.cpp10
6 files changed, 41 insertions, 11 deletions
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)