summaryrefslogtreecommitdiff
path: root/modules/commands/ns_ajoin.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-07-08 20:35:04 -0400
committerAdam <Adam@anope.org>2013-07-08 20:35:04 -0400
commiteabb9c0c11c3fdd51c57410f4b104bf08ca57d46 (patch)
tree0f9855c9ce3470c18b569efff2a5cf5ba02f4fa9 /modules/commands/ns_ajoin.cpp
parentb103d16eb1a9182715b808d913f964abd9f783be (diff)
Fix deleting badwords/modes/logs etc
Diffstat (limited to 'modules/commands/ns_ajoin.cpp')
-rw-r--r--modules/commands/ns_ajoin.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp
index 79d7fdf4a..9fa75eea8 100644
--- a/modules/commands/ns_ajoin.cpp
+++ b/modules/commands/ns_ajoin.cpp
@@ -27,6 +27,17 @@ struct AJoinEntry : Serializable
AJoinEntry(Extensible *) : Serializable("AJoinEntry") { }
+ ~AJoinEntry()
+ {
+ AJoinList *channels = owner->GetExt<AJoinList>("ajoinlist");
+ if (channels)
+ {
+ std::vector<AJoinEntry *>::iterator it = std::find((*channels)->begin(), (*channels)->end(), this);
+ if (it != (*channels)->end())
+ (*channels)->erase(it);
+ }
+ }
+
void Serialize(Serialize::Data &sd) const anope_override
{
if (!this->owner)
@@ -147,7 +158,6 @@ class CommandNSAJoin : public Command
else
{
delete (*channels)->at(i);
- (*channels)->erase((*channels)->begin() + i);
source.Reply(_("%s was removed from %s's auto join list."), chan.c_str(), nc->display.c_str());
}
@@ -214,13 +224,14 @@ class CommandNSAJoin : public Command
class NSAJoin : public Module
{
- Serialize::Type ajoinentry_type;
CommandNSAJoin commandnsajoin;
+ Serialize::Type ajoinentry_type;
ExtensibleItem<AJoinList> ajoinlist;
public:
NSAJoin(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
- ajoinentry_type("AJoinEntry", AJoinEntry::Unserialize), commandnsajoin(this), ajoinlist(this, "ajoinlist")
+ commandnsajoin(this),
+ ajoinentry_type("AJoinEntry", AJoinEntry::Unserialize), ajoinlist(this, "ajoinlist")
{
if (!IRCD->CanSVSJoin)