summaryrefslogtreecommitdiff
path: root/plugins/NewsAggregstor
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-05-17 14:25:15 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-05-17 14:25:15 +0000
commitb968287dc40d6c6207c2ab758a22cfc9c10917b2 (patch)
treeb170e508c553712ba99c045159bd1f065f67159d /plugins/NewsAggregstor
parent5cc2ae83b687beeab67e039159ead88ae885ad50 (diff)
obsolete project files cleanup and overall adjustment: Part 4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewsAggregstor')
-rw-r--r--plugins/NewsAggregstor/NewsAggregator_10.vcxproj20
-rw-r--r--plugins/NewsAggregstor/Src/Common.h2
-rw-r--r--plugins/NewsAggregstor/Src/Icons.cpp12
-rw-r--r--plugins/NewsAggregstor/Src/Menus.cpp14
-rw-r--r--plugins/NewsAggregstor/Src/NewsAggregator.cpp3
-rw-r--r--plugins/NewsAggregstor/Src/Options.cpp58
-rw-r--r--plugins/NewsAggregstor/Src/Services.cpp20
-rw-r--r--plugins/NewsAggregstor/Src/Utils.cpp85
8 files changed, 130 insertions, 84 deletions
diff --git a/plugins/NewsAggregstor/NewsAggregator_10.vcxproj b/plugins/NewsAggregstor/NewsAggregator_10.vcxproj
index a78e18a223..f525ca10cf 100644
--- a/plugins/NewsAggregstor/NewsAggregator_10.vcxproj
+++ b/plugins/NewsAggregstor/NewsAggregator_10.vcxproj
@@ -85,7 +85,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\include;..\..\ExternalAPI;..\..\boost_1_49_0</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;../../../boost_1_49_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NEWSAGGREGATOR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
@@ -102,7 +102,7 @@
<AdditionalManifestDependencies>
</AdditionalManifestDependencies>
<AdditionalDependencies>comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>..\..\boost_1_49_0\lib</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>../../../boost_1_49_0/lib</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>
@@ -115,8 +115,8 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\include;..\..\ExternalAPI;..\..\boost_1_49_0</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;NEWSAGGREGATOR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;../../../boost_1_49_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_WIN64;_DEBUG;_WINDOWS;_USRDLL;NEWSAGGREGATOR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
@@ -129,7 +129,7 @@
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <AdditionalLibraryDirectories>..\..\boost_1_49_0\lib64</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>../../../boost_1_49_0/lib64</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>
@@ -143,7 +143,7 @@
<ClCompile>
<Optimization>Full</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
- <AdditionalIncludeDirectories>..\..\include;..\..\ExternalAPI;..\..\boost_1_49_0</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;../../../boost_1_49_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;NEWSAGGREGATOR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
@@ -161,7 +161,7 @@
</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>..\..\boost_1_49_0\lib</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>../../../boost_1_49_0/lib</AdditionalLibraryDirectories>
</Link>
<Manifest>
<AdditionalManifestFiles>
@@ -175,8 +175,8 @@
<ClCompile>
<Optimization>Full</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
- <AdditionalIncludeDirectories>..\..\include;..\..\ExternalAPI;..\..\boost_1_49_0</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;NEWSAGGREGATOR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;../../../boost_1_49_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_WIN64;NDEBUG;_WINDOWS;_USRDLL;NEWSAGGREGATOR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -191,7 +191,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalLibraryDirectories>..\..\boost_1_49_0\lib64</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>../../../boost_1_49_0/lib64</AdditionalLibraryDirectories>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
diff --git a/plugins/NewsAggregstor/Src/Common.h b/plugins/NewsAggregstor/Src/Common.h
index 789ddcffea..fedb81250c 100644
--- a/plugins/NewsAggregstor/Src/Common.h
+++ b/plugins/NewsAggregstor/Src/Common.h
@@ -64,7 +64,7 @@ Boston, MA 02111-1307, USA.
#define DEFAULT_AVATARS_FOLDER "NewsAggregator"
extern HINSTANCE hInst;
extern HWND hAddFeedDlg;
-extern HWND hChangeFeedDlg;
+extern HANDLE hChangeFeedDlgList;
extern UINT_PTR timerId;
// check if Feeds is currently updating
extern BOOL ThreadRunning;
diff --git a/plugins/NewsAggregstor/Src/Icons.cpp b/plugins/NewsAggregstor/Src/Icons.cpp
index a0c08f7825..096a38086b 100644
--- a/plugins/NewsAggregstor/Src/Icons.cpp
+++ b/plugins/NewsAggregstor/Src/Icons.cpp
@@ -29,12 +29,12 @@ struct _tag_iconList
static iconList[] =
{
- { _T("Protocol icon"), "main", IDI_ICON },
- { _T("Check All Feeds"), "checkall", IDI_CHECKALL },
- { _T("Add Feed"), "addfeed", IDI_ADDFEED },
- { _T("Import Feeds"), "importfeeds", IDI_IMPORTFEEDS },
- { _T("Export Feeds"), "exportfeeds", IDI_EXPORTFEEDS },
- { _T("Check Feed"), "checkfeed", IDI_CHECKALL },
+ { LPGENT("Protocol icon"), "main", IDI_ICON },
+ { LPGENT("Check All Feeds"), "checkall", IDI_CHECKALL },
+ { LPGENT("Add Feed"), "addfeed", IDI_ADDFEED },
+ { LPGENT("Import Feeds"), "importfeeds", IDI_IMPORTFEEDS },
+ { LPGENT("Export Feeds"), "exportfeeds", IDI_EXPORTFEEDS },
+ { LPGENT("Check Feed"), "checkfeed", IDI_CHECKALL },
};
VOID InitIcons()
diff --git a/plugins/NewsAggregstor/Src/Menus.cpp b/plugins/NewsAggregstor/Src/Menus.cpp
index 9228a4c198..2ff20ce596 100644
--- a/plugins/NewsAggregstor/Src/Menus.cpp
+++ b/plugins/NewsAggregstor/Src/Menus.cpp
@@ -29,44 +29,44 @@ VOID InitMenu()
mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB|CMIF_NOTOFFLINE;
// adding main menu items
- mi.ptszPopupName = _T("News Aggregator");
+ mi.ptszPopupName = LPGENT("News Aggregator");
mi.popupPosition = 500099000;
mi.position=10100001;
mi.icolibItem = GetIconHandle("main");
- mi.ptszName = _T("Check All Feeds");
+ mi.ptszName = LPGENT("Check All Feeds");
mi.pszService = MS_NEWSAGGR_CHECKALLFEEDS;
hService2[0] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
mi.position=10100002;
mi.icolibItem = GetIconHandle("addfeed");
- mi.ptszName = _T("Add Feed");
+ mi.ptszName = LPGENT("Add Feed");
mi.pszService = MS_NEWSAGGR_ADDFEED;
hService2[1] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
mi.position=10100003;
mi.icolibItem = GetIconHandle("importfeeds");
- mi.ptszName = _T("Import Feeds");
+ mi.ptszName = LPGENT("Import Feeds");
mi.pszService = MS_NEWSAGGR_IMPORTFEEDS;
hService2[2] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
mi.position=10100004;
mi.icolibItem = GetIconHandle("exportfeeds");
- mi.ptszName = _T("Export Feeds");
+ mi.ptszName = LPGENT("Export Feeds");
mi.pszService = MS_NEWSAGGR_EXPORTFEEDS;
hService2[3] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
// adding contact menu items
mi.position=-0x7FFFFFFA;
mi.icolibItem = GetIconHandle("checkfeed");
- mi.ptszName = _T("Check feed");
+ mi.ptszName = LPGENT("Check feed");
mi.pszService = MS_NEWSAGGR_CHECKFEED;
hService2[4] = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
// adding contact menu items
mi.position=-0x7FFFFFFA;
//mi.icolibItem = GetIconHandle("checkfeed");
- mi.ptszName = _T("Change feed");
+ mi.ptszName = LPGENT("Change feed");
mi.pszService = MS_NEWSAGGR_CHANGEFEED;
hService2[5] = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
diff --git a/plugins/NewsAggregstor/Src/NewsAggregator.cpp b/plugins/NewsAggregstor/Src/NewsAggregator.cpp
index 3bbead8745..3d7c0e1251 100644
--- a/plugins/NewsAggregstor/Src/NewsAggregator.cpp
+++ b/plugins/NewsAggregstor/Src/NewsAggregator.cpp
@@ -26,7 +26,7 @@ struct MM_INTERFACE mmi;
HANDLE hOptHook = NULL, hLoadHook = NULL, hOnPreShutdown = NULL, hPrebuildMenuHook = NULL, hPackUpdaterFolder = NULL;
HANDLE hProtoService[7];
HWND hAddFeedDlg;
-HWND hChangeFeedDlg;
+HANDLE hChangeFeedDlgList = NULL;
XML_API xi = {0};
struct UTF8_INTERFACE utfi;
TCHAR tszRoot[MAX_PATH] = {0};
@@ -98,6 +98,7 @@ extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
hOnPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, NewsAggrPreShutdown);
hUpdateMutex = CreateMutex(NULL, FALSE, NULL);
+ hChangeFeedDlgList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
// register weather protocol
PROTOCOLDESCRIPTOR pd = {0};
diff --git a/plugins/NewsAggregstor/Src/Options.cpp b/plugins/NewsAggregstor/Src/Options.cpp
index ae9f5b5739..74249b1a64 100644
--- a/plugins/NewsAggregstor/Src/Options.cpp
+++ b/plugins/NewsAggregstor/Src/Options.cpp
@@ -33,6 +33,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
SendDlgItemMessage(hwndDlg, IDC_CHECKTIME, EM_LIMITTEXT, 3, 0);
SetDlgItemInt(hwndDlg, IDC_CHECKTIME, 60, TRUE);
SendDlgItemMessage(hwndDlg, IDC_TIMEOUT_VALUE_SPIN, UDM_SETRANGE32, 0, 999);
+ Utils_RestoreWindowPositionNoSize(hwndDlg,NULL,MODULE,"AddDlg");
return TRUE;
}
case WM_COMMAND:
@@ -139,6 +140,10 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
DestroyWindow(hwndDlg);
break;
}
+ case WM_DESTROY:
+ {
+ Utils_SaveWindowPosition(hwndDlg,NULL,MODULE,"AddDlg");
+ }
}
return FALSE;
@@ -164,13 +169,13 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
DBVARIANT dbNick = {0};
if (DBGetContactSettingTString(hContact, MODULE, "Nick", &dbNick))
- break;
+ continue;
else if (lstrcmp(dbNick.ptszVal, SelItem.nick) == 0)
{
DBFreeVariant(&dbNick);
DBVARIANT dbURL = {0};
if (DBGetContactSettingTString(hContact, MODULE, "URL", &dbURL))
- break;
+ continue;
else if (lstrcmp(dbURL.ptszVal, SelItem.url) == 0)
{
DBFreeVariant(&dbURL);
@@ -211,6 +216,8 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}
+ WindowList_Add(hChangeFeedDlgList,hwndDlg,hContact);
+ Utils_RestoreWindowPositionNoSize(hwndDlg,hContact,MODULE,"ChangeDlg");
return TRUE;
}
case WM_COMMAND:
@@ -293,16 +300,18 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case IDC_DISCOVERY:
{
- EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
- SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
- TCHAR tszURL[MAX_PATH] = {0}, *tszTitle = NULL;
+ TCHAR tszURL[MAX_PATH] = {0};
if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, SIZEOF(tszURL)) || lstrcmp(tszURL, _T("http://")) != 0)
- tszTitle = CheckFeed(tszURL, hwndDlg);
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
+ SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
+ TCHAR *tszTitle = CheckFeed(tszURL, hwndDlg);
+ SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE);
+ SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Check Feed"));
+ }
else
MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK);
- SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
- EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE);
- SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Check Feed"));
}
break;
}
@@ -317,6 +326,9 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_DESTROY:
{
+ HANDLE hContact = (HANDLE) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ Utils_SaveWindowPosition(hwndDlg,hContact,MODULE,"ChangeDlg");
+ WindowList_Remove(hChangeFeedDlgList,hwndDlg);
ItemInfo *SelItem = (ItemInfo*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
delete SelItem;
break;
@@ -337,6 +349,8 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg, IDC_CHECKTIME, UDM_SETRANGE32, 0, 999);
HANDLE hContact = (HANDLE)lParam;
+ WindowList_Add(hChangeFeedDlgList,hwndDlg,hContact);
+ Utils_RestoreWindowPositionNoSize(hwndDlg,hContact,MODULE,"ChangeDlg");
DBVARIANT dbNick = {0};
if (!DBGetContactSettingTString(hContact, MODULE, "Nick", &dbNick))
{
@@ -456,16 +470,18 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case IDC_DISCOVERY:
{
- EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
- SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
- TCHAR tszURL[MAX_PATH] = {0}, *tszTitle = NULL;
+ TCHAR tszURL[MAX_PATH] = {0};
if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, SIZEOF(tszURL)) || lstrcmp(tszURL, _T("http://")) != 0)
- tszTitle = CheckFeed(tszURL, hwndDlg);
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
+ SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
+ TCHAR *tszTitle = CheckFeed(tszURL, hwndDlg);
+ SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE);
+ SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Check Feed"));
+ }
else
MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK);
- SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
- EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE);
- SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Check Feed"));
}
break;
}
@@ -477,6 +493,12 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP
DestroyWindow(hwndDlg);
break;
}
+ case WM_DESTROY:
+ {
+ HANDLE hContact = (HANDLE) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ Utils_SaveWindowPosition(hwndDlg,hContact,MODULE,"ChangeDlg");
+ WindowList_Remove(hChangeFeedDlgList,hwndDlg);
+ }
}
return FALSE;
@@ -619,8 +641,8 @@ INT OptInit(WPARAM wParam, LPARAM lParam)
odp.hInstance = hInst;
odp.flags = ODPF_TCHAR | ODPF_BOLDGROUPS;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszGroup = _T("Network");
- odp.ptszTitle = _T("News Aggregator");
+ odp.ptszGroup = LPGENT("Network");
+ odp.ptszTitle = LPGENT("News Aggregator");
odp.pfnDlgProc = UpdateNotifyOptsProc;
CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
return 0;
diff --git a/plugins/NewsAggregstor/Src/Services.cpp b/plugins/NewsAggregstor/Src/Services.cpp
index 42fbc2e0b0..b47d688f08 100644
--- a/plugins/NewsAggregstor/Src/Services.cpp
+++ b/plugins/NewsAggregstor/Src/Services.cpp
@@ -70,10 +70,8 @@ int NewsAggrPreShutdown(WPARAM wParam,LPARAM lParam)
{
SendMessage(hAddFeedDlg, WM_CLOSE, 0, 0);
}
- if (hChangeFeedDlg)
- {
- SendMessage(hChangeFeedDlg, WM_CLOSE, 0, 0);
- }
+ WindowList_Broadcast(hChangeFeedDlgList, WM_CLOSE, 0, 0);
+
mir_forkthread(WorkingThread, (void*)ID_STATUS_OFFLINE);
KillTimer(NULL, timerId);
NetlibUnInit();
@@ -182,8 +180,18 @@ INT_PTR AddFeed(WPARAM wParam,LPARAM lParam)
INT_PTR ChangeFeed(WPARAM wParam,LPARAM lParam)
{
- hChangeFeedDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDFEED), NULL, DlgProcChangeFeedMenu, (LPARAM)wParam);
- ShowWindow(hChangeFeedDlg, SW_SHOW);
+ HANDLE hContact = (HANDLE) wParam;
+ HWND hChangeFeedDlg = WindowList_Find(hChangeFeedDlgList,hContact);
+ if(!hChangeFeedDlg)
+ {
+ hChangeFeedDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDFEED), NULL, DlgProcChangeFeedMenu, (LPARAM)hContact);
+ ShowWindow(hChangeFeedDlg, SW_SHOW);
+ }
+ else
+ {
+ SetForegroundWindow(hChangeFeedDlg);
+ SetFocus(hChangeFeedDlg);
+ }
return 0;
}
diff --git a/plugins/NewsAggregstor/Src/Utils.cpp b/plugins/NewsAggregstor/Src/Utils.cpp
index c474fa56e4..85503966ce 100644
--- a/plugins/NewsAggregstor/Src/Utils.cpp
+++ b/plugins/NewsAggregstor/Src/Utils.cpp
@@ -166,17 +166,19 @@ VOID GetNewsData(TCHAR *tszUrl, char** szData, HANDLE hContact, HWND hwndDlg)
nlhr.headers[2].szValue = "no-cache";
nlhr.headers[3].szName = "Connection";
nlhr.headers[3].szValue = "close";
+ nlhr.headers[4].szName = "Accept";
+ nlhr.headers[4].szValue = "ext/html, application/xml";
if (DBGetContactSettingByte(hContact, MODULE, "UseAuth", 0) || IsDlgButtonChecked(hwndDlg, IDC_USEAUTH))
{
- nlhr.headersCount = 5;
- nlhr.headers[4].szName = "Authorization";
+ nlhr.headersCount = 6;
+ nlhr.headers[5].szName = "Authorization";
char auth[256];
CreateAuthString(auth, hContact, hwndDlg);
- nlhr.headers[4].szValue = auth;
+ nlhr.headers[5].szValue = auth;
}
else
- nlhr.headersCount = 4;
+ nlhr.headersCount = 5;
// download the page
NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUser, (LPARAM)&nlhr);
@@ -337,37 +339,50 @@ time_t __stdcall DateToUnixTime(TCHAR* stamp, BOOL FeedType)
{
TCHAR weekday[4], monthstr[4], timezonesign[2];
INT day, month, year, hour, min, sec, timezoneh, timezonem;
- _stscanf( p, _T("%3s, %d %3s %d %d:%d:%d %1s%02d%02d"), &weekday, &day, &monthstr, &year, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
- if (lstrcmpi(monthstr, _T("Jan")) ==0)
- month = 1;
- if (lstrcmpi(monthstr, _T("Feb")) ==0)
- month = 2;
- if (lstrcmpi(monthstr, _T("Mar")) ==0)
- month = 3;
- if (lstrcmpi(monthstr, _T("Apr")) ==0)
- month = 4;
- if (lstrcmpi(monthstr, _T("May")) ==0)
- month = 5;
- if (lstrcmpi(monthstr, _T("Jun")) ==0)
- month = 6;
- if (lstrcmpi(monthstr, _T("Jul")) ==0)
- month = 7;
- if (lstrcmpi(monthstr, _T("Aug")) ==0)
- month = 8;
- if (lstrcmpi(monthstr, _T("Sep")) ==0)
- month = 9;
- if (lstrcmpi(monthstr, _T("Oct")) ==0)
- month = 10;
- if (lstrcmpi(monthstr, _T("Nov")) ==0)
- month = 11;
- if (lstrcmpi(monthstr, _T("Dec")) ==0)
- month = 12;
- if (lstrcmp(timezonesign, _T("+")) ==0)
- mir_sntprintf(p, 4+2+2+1+2+1+2+1+2+1, _T("%04d%02d%02dT%02d:%02d:%02d"), year, month, day, hour-timezoneh, min-timezonem, sec);
- else if (lstrcmp(timezonesign, _T("-")) ==0)
- mir_sntprintf(p, 4+2+2+1+2+1+2+1+2+1, _T("%04d%02d%02dT%02d:%02d:%02d"), year, month, day, hour+timezoneh, min+timezonem, sec);
+ if (_tcsstr(p, _T(",")))
+ {
+ _stscanf( p, _T("%3s, %d %3s %d %d:%d:%d %1s%02d%02d"), &weekday, &day, &monthstr, &year, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
+ if (lstrcmpi(monthstr, _T("Jan")) ==0)
+ month = 1;
+ if (lstrcmpi(monthstr, _T("Feb")) ==0)
+ month = 2;
+ if (lstrcmpi(monthstr, _T("Mar")) ==0)
+ month = 3;
+ if (lstrcmpi(monthstr, _T("Apr")) ==0)
+ month = 4;
+ if (lstrcmpi(monthstr, _T("May")) ==0)
+ month = 5;
+ if (lstrcmpi(monthstr, _T("Jun")) ==0)
+ month = 6;
+ if (lstrcmpi(monthstr, _T("Jul")) ==0)
+ month = 7;
+ if (lstrcmpi(monthstr, _T("Aug")) ==0)
+ month = 8;
+ if (lstrcmpi(monthstr, _T("Sep")) ==0)
+ month = 9;
+ if (lstrcmpi(monthstr, _T("Oct")) ==0)
+ month = 10;
+ if (lstrcmpi(monthstr, _T("Nov")) ==0)
+ month = 11;
+ if (lstrcmpi(monthstr, _T("Dec")) ==0)
+ month = 12;
+ if (lstrcmp(timezonesign, _T("+")) ==0)
+ mir_sntprintf(p, 4+2+2+1+2+1+2+1+2+1, _T("%04d%02d%02dT%02d:%02d:%02d"), year, month, day, hour-timezoneh, min-timezonem, sec);
+ else if (lstrcmp(timezonesign, _T("-")) ==0)
+ mir_sntprintf(p, 4+2+2+1+2+1+2+1+2+1, _T("%04d%02d%02dT%02d:%02d:%02d"), year, month, day, hour+timezoneh, min+timezonem, sec);
+ else
+ mir_sntprintf(p, 4+2+2+1+2+1+2+1+2+1, _T("%04d%02d%02dT%02d:%02d:%02d"), year, month, day, hour, min, sec);
+ }
else
- mir_sntprintf(p, 4+2+2+1+2+1+2+1+2+1, _T("%04d%02d%02dT%02d:%02d:%02d"), year, month, day, hour, min, sec);
+ {
+ _stscanf( p, _T("%d-%d-%d %d:%d:%d %1s%02d%02d"), &year, &month, &day, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
+ if (lstrcmp(timezonesign, _T("+")) ==0)
+ mir_sntprintf(p, 4+2+2+1+2+1+2+1+2+1, _T("%04d%02d%02dT%02d:%02d:%02d"), year, month, day, hour-timezoneh, min-timezonem, sec);
+ else if (lstrcmp(timezonesign, _T("-")) ==0)
+ mir_sntprintf(p, 4+2+2+1+2+1+2+1+2+1, _T("%04d%02d%02dT%02d:%02d:%02d"), year, month, day, hour+timezoneh, min+timezonem, sec);
+ else
+ mir_sntprintf(p, 4+2+2+1+2+1+2+1+2+1, _T("%04d%02d%02dT%02d:%02d:%02d"), year, month, day, hour, min, sec);
+ }
}
// Get the date part
for ( i=0; *p!='\0' && i<8 && isdigit( *p ); p++,i++ )
@@ -1174,7 +1189,7 @@ VOID CheckCurrentFeed(HANDLE hContact)
if (lstrcmpi(xi.getName(child), _T("updated")) == 0 && xi.getText(child))
{
TCHAR *lastupdtime = (TCHAR*)xi.getText(child);
- time_t stamp = DateToUnixTime(lastupdtime, 0);
+ time_t stamp = DateToUnixTime(lastupdtime, 1);
double deltaupd = difftime(time(NULL), stamp);
double deltacheck = difftime(time(NULL), DBGetContactSettingDword(hContact, MODULE, "LastCheck", 0));
if (deltaupd - deltacheck >= 0)