diff options
Diffstat (limited to 'plugins/NoHistory/src/dllmain.cpp')
-rw-r--r-- | plugins/NoHistory/src/dllmain.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index c0e80b7676..a4b580fa84 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -42,8 +42,10 @@ PLUGININFOEX pluginInfoEx = CMPlugin::CMPlugin() :
PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx),
- bEnabledForNew(MODULENAME, "EnabledForNew", true)
-{}
+ bEnabledForNew(MODULENAME, "EnabledForNew", true),
+ bWipeOnStartup(MODULENAME, "WipeOnStartup", false)
+{
+}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -95,9 +97,11 @@ void RemoveAllEvents(MCONTACT hContact) pCursor.DeleteEvent();
}
-void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
+static void CALLBACK WipeOnStart()
{
- RemoveReadEvents();
+ for (auto &cc : Contacts())
+ if (g_plugin.getByte(cc, DBSETTING_REMOVE))
+ RemoveAllEvents(cc);
}
int OnDatabaseEventAdd(WPARAM hContact, LPARAM hDBEvent)
@@ -266,6 +270,9 @@ int CMPlugin::Load() InitIcons();
+ if (bWipeOnStartup)
+ Miranda_WaitOnHandle(WipeOnStart);
+
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
HookEvent(ME_DB_CONTACT_ADDED, OnContactAdded);
HookEvent(ME_DB_EVENT_ADDED, OnDatabaseEventAdd);
|