From af5c37f6ef2b6b9b187226f1fbd5c01dca9b6586 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Fri, 19 Jul 2013 19:37:19 +0000 Subject: use the first link attribute instead of the last one (fixes #421) git-svn-id: http://svn.miranda-ng.org/main/trunk@5423 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/CheckFeed.cpp | 36 +++++++++++++------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'plugins/NewsAggregator/Src/CheckFeed.cpp') diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 9db5cd84da..4d73c75834 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -213,57 +213,51 @@ VOID CheckCurrentFeed(HANDLE hContact) ClearText(string); title = mir_tstrdup(string); mir_free(string); - continue; } - if (!lstrcmpi(xi.getName(itemval), _T("link"))) { - TCHAR *string = mir_tstrdup(xi.getText(itemval)); - ClearText(string); - link = mir_tstrdup(string); - mir_free(string); - continue; + else if (!lstrcmpi(xi.getName(itemval), _T("link"))) { + // We only use the first tag for now and ignore the rest. + if (link == NULL) { + TCHAR *string = mir_tstrdup(xi.getText(itemval)); + ClearText(string); + link = mir_tstrdup(string); + mir_free(string); + } } - if (!lstrcmpi(xi.getName(itemval), _T("pubDate"))) { + else if (!lstrcmpi(xi.getName(itemval), _T("pubDate"))) { datetime = (TCHAR *)xi.getText(itemval); - continue; } - if (!lstrcmpi(xi.getName(itemval), _T("dc:date"))) { + else if (!lstrcmpi(xi.getName(itemval), _T("dc:date"))) { datetime = (TCHAR *)xi.getText(itemval); - continue; } - if (!lstrcmpi(xi.getName(itemval), _T("description"))) { + else if (!lstrcmpi(xi.getName(itemval), _T("description"))) { TCHAR *string = mir_tstrdup(xi.getText(itemval)); ClearText(string); descr = mir_tstrdup(string); mir_free(string); - continue; } - if (!lstrcmpi(xi.getName(itemval), _T("author"))) { + else if (!lstrcmpi(xi.getName(itemval), _T("author"))) { TCHAR *string = mir_tstrdup(xi.getText(itemval)); ClearText(string); author = mir_tstrdup(string); mir_free(string); - continue; } - if (!lstrcmpi(xi.getName(itemval), _T("comments"))) { + else if (!lstrcmpi(xi.getName(itemval), _T("comments"))) { TCHAR *string = mir_tstrdup(xi.getText(itemval)); ClearText(string); comments = mir_tstrdup(string); mir_free(string); - continue; } - if (!lstrcmpi(xi.getName(itemval), _T("guid"))) { + else if (!lstrcmpi(xi.getName(itemval), _T("guid"))) { TCHAR *string = mir_tstrdup(xi.getText(itemval)); ClearText(string); guid = mir_tstrdup(string); mir_free(string); - continue; } - if (!lstrcmpi(xi.getName(itemval), _T("category"))) { + else if (!lstrcmpi(xi.getName(itemval), _T("category"))) { TCHAR *string = mir_tstrdup(xi.getText(itemval)); ClearText(string); category = mir_tstrdup(string); mir_free(string); - continue; } } TCHAR *message; -- cgit v1.2.3