summaryrefslogtreecommitdiff
path: root/plugins/MirOTR
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-01 21:55:47 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-01 21:55:47 +0000
commit12012a3ea4d58c6624f8065c2ca2afb96090b70f (patch)
tree47e60353bc84f956e1c71241ef563c54dbc8765b /plugins/MirOTR
parentb2269a81668efaf157d541f2ffd67e52b89417c6 (diff)
service call replaced with helper
git-svn-id: http://svn.miranda-ng.org/main/trunk@3825 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR')
-rw-r--r--plugins/MirOTR/MirOTR/src/options.cpp25
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();