diff options
| author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-19 00:22:46 +0000 |
|---|---|---|
| committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-19 00:22:46 +0000 |
| commit | 23f5e9de79047b448282d6984db3f12511b751eb (patch) | |
| tree | 81f30ef738acc2c2f12f6e7327f729e20d9d39e1 /src/modules/os_ignore_db.c | |
| parent | 6c1d764c4ff6901456b9df55727d7e80d0aa76c8 (diff) | |
Move last of events that are in the core distro over to newevents.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2115 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modules/os_ignore_db.c')
| -rw-r--r-- | src/modules/os_ignore_db.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/modules/os_ignore_db.c b/src/modules/os_ignore_db.c index f7f6da0ff..c45b8d529 100644 --- a/src/modules/os_ignore_db.c +++ b/src/modules/os_ignore_db.c @@ -67,7 +67,6 @@ int new_write_db_entry(const char *key, DBFile *dbptr, const char *fmt, ...); int new_write_db_endofblock(DBFile *dbptr); void fill_db_ptr(DBFile *dbptr, int version, int core_version, char service[256], char filename[256]); -int backup_ignoredb(int argc, char **argv); void load_ignore_db(); void load_config(); @@ -78,7 +77,6 @@ class OSIgnoreDB : public Module public: OSIgnoreDB(const std::string &modname, const std::string &creator) : Module(modname, creator) { - EvtHook *hook; IgnoreDB = NULL; this->SetAuthor(AUTHOR); @@ -86,10 +84,7 @@ class OSIgnoreDB : public Module this->SetType(SUPPORTED); ModuleManager::Attach(I_OnSaveDatabase, this); - - hook = createEventHook(EVENT_DB_BACKUP, backup_ignoredb); - if (this->AddEventHook(hook) != MOD_ERR_OK) - throw ModuleException("os_ignore_db: Can't hook to EVENT_DB_BACKUP event"); + ModuleManager::Attach(I_OnBackupDatabase, this); load_config(); /* Load the ignore database and re-add them to anopes ignorelist. */ @@ -165,10 +160,13 @@ class OSIgnoreDB : public Module } } - -}; + void OnBackupDatabase() + { + ModuleDatabaseBackup(IgnoreDB); + } +}; /* ------------------------------------------------------------------------------- */ @@ -185,18 +183,6 @@ void load_config() { alog("[os_ignore_db] debug: Set config vars: OSIgnoreDBName='%s'", IgnoreDB); } -/** - * When anope backs her databases up, we do the same. - **/ -int backup_ignoredb(int argc, char **argv) { - if ((argc >= 1) && (!stricmp(argv[0], "stop"))) { - if (debug) - alog("[os_ignore_db] debug: Backing up %s database...", IgnoreDB); - ModuleDatabaseBackup(IgnoreDB); - } - return MOD_CONT; -} - /* ------------------------------------------------------------------------------- */ /************************************************************************** |
