summaryrefslogtreecommitdiff
path: root/plugins/NewsAggregator
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NewsAggregator')
-rw-r--r--plugins/NewsAggregator/Src/CheckFeed.cpp8
-rw-r--r--plugins/NewsAggregator/Src/Common.h1
-rw-r--r--plugins/NewsAggregator/Src/Utils.cpp26
3 files changed, 4 insertions, 31 deletions
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp
index 36ef8165a1..b0286357ce 100644
--- a/plugins/NewsAggregator/Src/CheckFeed.cpp
+++ b/plugins/NewsAggregator/Src/CheckFeed.cpp
@@ -177,7 +177,7 @@ VOID CheckCurrentFeed(HANDLE hContact)
if (!db_get_ts(hContact, MODULE, "Nick", &dbVar)) {
TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
- pai.format = GetImageFormat(ext);
+ pai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = dbVar.ptszVal;
mir_sntprintf(pai.filename, SIZEOF(pai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
@@ -412,7 +412,7 @@ VOID CheckCurrentFeed(HANDLE hContact)
if (!db_get_ts(hContact, MODULE, "Nick", &dbVar)) {
TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
- pai.format = GetImageFormat(ext);
+ pai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = dbVar.ptszVal;
mir_sntprintf(pai.filename, SIZEOF(pai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
@@ -639,7 +639,7 @@ VOID CheckCurrentFeedAvatar(HANDLE hContact)
if (!db_get_ts(hContact, MODULE, "Nick", &dbVar)) {
TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
- pai.format = GetImageFormat(ext);
+ pai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = dbVar.ptszVal;
mir_sntprintf(pai.filename, SIZEOF(pai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
@@ -673,7 +673,7 @@ VOID CheckCurrentFeedAvatar(HANDLE hContact)
if (!db_get_ts(hContact, MODULE, "Nick", &dbVar)) {
TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
- pai.format = GetImageFormat(ext);
+ pai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = dbVar.ptszVal;
mir_sntprintf(pai.filename, SIZEOF(pai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
diff --git a/plugins/NewsAggregator/Src/Common.h b/plugins/NewsAggregator/Src/Common.h
index fa9117462d..ed19e6b132 100644
--- a/plugins/NewsAggregator/Src/Common.h
+++ b/plugins/NewsAggregator/Src/Common.h
@@ -131,7 +131,6 @@ TCHAR* CheckFeed(TCHAR* tszURL, HWND hwndDlg);
void UpdateMenu(BOOL State);
int ImportFeedsDialog();
VOID ClearText(TCHAR *&message);
-int GetImageFormat(const TCHAR *ext);
BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal);
int StrReplace(TCHAR *lpszOld, TCHAR *lpszNew, TCHAR *&lpszStr);
void CreateAuthString(char *auth, HANDLE hContact, HWND hwndDlg);
diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp
index 336d67993d..a47e6d261f 100644
--- a/plugins/NewsAggregator/Src/Utils.cpp
+++ b/plugins/NewsAggregator/Src/Utils.cpp
@@ -58,32 +58,6 @@ static void arrayToHex(BYTE *data, size_t datasz, char *res)
*resptr = '\0';
}
-int GetImageFormat(const TCHAR *ext)
-{
- if (!lstrcmp(ext, _T(".jpg")) || !lstrcmp(ext, _T(".jpeg")))
- return PA_FORMAT_JPEG;
-
- if (!lstrcmp(ext, _T(".png")))
- return PA_FORMAT_PNG;
-
- if (!lstrcmp(ext, _T(".gif")))
- return PA_FORMAT_GIF;
-
- if (!lstrcmp(ext, _T(".ico")))
- return PA_FORMAT_ICON;
-
- if (!lstrcmp(ext, _T(".bmp")))
- return PA_FORMAT_BMP;
-
- if (!lstrcmp(ext, _T(".swf")))
- return PA_FORMAT_SWF;
-
- if (!lstrcmp(ext, _T(".xml")))
- return PA_FORMAT_XML;
-
- return PA_FORMAT_UNKNOWN;
-}
-
VOID GetNewsData(TCHAR *tszUrl, char **szData, HANDLE hContact, HWND hwndDlg)
{
NETLIBHTTPREQUEST nlhr = {0};