summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2015-06-29 19:35:57 -0400
committerAdam <Adam@anope.org>2015-06-29 19:35:57 -0400
commit02ed9a9725c40b57df965c4a13579bafebef2af3 (patch)
treed553873991f3b872dc6da855beeb6f3c0c88eb3c
parent074f1637508d76e2c21e9d698f265a0b4291f3b0 (diff)
#1649 don't update keepmodes during inhbait
-rw-r--r--modules/commands/cs_set.cpp10
-rw-r--r--modules/pseudoclients/chanserv.cpp4
2 files changed, 9 insertions, 5 deletions
diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp
index 73bdb5a0c..cfff16377 100644
--- a/modules/commands/cs_set.cpp
+++ b/modules/commands/cs_set.cpp
@@ -1207,6 +1207,8 @@ class CSSet : public Module
CommandCSSetSuccessor commandcssetsuccessor;
CommandCSSetNoexpire commandcssetnoexpire;
+ ExtensibleRef<bool> inhabit;
+
bool persist_lower_ts;
public:
@@ -1221,7 +1223,9 @@ class CSSet : public Module
commandcssetdescription(this), commandcssetfounder(this), commandcssetkeepmodes(this),
commandcssetpeace(this), commandcssetpersist(this), commandcssetrestricted(this),
commandcssetsecure(this), commandcssetsecurefounder(this), commandcssetsecureops(this), commandcssetsignkick(this),
- commandcssetsuccessor(this), commandcssetnoexpire(this)
+ commandcssetsuccessor(this), commandcssetnoexpire(this),
+
+ inhabit("inhabit")
{
}
@@ -1271,7 +1275,7 @@ class CSSet : public Module
if (mode->name == "PERM")
persist.Set(c->ci, true);
- if (mode->type != MODE_STATUS && !c->syncing && Me->IsSynced())
+ if (mode->type != MODE_STATUS && !c->syncing && Me->IsSynced() && (!inhabit || !inhabit->HasExt(c)))
c->ci->last_modes = c->GetModes();
}
@@ -1286,7 +1290,7 @@ class CSSet : public Module
persist.Unset(c->ci);
}
- if (c->ci && mode->type != MODE_STATUS && !c->syncing && Me->IsSynced())
+ if (c->ci && mode->type != MODE_STATUS && !c->syncing && Me->IsSynced() && (!inhabit || !inhabit->HasExt(c)))
c->ci->last_modes = c->GetModes();
return EVENT_CONTINUE;
diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp
index 41a62d7b4..0ceeded25 100644
--- a/modules/pseudoclients/chanserv.cpp
+++ b/modules/pseudoclients/chanserv.cpp
@@ -66,12 +66,12 @@ class ChanServCore : public Module, public ChanServService
if (!c)
return;
- inhabit.Unset(c);
-
/* In the event we don't part */
c->RemoveMode(NULL, "SECRET");
c->RemoveMode(NULL, "INVITE");
+ inhabit.Unset(c); /* now we're done changing modes, unset inhabit */
+
if (!c->ci || !c->ci->bi)
{
if (ChanServ)