summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/bots.h3
-rw-r--r--modules/commands/bs_botlist.cpp8
-rw-r--r--modules/commands/os_modinfo.cpp9
-rw-r--r--modules/protocol/hybrid.cpp13
4 files changed, 22 insertions, 11 deletions
diff --git a/include/bots.h b/include/bots.h
index 7d490d4f5..6adcb36a1 100644
--- a/include/bots.h
+++ b/include/bots.h
@@ -14,9 +14,6 @@
#include "serialize.h"
#include "commands.h"
-
-typedef Anope::hash_map<BotInfo *> botinfo_map;
-
/* A service bot (NickServ, ChanServ, a BotServ bot, etc). */
class CoreExport ServiceBot : public LocalUser
{
diff --git a/modules/commands/bs_botlist.cpp b/modules/commands/bs_botlist.cpp
index fc8bf7732..ce899719e 100644
--- a/modules/commands/bs_botlist.cpp
+++ b/modules/commands/bs_botlist.cpp
@@ -26,14 +26,14 @@ class CommandBSBotList : public Command
list.AddColumn(_("Nick")).AddColumn(_("Mask"));
- for (ServiceBot *bi : Serialize::GetObjects<ServiceBot *>(botinfo))
+ for (BotInfo *bi : Serialize::GetObjects<BotInfo *>(botinfo))
{
- if (source.HasPriv("botserv/administration") || !bi->bi->GetOperOnly())
+ if (source.HasPriv("botserv/administration") || !bi->GetOperOnly())
{
++count;
ListFormatter::ListEntry entry;
- entry["Nick"] = (bi->bi->GetOperOnly() ? "* " : "") + bi->nick;
- entry["Mask"] = bi->GetIdent() + "@" + bi->host;
+ entry["Nick"] = (bi->GetOperOnly() ? "* " : "") + bi->GetNick();
+ entry["Mask"] = bi->GetUser() + "@" + bi->GetHost();
list.AddEntry(entry);
}
}
diff --git a/modules/commands/os_modinfo.cpp b/modules/commands/os_modinfo.cpp
index e4e1d986e..f3c6db00f 100644
--- a/modules/commands/os_modinfo.cpp
+++ b/modules/commands/os_modinfo.cpp
@@ -42,8 +42,15 @@ class CommandOSModInfo : public Command
source.Reply(_(" Providing service: \002{0}\002"), c->name);
- for (ServiceBot *bi : Serialize::GetObjects<ServiceBot *>(botinfo))
+ for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
{
+ User *u = it->second;
+
+ if (u->type != UserType::BOT)
+ continue;
+
+ ServiceBot *bi = anope_dynamic_static_cast<ServiceBot *>(u);
+
for (CommandInfo::map::const_iterator cit = bi->commands.begin(), cit_end = bi->commands.end(); cit != cit_end; ++cit)
{
const Anope::string &c_name = cit->first;
diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp
index 1e63ed448..da412623a 100644
--- a/modules/protocol/hybrid.cpp
+++ b/modules/protocol/hybrid.cpp
@@ -22,9 +22,16 @@ class HybridProto : public IRCDProto
if (bi && bi->introduced)
return bi;
- for (ServiceBot *bi2 : Serialize::GetObjects<ServiceBot *>(botinfo))
- if (bi2->introduced)
- return bi2;
+ for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
+ {
+ User *u = it->second;
+ if (u->type == UserType::BOT)
+ {
+ bi = anope_dynamic_static_cast<ServiceBot *>(u);
+ if (bi->introduced)
+ return bi;
+ }
+ }
return NULL;
}