summaryrefslogtreecommitdiff
path: root/modules/commands/bs_control.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-11-24 14:27:23 -0500
committerAdam <Adam@anope.org>2014-11-24 14:27:23 -0500
commit42238034490fb5479d787bd1695750387d508200 (patch)
treec93c62e0e1c936e656ae5b9ee1b62380ce2a194c /modules/commands/bs_control.cpp
parentd492923610d9c9146b2a2b63de38deab2cfd4ca7 (diff)
Rewrite serializable to have field level granularity
Represent serializable objects in a digraph, and as a result made most object relationships implicitly defined, and use the graph to trace references between objects to determine relationships. Edges may also be marked as having a dependency of the object they point to, which allows for automatic cleanup and deletion of most objects when no longer needed. Additionally, this allows not having to require in-memory copies of everything when using external databases. db_sql has been rewritten for this and now always requires a database to function. db_sql with MySQL now requires InnoDB to make use of transactions and foreign key constraints.
Diffstat (limited to 'modules/commands/bs_control.cpp')
-rw-r--r--modules/commands/bs_control.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp
index 74e978404..fc97cd163 100644
--- a/modules/commands/bs_control.cpp
+++ b/modules/commands/bs_control.cpp
@@ -34,14 +34,14 @@ class CommandBSSay : public Command
if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasPriv("botserv/administration"))
{
- source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SAY", ci->name);
+ source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SAY", ci->GetName());
return;
}
- if (!ci->bi)
+ if (!ci->GetBot())
{
- source.Reply(_("There is no bot assigned to \002{0}\002. One must be assigned to the channel before this command can be used."), ci->name);
- BotInfo *bi;
+ source.Reply(_("There is no bot assigned to \002{0}\002. One must be assigned to the channel before this command can be used."), ci->GetName());
+ ServiceBot *bi;
Anope::string name;
Command::FindCommandFromService("botserv/assign", bi, name);
CommandInfo *help = source.service->FindCommand("generic/help");
@@ -51,9 +51,9 @@ class CommandBSSay : public Command
return;
}
- if (!ci->c || !ci->c->FindUser(ci->bi))
+ if (!ci->c || !ci->c->FindUser(ci->GetBot()))
{
- source.Reply(_("Bot \002{0}\002 is not on channel \002{1}\002."), ci->bi->nick, ci->name);
+ source.Reply(_("Bot \002{0}\002 is not on channel \002{1}\002."), ci->GetBot()->nick, ci->GetName());
return;
}
@@ -63,8 +63,8 @@ class CommandBSSay : public Command
return;
}
- IRCD->SendPrivmsg(*ci->bi, ci->name, "%s", text.c_str());
- ci->bi->lastmsg = Anope::CurTime;
+ IRCD->SendPrivmsg(ci->GetBot(), ci->GetName(), "%s", text.c_str());
+ ci->GetBot()->lastmsg = Anope::CurTime;
bool override = !source.AccessFor(ci).HasPriv("SAY");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << text;
@@ -106,14 +106,14 @@ class CommandBSAct : public Command
if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasPriv("botserv/administration"))
{
- source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SAY", ci->name);
+ source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SAY", ci->GetName());
return;
}
- if (!ci->bi)
+ if (!ci->GetBot())
{
- source.Reply(_("There is no bot assigned to \002{0}\002. One must be assigned to the channel before this command can be used."), ci->name);
- BotInfo *bi;
+ source.Reply(_("There is no bot assigned to \002{0}\002. One must be assigned to the channel before this command can be used."), ci->GetName());
+ ServiceBot *bi;
Anope::string name;
Command::FindCommandFromService("botserv/assign", bi, name);
CommandInfo *help = source.service->FindCommand("generic/help");
@@ -123,9 +123,9 @@ class CommandBSAct : public Command
return;
}
- if (!ci->c || !ci->c->FindUser(ci->bi))
+ if (!ci->c || !ci->c->FindUser(ci->GetBot()))
{
- source.Reply(_("Bot \002{0}\002 is not on channel \002{1}\002."), ci->bi->nick, ci->name);
+ source.Reply(_("Bot \002{0}\002 is not on channel \002{1}\002."), ci->GetBot()->nick, ci->GetName());
return;
}
@@ -133,8 +133,8 @@ class CommandBSAct : public Command
if (message.empty())
return;
- IRCD->SendAction(*ci->bi, ci->name, "%s", message.c_str());
- ci->bi->lastmsg = Anope::CurTime;
+ IRCD->SendAction(ci->GetBot(), ci->GetName(), "%s", message.c_str());
+ ci->GetBot()->lastmsg = Anope::CurTime;
bool override = !source.AccessFor(ci).HasPriv("SAY");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << message;