summaryrefslogtreecommitdiff
path: root/modules/extra
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-05-28 12:07:29 -0400
committerAdam <Adam@anope.org>2014-05-28 12:07:54 -0400
commitf29e1cf383529a1a29f02b0669d973f5ee0b7a66 (patch)
tree3c33db276dc9328235bbd572641521ed44458176 /modules/extra
parent1253c70e0682fa1490c99c3d2869049a0e3fa2e0 (diff)
Move most of the core pseudoclient logic to modules
Diffstat (limited to 'modules/extra')
-rw-r--r--modules/extra/m_ldap.cpp6
-rw-r--r--modules/extra/m_ldap_authentication.cpp8
-rw-r--r--modules/extra/m_ldap_oper.cpp4
-rw-r--r--modules/extra/m_mysql.cpp4
-rw-r--r--modules/extra/m_sql_authentication.cpp4
-rw-r--r--modules/extra/m_sql_oper.cpp4
-rw-r--r--modules/extra/m_sqlite.cpp2
-rw-r--r--modules/extra/m_ssl_openssl.cpp8
-rw-r--r--modules/extra/stats/cs_fantasy_stats.cpp2
-rw-r--r--modules/extra/stats/m_chanstats.cpp20
10 files changed, 31 insertions, 31 deletions
diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp
index 1615d855c..efbef59f8 100644
--- a/modules/extra/m_ldap.cpp
+++ b/modules/extra/m_ldap.cpp
@@ -125,7 +125,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition
ldap_unbind_ext(this->con, NULL, NULL);
}
-
+
LDAPQuery BindAsAdmin(LDAPInterface *i)
{
return this->Bind(i, this->admin_binddn, this->admin_pass);
@@ -554,7 +554,7 @@ class ModuleLDAP : public Module, public Pipe
}
}
s->Unlock();
- }
+ }
}
void OnNotify() override
@@ -586,7 +586,7 @@ class ModuleLDAP : public Module, public Pipe
delete r;
}
- }
+ }
}
};
diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp
index abd5cc33c..9f2550e69 100644
--- a/modules/extra/m_ldap_authentication.cpp
+++ b/modules/extra/m_ldap_authentication.cpp
@@ -22,7 +22,7 @@ struct IdentifyInfo
{
req->Hold(me);
}
-
+
~IdentifyInfo()
{
req->Release(me);
@@ -100,10 +100,10 @@ class IdentifyInterface : public LDAPInterface
}
else
{
- NickAlias *na = NickAlias::Find(ii->req->GetAccount());
+ NickServ::Nick *na = NickServ::FindNick(ii->req->GetAccount());
if (na == NULL)
{
- na = new NickAlias(ii->req->GetAccount(), new NickCore(ii->req->GetAccount()));
+ na = new NickServ::Nick(ii->req->GetAccount(), new NickServ::Account(ii->req->GetAccount()));
na->last_realname = ii->user ? ii->user->realname : ii->req->GetAccount();
NickServ::Event::OnNickRegister(&NickServ::Event::NickRegister::OnNickRegister, ii->user, na);
BotInfo *NickServ = Config->GetClient("NickServ");
@@ -311,7 +311,7 @@ class NSIdentifyLDAP : public Module
}
}
- void OnNickRegister(User *, NickAlias *na) override
+ void OnNickRegister(User *, NickServ::Nick *na) override
{
if (!this->disable_register_reason.empty() || !this->ldap)
return;
diff --git a/modules/extra/m_ldap_oper.cpp b/modules/extra/m_ldap_oper.cpp
index 7c6db48f5..ca6020c6a 100644
--- a/modules/extra/m_ldap_oper.cpp
+++ b/modules/extra/m_ldap_oper.cpp
@@ -30,7 +30,7 @@ class IdentifyInterface : public LDAPInterface
if (!u || !u->Account())
return;
- NickCore *nc = u->Account();
+ NickServ::Account *nc = u->Account();
try
{
@@ -131,7 +131,7 @@ class LDAPOper : public Module
}
}
- void OnDelCore(NickCore *nc) override
+ void OnDelCore(NickServ::Account *nc) override
{
if (nc->o != NULL && my_opers.count(nc->o) > 0)
{
diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp
index d0db90195..02d015ed8 100644
--- a/modules/extra/m_mysql.cpp
+++ b/modules/extra/m_mysql.cpp
@@ -438,7 +438,7 @@ Query MySQLService::BuildInsert(const Anope::string &table, unsigned int id, Dat
*it->second >> buf;
query.SetValue(it->first, buf);
}
-
+
return query;
}
@@ -458,7 +458,7 @@ void MySQLService::Connect()
if (!connect)
throw SQL::Exception("Unable to connect to MySQL service " + this->name + ": " + mysql_error(this->sql));
-
+
Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->name << " at " << this->server << ":" << this->port;
}
diff --git a/modules/extra/m_sql_authentication.cpp b/modules/extra/m_sql_authentication.cpp
index 65f0f2800..74e2554fa 100644
--- a/modules/extra/m_sql_authentication.cpp
+++ b/modules/extra/m_sql_authentication.cpp
@@ -38,11 +38,11 @@ class SQLAuthenticationResult : public SQL::Interface
}
catch (const SQL::Exception &) { }
- NickAlias *na = NickAlias::Find(req->GetAccount());
+ NickServ::Nick *na = NickServ::FindNick(req->GetAccount());
BotInfo *NickServ = Config->GetClient("NickServ");
if (na == NULL)
{
- na = new NickAlias(req->GetAccount(), new NickCore(req->GetAccount()));
+ na = new NickServ::Nick(req->GetAccount(), new NickServ::Account(req->GetAccount()));
NickServ::Event::OnNickRegister(&NickServ::Event::NickRegister::OnNickRegister, user, na);
if (user && NickServ)
user->SendMessage(NickServ, _("Your account \002%s\002 has been successfully created."), na->nick.c_str());
diff --git a/modules/extra/m_sql_oper.cpp b/modules/extra/m_sql_oper.cpp
index 90fab856a..8337252ba 100644
--- a/modules/extra/m_sql_oper.cpp
+++ b/modules/extra/m_sql_oper.cpp
@@ -105,9 +105,9 @@ class ModuleSQLOper : public Module
~ModuleSQLOper()
{
- for (nickcore_map::const_iterator it = NickCoreList->begin(), it_end = NickCoreList->end(); it != it_end; ++it)
+ for (nickcore_map::const_iterator it = NickServ::AccountList->begin(), it_end = NickServ::AccountList->end(); it != it_end; ++it)
{
- NickCore *nc = it->second;
+ NickServ::Account *nc = it->second;
if (nc->o && dynamic_cast<SQLOper *>(nc->o))
{
diff --git a/modules/extra/m_sqlite.cpp b/modules/extra/m_sqlite.cpp
index c0f503141..32d335b1b 100644
--- a/modules/extra/m_sqlite.cpp
+++ b/modules/extra/m_sqlite.cpp
@@ -282,7 +282,7 @@ Query SQLiteService::BuildInsert(const Anope::string &table, unsigned int id, Da
*it->second >> buf;
query.SetValue(it->first, buf);
}
-
+
return query;
}
diff --git a/modules/extra/m_ssl_openssl.cpp b/modules/extra/m_ssl_openssl.cpp
index 3344f1d28..7687b599e 100644
--- a/modules/extra/m_ssl_openssl.cpp
+++ b/modules/extra/m_ssl_openssl.cpp
@@ -181,7 +181,7 @@ void MySSLService::Init(Socket *s)
{
if (s->io != &NormalSocketIO)
throw CoreException("Socket initializing SSL twice");
-
+
s->io = new SSLSocketIO();
}
@@ -259,7 +259,7 @@ ClientSocket *SSLSocketIO::Accept(ListenSocket *s)
newsocket->flags[SF_ACCEPTING] = true;
this->FinishAccept(newsocket);
-
+
return newsocket;
}
@@ -273,7 +273,7 @@ SocketFlag SSLSocketIO::FinishAccept(ClientSocket *cs)
throw SocketException("SSLSocketIO::FinishAccept called for a socket not accepted nor accepting?");
SSLSocketIO *io = anope_dynamic_static_cast<SSLSocketIO *>(cs->io);
-
+
int ret = SSL_accept(io->sslsock);
if (ret <= 0)
{
@@ -354,7 +354,7 @@ SocketFlag SSLSocketIO::FinishConnect(ConnectionSocket *s)
if (!SSL_set_fd(io->sslsock, s->GetFD()))
throw SocketException("Unable to set SSL fd");
}
-
+
int ret = SSL_connect(io->sslsock);
if (ret <= 0)
{
diff --git a/modules/extra/stats/cs_fantasy_stats.cpp b/modules/extra/stats/cs_fantasy_stats.cpp
index b400e23ed..4674e0892 100644
--- a/modules/extra/stats/cs_fantasy_stats.cpp
+++ b/modules/extra/stats/cs_fantasy_stats.cpp
@@ -113,7 +113,7 @@ class CSStats : public Module
channel = params[0];
else
{
- if (NickAlias *na = NickAlias::Find(params[0]))
+ if (NickServ::Nick *na = NickServ::FindNick(params[0]))
display = na->nc->display;
else
{
diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp
index 4efb1f430..d472fd55d 100644
--- a/modules/extra/stats/m_chanstats.cpp
+++ b/modules/extra/stats/m_chanstats.cpp
@@ -12,7 +12,7 @@ class CommandCSSetChanstats : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
- ChannelInfo *ci = ChannelInfo::Find(params[0]);
+ ChanServ::Channel *ci = ChanServ::Find(params[0]);
if (!ci)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
@@ -65,7 +65,7 @@ class CommandNSSetChanstats : public Command
}
void Run(CommandSource &source, const Anope::string &user, const Anope::string &param, bool saset = false)
{
- NickAlias *na = NickAlias::Find(user);
+ NickServ::Nick *na = NickServ::FindNick(user);
if (!na)
{
source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
@@ -103,7 +103,7 @@ class CommandNSSetChanstats : public Command
{
this->Run(source, source.nc->display, params[0]);
}
-
+
bool OnHelp(CommandSource &source, const Anope::string &) override
{
this->SendSyntax(source);
@@ -501,7 +501,7 @@ class MChanstats : public Module
Log(this) << "no database connection to " << engine;
}
- void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) override
+ void OnChanInfo(CommandSource &source, ChanServ::Channel *ci, InfoFormatter &info, bool show_all) override
{
if (!show_all)
return;
@@ -509,7 +509,7 @@ class MChanstats : public Module
info.AddOption(_("Chanstats"));
}
- void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override
+ void OnNickInfo(CommandSource &source, NickServ::Nick *na, InfoFormatter &info, bool show_hidden) override
{
if (!show_hidden)
return;
@@ -610,14 +610,14 @@ class MChanstats : public Module
this->RunQuery(query);
}
- void OnDelCore(NickCore *nc) override
+ void OnDelCore(NickServ::Account *nc) override
{
query = "DELETE FROM `" + prefix + "chanstats` WHERE `nick` = @nick@;";
query.SetValue("nick", nc->display);
this->RunQuery(query);
}
- void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) override
+ void OnChangeCoreDisplay(NickServ::Account *nc, const Anope::string &newdisplay) override
{
query = "CALL " + prefix + "chanstats_proc_chgdisplay(@old_display@, @new_display@);";
query.SetValue("old_display", nc->display);
@@ -625,20 +625,20 @@ class MChanstats : public Module
this->RunQuery(query);
}
- void OnDelChan(ChannelInfo *ci) override
+ void OnDelChan(ChanServ::Channel *ci) override
{
query = "DELETE FROM `" + prefix + "chanstats` WHERE `chan` = @channel@;";
query.SetValue("channel", ci->name);
this->RunQuery(query);
}
- void OnChanRegistered(ChannelInfo *ci)
+ void OnChanRegistered(ChanServ::Channel *ci)
{
if (CSDefChanstats)
ci->Extend<bool>("CS_STATS");
}
- void OnNickRegister(User *user, NickAlias *na)
+ void OnNickRegister(User *user, NickServ::Nick *na)
{
if (NSDefChanstats)
na->nc->Extend<bool>("NS_STATS");