summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/New_GPG/src/main.cpp')
-rwxr-xr-xplugins/New_GPG/src/main.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index 42d754f6d5..81e162fff5 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -20,7 +20,7 @@
void FirstRun()
{
- if (!db_get_b(NULL, MODULENAME, "FirstRun", 1))
+ if (!g_plugin.getByte("FirstRun", 1))
return;
CDlgGpgBinOpts *d = new CDlgGpgBinOpts;
d->Show();
@@ -30,13 +30,13 @@ void InitCheck()
{
{
// parse gpg output
- wchar_t *current_home = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L"");
- db_set_ws(NULL, MODULENAME, "szHomePath", L""); //we do not need home for gpg binary validation
+ wchar_t *current_home = UniGetContactSettingUtf(0, MODULENAME, "szHomePath", L"");
+ g_plugin.setWString("szHomePath", L""); //we do not need home for gpg binary validation
globals.gpg_valid = isGPGValid();
- db_set_ws(NULL, MODULENAME, "szHomePath", current_home); //return current home dir back
+ g_plugin.setWString("szHomePath", current_home); //return current home dir back
mir_free(current_home);
bool home_dir_access = false, temp_access = false;
- wchar_t *home_dir = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L"");
+ wchar_t *home_dir = UniGetContactSettingUtf(0, MODULENAME, "szHomePath", L"");
std::wstring test_path = home_dir;
mir_free(home_dir);
test_path += L"/";
@@ -91,7 +91,7 @@ void InitCheck()
if (result == pxNotFound)
return;
}
- home_dir = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L"");
+ home_dir = UniGetContactSettingUtf(0, MODULENAME, "szHomePath", L"");
wstring tmp_dir = home_dir;
mir_free(home_dir);
tmp_dir += L"\\tmp";
@@ -109,11 +109,11 @@ void InitCheck()
acc += pa->szModuleName;
acc += ")";
acc += "_KeyID";
- keyid = UniGetContactSettingUtf(NULL, MODULENAME, acc.c_str(), "");
+ keyid = UniGetContactSettingUtf(0, MODULENAME, acc.c_str(), "");
if (keyid[0]) {
question = Translate("Your secret key with ID: ");
mir_free(keyid);
- keyid = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", "");
+ keyid = UniGetContactSettingUtf(0, MODULENAME, "KeyID", "");
if ((p = out.find(keyid)) == string::npos) {
question += keyid;
question += Translate(" for account ");
@@ -173,9 +173,9 @@ void InitCheck()
}
}
question = Translate("Your secret key with ID: ");
- keyid = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", "");
- char *key = UniGetContactSettingUtf(NULL, MODULENAME, "GPGPubKey", "");
- if (!db_get_b(NULL, MODULENAME, "FirstRun", 1) && (!keyid[0] || !key[0])) {
+ keyid = UniGetContactSettingUtf(0, MODULENAME, "KeyID", "");
+ char *key = UniGetContactSettingUtf(0, MODULENAME, "GPGPubKey", "");
+ if (!g_plugin.getByte("FirstRun", 1) && (!keyid[0] || !key[0])) {
question = Translate("You didn't set a private key.\nWould you like to set it now?");
if (MessageBoxA(nullptr, question.c_str(), Translate("Own private key warning"), MB_YESNO) == IDYES) {
CDlgFirstRun *d = new CDlgFirstRun;
@@ -235,7 +235,7 @@ void InitCheck()
mir_free(key);
}
{
- wchar_t *path = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L"");
+ wchar_t *path = UniGetContactSettingUtf(0, MODULENAME, "szHomePath", L"");
DWORD dwFileAttr = GetFileAttributes(path);
if (dwFileAttr != INVALID_FILE_ATTRIBUTES) {
dwFileAttr &= ~FILE_ATTRIBUTE_READONLY;
@@ -290,7 +290,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key)
std::vector<wstring> cmd;
wchar_t tmp2[MAX_PATH] = { 0 };
{
- wcsncpy(tmp2, ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L"")), MAX_PATH - 1);
+ wcsncpy(tmp2, ptrW(UniGetContactSettingUtf(0, MODULENAME, "szHomePath", L"")), MAX_PATH - 1);
mir_wstrncat(tmp2, L"\\", _countof(tmp2) - mir_wstrlen(tmp2));
mir_wstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_wstrlen(tmp2));
boost::filesystem::remove(tmp2);