summaryrefslogtreecommitdiff
path: root/modules/chanserv
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2017-12-03 14:40:01 -0500
committerAdam <Adam@anope.org>2017-12-03 14:40:01 -0500
commit76142b1970d6fd68d001e9972833046c79483a49 (patch)
tree166328fe427a73cab304378e4c3e994b3abe4759 /modules/chanserv
parent2fda0fff4655e92e388d7823e5b1c1f0c6bcfe2d (diff)
serialize: set and cache new value before calling OnSet and pass old value to OnSet
Diffstat (limited to 'modules/chanserv')
-rw-r--r--modules/chanserv/main/channeltype.cpp3
-rw-r--r--modules/chanserv/main/channeltype.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/modules/chanserv/main/channeltype.cpp b/modules/chanserv/main/channeltype.cpp
index e3de67357..4cbda871e 100644
--- a/modules/chanserv/main/channeltype.cpp
+++ b/modules/chanserv/main/channeltype.cpp
@@ -53,10 +53,9 @@ ChannelType::ChannelType(Module *me) : Serialize::Type<ChannelImpl>(me)
}
-void ChannelType::Name::OnSet(ChannelImpl *c, const Anope::string &value)
+void ChannelType::Name::OnSet(ChannelImpl *c, Anope::string *old, const Anope::string &value)
{
ChanServ::registered_channel_map& map = ChanServ::service->GetChannels();
- Anope::string *old = this->Get_(c);
if (old != nullptr)
map.erase(*old);
diff --git a/modules/chanserv/main/channeltype.h b/modules/chanserv/main/channeltype.h
index c8515b289..437eba133 100644
--- a/modules/chanserv/main/channeltype.h
+++ b/modules/chanserv/main/channeltype.h
@@ -27,7 +27,7 @@ class ChannelType : public Serialize::Type<ChannelImpl>
{
using Serialize::Field<ChannelImpl, Anope::string>::Field;
- void OnSet(ChannelImpl *c, const Anope::string &value) override;
+ void OnSet(ChannelImpl *c, Anope::string *old, const Anope::string &value) override;
} name;
Serialize::Field<ChannelImpl, Anope::string> desc;
Serialize::Field<ChannelImpl, time_t> time_registered;