diff options
author | Kirill Volinsky <KVolinsky@COMMON.EU.CORP.TOYOTA.com> | 2017-07-11 10:41:26 +0300 |
---|---|---|
committer | Kirill Volinsky <KVolinsky@COMMON.EU.CORP.TOYOTA.com> | 2017-07-11 10:41:26 +0300 |
commit | dd25f3bf3d7c8f1e21c10955cdeaae588c864bf9 (patch) | |
tree | 5706b0df82531b03c842e9421110774e8352d59e /plugins/NewsAggregator/Src | |
parent | 0f5d6891e9a94f592a799d83fdbc79cbe36b8734 (diff) |
NewsAggregator: fix for getting some channels
Diffstat (limited to 'plugins/NewsAggregator/Src')
-rw-r--r-- | plugins/NewsAggregator/Src/CheckFeed.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 14a7984c2c..2be3a3d965 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -36,7 +36,19 @@ LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg) LPCTSTR codepage = NULL;
int childcount = 0;
HXML node;
- if (!mir_wstrcmpi(xmlGetName(hXml), L"xml")) {
+ HXML tmpnode = xmlGetFirstChild(hXml);
+ if (!mir_wstrcmpi(xmlGetName(tmpnode), L"xml")) {
+ int attrcount = xmlGetAttrCount(tmpnode);
+ for (int i = 0; i < attrcount; i++) {
+ LPCTSTR szAttrName = xmlGetAttrName(tmpnode, i);
+ if (!mir_wstrcmpi(szAttrName, L"encoding")) {
+ codepage = xmlGetAttrValue(tmpnode, szAttrName);
+ break;
+ }
+ }
+ node = xmlGetChild(tmpnode, childcount);
+ }
+ else if (!mir_wstrcmpi(xmlGetName(hXml), L"xml")) {
int attrcount = xmlGetAttrCount(hXml);
for (int i = 0; i < attrcount; i++) {
LPCTSTR szAttrName = xmlGetAttrName(hXml, i);
@@ -205,7 +217,19 @@ void CheckCurrentFeed(MCONTACT hContact) LPCTSTR codepage = NULL;
int childcount = 0;
HXML node;
- if (!mir_wstrcmpi(xmlGetName(hXml), L"xml")) {
+ HXML tmpnode = xmlGetFirstChild(hXml);
+ if (!mir_wstrcmpi(xmlGetName(tmpnode), L"xml")) {
+ int attrcount = xmlGetAttrCount(tmpnode);
+ for (int i = 0; i < attrcount; i++) {
+ LPCTSTR szAttrName = xmlGetAttrName(tmpnode, i);
+ if (!mir_wstrcmpi(szAttrName, L"encoding")) {
+ codepage = xmlGetAttrValue(tmpnode, szAttrName);
+ break;
+ }
+ }
+ node = xmlGetChild(tmpnode, childcount);
+ }
+ else if (!mir_wstrcmpi(xmlGetName(hXml), L"xml")) {
int attrcount = xmlGetAttrCount(hXml);
for (int i = 0; i < attrcount; i++) {
LPCTSTR szAttrName = xmlGetAttrName(hXml, i);
|