diff options
Diffstat (limited to 'plugins/MirOTR')
-rw-r--r-- | plugins/MirOTR/MirOTR/src/options.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/plugins/MirOTR/MirOTR/src/options.cpp b/plugins/MirOTR/MirOTR/src/options.cpp index 39aa01d639..75c63b92c8 100644 --- a/plugins/MirOTR/MirOTR/src/options.cpp +++ b/plugins/MirOTR/MirOTR/src/options.cpp @@ -11,9 +11,12 @@ struct PROTOREGENKEYOPTIONS { TCHAR proto[129];
};
-void SetFilenames(const char *path) {
- if (!path || !path[0]) return;
- CallService(MS_UTILS_CREATEDIRTREE, 0, (LPARAM) path);
+void SetFilenames(const char *path)
+{
+ if (!path || !path[0])
+ return;
+
+ CreateDirectoryTree(path);
strcpy(g_fingerprint_store_filename, path);
strcpy(g_private_key_filename, path);
strcat(g_fingerprint_store_filename, ("\\"));
@@ -23,18 +26,12 @@ void SetFilenames(const char *path) { strcat(g_private_key_filename, PRIVATE_KEY_FILENAME);
}
-int FoldersChanged(WPARAM wParam, LPARAM lParam) {
+int FoldersChanged(WPARAM wParam, LPARAM lParam)
+{
char path[MAX_PATH];
-
- FOLDERSGETDATA fgd = {0};
- fgd.cbSize = sizeof(FOLDERSGETDATA);
- fgd.nMaxPathSize = MAX_PATH;
- fgd.szPath = path;
- if (CallService(MS_FOLDERS_GET_PATH, (LPARAM)hPATH_MIROTR, (LPARAM)&fgd)) {
- char *mypath = Utils_ReplaceVars(DATA_DIRECTORY);
- SetFilenames(mypath);
- mir_free(mypath);
- } else
+ if ( FoldersGetCustomPath(hPATH_MIROTR, path, SIZEOF(path), ""))
+ SetFilenames( VARS(DATA_DIRECTORY));
+ else
SetFilenames(path);
ReadPrivkeyFiles();
|