summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_pgsql.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/extra/m_pgsql.cpp')
-rw-r--r--src/modules/extra/m_pgsql.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index 7e782c277..dedb6a2c3 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -518,15 +518,30 @@ public:
ModulePgSQL(InspIRCd* Me)
: Module::Module(Me), currid(0)
{
- ServerInstance->Log(DEBUG, "%s 'SQL' feature", ServerInstance->PublishFeature("SQL", this) ? "Published" : "Couldn't publish");
-
+ ServerInstance->UseInterface("SQLutils");
+
sqlsuccess = new char[strlen(SQLSUCCESS)+1];
strlcpy(sqlsuccess, SQLSUCCESS, strlen(SQLSUCCESS)+1);
+ if (!ServerInstance->PublishFeature("SQL", this))
+ {
+ throw ModuleException("m_pgsql: Unable to publish feature 'SQL'");
+ }
+
OnRehash("");
+
+ ServerInstance->PublishInterface("SQL", this);
}
+ virtual ~ModulePgSQL()
+ {
+ DELETE(sqlsuccess);
+ ServerInstance->UnpublishInterface("SQL", this);
+ ServerInstance->DoneWithInterface("SQLutils");
+ }
+
+
void Implements(char* List)
{
List[I_OnUnloadModule] = List[I_OnRequest] = List[I_OnRehash] = List[I_OnUserRegister] = List[I_OnCheckReady] = List[I_OnUserDisconnect] = 1;
@@ -658,11 +673,7 @@ public:
{
return Version(1, 1, 0, 0, VF_VENDOR|VF_SERVICEPROVIDER, API_VERSION);
}
-
- virtual ~ModulePgSQL()
- {
- DELETE(sqlsuccess);
- }
+
};
SQLConn::SQLConn(InspIRCd* SI, ModulePgSQL* self, const SQLhost& hi)