extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); mir_getCLI(); HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded); Icon_Register(g_hInstance, MOD_NAME, iconList, _countof(iconList), "nas"); InitCommonControls(); InitOptions(); // must be called before we hook CallService if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1) { // change all %nas_message% variables to %extratext% if it wasn't done before TCString Str = db_get_s(NULL, MOD_NAME, "PopupsFormat", _T("")); if (Str.GetLen()) db_set_ts(NULL, MOD_NAME, "PopupsFormat", Str.Replace(_T("nas_message"), _T("extratext"))); Str = db_get_s(NULL, MOD_NAME, "ReplyPrefix", _T("")); if (Str.GetLen()) db_set_ts(NULL, MOD_NAME, "ReplyPrefix", Str.Replace(_T("nas_message"), _T("extratext"))); } if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 2) { // disable autoreply for not-on-list contacts, as such contact may be a spam bot db_set_b(NULL, MOD_NAME, ContactStatusToDBSetting(0, DB_ENABLEREPLY, 0, INVALID_CONTACT_ID), 0); db_set_b(NULL, MOD_NAME, DB_SETTINGSVER, 2); } return 0; }
int CMPlugin::Load() { HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded); DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &g_hMainThread, THREAD_SET_CONTEXT, false, 0); InitOptions(); if (db_get_b(NULL, MODULENAME, DB_SETTINGSVER, 0) < 1) { TCString Str; Str = db_get_s(NULL, MODULENAME, DB_IGNORESUBSTRINGS, L""); if (Str.GetLen()) // fix incorrect regexp from v0.1.1.0 db_set_ws(NULL, MODULENAME, DB_IGNORESUBSTRINGS, Str.Replace(L"/Miranda[0-9A-F]{8}/", L"/[0-9A-F]{8}(\\W|$)/")); db_set_b(NULL, MODULENAME, DB_SETTINGSVER, 1); } return 0; }
extern "C" int __declspec(dllexport) Load(void) { mir_getLP( &pluginInfo ); HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded); DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &g_hMainThread, THREAD_SET_CONTEXT, false, 0); InitOptions(); if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1) { TCString Str; Str = db_get_s(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, _T("")); if (Str.GetLen()) // fix incorrect regexp from v0.1.1.0 db_set_ts(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, Str.Replace(_T("/Miranda[0-9A-F]{8}/"), _T("/[0-9A-F]{8}(\\W|$)/"))); db_set_b(NULL, MOD_NAME, DB_SETTINGSVER, 1); } return 0; }