summaryrefslogtreecommitdiff
path: root/plugins/NewsAggregator/Src/Services.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-02-02 17:51:26 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-02-02 17:51:26 +0000
commit8476b3ba7e52f4099783e6066202bda140625c7e (patch)
tree18f370095e99c9fde0063473acac7e06d6f6a107 /plugins/NewsAggregator/Src/Services.cpp
parentb28982d13eeff6460db912a62e2f50cccf05a37d (diff)
added hook for ME_FOLDERS_PATH_CHANGED
git-svn-id: http://svn.miranda-ng.org/main/trunk@3399 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewsAggregator/Src/Services.cpp')
-rw-r--r--plugins/NewsAggregator/Src/Services.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp
index 10f0e72941..c302abdff2 100644
--- a/plugins/NewsAggregator/Src/Services.cpp
+++ b/plugins/NewsAggregator/Src/Services.cpp
@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA.
int g_nStatus = ID_STATUS_ONLINE;
UINT_PTR timerId = 0;
-HANDLE hTBButton = NULL;
+HANDLE hTBButton = NULL, hNewsAggregatorFolder = NULL;
void SetContactStatus(HANDLE hContact, int nNewStatus)
{
@@ -43,8 +43,26 @@ static void __cdecl WorkingThread(void* param)
}
}
+int OnFoldersChanged(WPARAM, LPARAM)
+{
+ FoldersGetCustomPathT(hNewsAggregatorFolder, tszRoot, MAX_PATH, _T(""));
+ return 0;
+}
+
int NewsAggrInit(WPARAM wParam, LPARAM lParam)
{
+ if (ServiceExists(MS_FOLDERS_REGISTER_PATH))
+ {
+ hNewsAggregatorFolder = FoldersRegisterCustomPathT("News Aggregator", "Avatars", MIRANDA_USERDATAT _T("\\Avatars\\")_T(DEFAULT_AVATARS_FOLDER));
+ FoldersGetCustomPathT(hNewsAggregatorFolder, tszRoot, MAX_PATH, _T(""));
+ }
+ else
+ {
+ TCHAR* tszFolder = Utils_ReplaceVarsT(_T("%miranda_userdata%\\"_T(DEFAULT_AVATARS_FOLDER)));
+ lstrcpyn(tszRoot, tszFolder, SIZEOF(tszRoot));
+ mir_free(tszFolder);
+ }
+
HANDLE hContact = db_find_first();
while (hContact != NULL)
{
@@ -61,9 +79,10 @@ int NewsAggrInit(WPARAM wParam, LPARAM lParam)
InitMenu();
HookEvent(ME_TTB_MODULELOADED, OnToolbarLoaded);
+ HookEvent(ME_FOLDERS_PATH_CHANGED, OnFoldersChanged);
// timer for the first update
- timerId = SetTimer(NULL, 0, 10000, timerProc2); // first update is 10 sec after load
+ timerId = SetTimer(NULL, 0, 10000, timerProc2); // first update is 10 sec after load
return 0;
}