diff options
| author | Adam <Adam@anope.org> | 2013-07-08 20:35:04 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-07-08 20:35:04 -0400 |
| commit | eabb9c0c11c3fdd51c57410f4b104bf08ca57d46 (patch) | |
| tree | 0f9855c9ce3470c18b569efff2a5cf5ba02f4fa9 /modules/commands/ns_ajoin.cpp | |
| parent | b103d16eb1a9182715b808d913f964abd9f783be (diff) | |
Fix deleting badwords/modes/logs etc
Diffstat (limited to 'modules/commands/ns_ajoin.cpp')
| -rw-r--r-- | modules/commands/ns_ajoin.cpp | 17 |
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) |
