summaryrefslogtreecommitdiff
path: root/modules/commands/ns_suspend.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-02-07 13:12:57 -0500
committerAdam <Adam@anope.org>2014-02-07 13:12:57 -0500
commitad962ad75978dd31c6af180a157722942f87aa11 (patch)
treeeac1f111ed3411f8619220fcf44963077498267e /modules/commands/ns_suspend.cpp
parent5327becf41beda4487f077a3f0157f7013ec6f13 (diff)
Allow other modules to suspend nicknames and channels without having to subclass suspendinfo
Diffstat (limited to 'modules/commands/ns_suspend.cpp')
-rw-r--r--modules/commands/ns_suspend.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/commands/ns_suspend.cpp b/modules/commands/ns_suspend.cpp
index ed65788fe..515e36a9e 100644
--- a/modules/commands/ns_suspend.cpp
+++ b/modules/commands/ns_suspend.cpp
@@ -10,17 +10,17 @@
*/
#include "module.h"
-#include "modules/ns_suspend.h"
+#include "modules/suspend.h"
static ServiceReference<NickServService> nickserv("NickServService", "NickServ");
-struct NSSuspendInfoImpl : NSSuspendInfo, Serializable
+struct NSSuspendInfo : SuspendInfo, Serializable
{
- NSSuspendInfoImpl(Extensible *) : Serializable("NSSuspendInfo") { }
+ NSSuspendInfo(Extensible *) : Serializable("NSSuspendInfo") { }
void Serialize(Serialize::Data &data) const anope_override
{
- data["nick"] << nick;
+ data["nick"] << what;
data["by"] << by;
data["reason"] << reason;
data["time"] << when;
@@ -32,16 +32,16 @@ struct NSSuspendInfoImpl : NSSuspendInfo, Serializable
Anope::string snick;
data["nick"] >> snick;
- NSSuspendInfoImpl *si;
+ NSSuspendInfo *si;
if (obj)
- si = anope_dynamic_static_cast<NSSuspendInfoImpl *>(obj);
+ si = anope_dynamic_static_cast<NSSuspendInfo *>(obj);
else
{
NickAlias *na = NickAlias::Find(snick);
if (!na)
return NULL;
- si = na->nc->Extend<NSSuspendInfoImpl>("NS_SUSPENDED");
- data["nick"] >> si->nick;
+ si = na->nc->Extend<NSSuspendInfo>("NS_SUSPENDED");
+ data["nick"] >> si->what;
}
data["by"] >> si->by;
@@ -110,7 +110,7 @@ class CommandNSSuspend : public Command
NickCore *nc = na->nc;
NSSuspendInfo *si = nc->Extend<NSSuspendInfo>("NS_SUSPENDED");
- si->nick = nc->display;
+ si->what = nc->display;
si->by = source.GetNick();
si->reason = reason;
si->when = Anope::CurTime;
@@ -202,13 +202,13 @@ class NSSuspend : public Module
{
CommandNSSuspend commandnssuspend;
CommandNSUnSuspend commandnsunsuspend;
- ExtensibleItem<NSSuspendInfoImpl> suspend;
+ ExtensibleItem<NSSuspendInfo> suspend;
Serialize::Type suspend_type;
public:
NSSuspend(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
commandnssuspend(this), commandnsunsuspend(this), suspend(this, "NS_SUSPENDED"),
- suspend_type("NSSuspendInfo", NSSuspendInfoImpl::Unserialize)
+ suspend_type("NSSuspendInfo", NSSuspendInfo::Unserialize)
{
}