From b42fea7761d968e814382fde9748e68d83d587e7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 17 Aug 2020 16:07:26 +0300 Subject: SmileyAdd: unused function removed --- plugins/SmileyAdd/src/download.cpp | 2 +- plugins/SmileyAdd/src/general.cpp | 24 ------------------------ plugins/SmileyAdd/src/stdafx.h | 1 - 3 files changed, 1 insertion(+), 26 deletions(-) (limited to 'plugins/SmileyAdd/src') diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index e66b5ec069..1f62182890 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -132,7 +132,7 @@ void __cdecl SmileyDownloadThread(void*) CMStringW fname(dlQueue[0].fname); if (dlQueue[0].needext) { - fname += GetImageExt(fname); + fname += ProtoGetAvatarExtension(ProtoGetAvatarFileFormat(fname)); needext = true; } _wrename(dlQueue[0].fname.c_str(), fname.c_str()); diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp index 9374f5e969..ce6513d5ec 100644 --- a/plugins/SmileyAdd/src/general.cpp +++ b/plugins/SmileyAdd/src/general.cpp @@ -59,30 +59,6 @@ HICON GetDefaultIcon(bool copy) return resIco; } -const wchar_t* GetImageExt(CMStringW &fname) -{ - const wchar_t *ext = L""; - - int fileId = _wopen(fname.c_str(), O_RDONLY | _O_BINARY); - if (fileId != -1) { - BYTE buf[6]; - - int bytes = _read(fileId, buf, sizeof(buf)); - if (bytes > 4) { - if (*(unsigned short*)buf == 0xd8ff) - ext = L"jpg"; - else if (*(unsigned short*)buf == 0x4d42) - ext = L"bmp"; - else if (*(unsigned*)buf == 0x474e5089) - ext = L"png"; - else if (*(unsigned*)buf == 0x38464947) - ext = L"gif"; - } - _close(fileId); - } - return ext; -} - HICON ImageList_GetIconFixed(HIMAGELIST himl, INT i, UINT fStyle) { ICONINFO ii; diff --git a/plugins/SmileyAdd/src/stdafx.h b/plugins/SmileyAdd/src/stdafx.h index c4d2a90015..7de275f731 100644 --- a/plugins/SmileyAdd/src/stdafx.h +++ b/plugins/SmileyAdd/src/stdafx.h @@ -124,7 +124,6 @@ int SmileyButtonPressed(WPARAM, LPARAM); // functions for general use (defined in general.cpp) int CalculateTextHeight(HDC hdc, CHARFORMAT2 *chf); -const wchar_t* GetImageExt(CMStringW &fname); MCONTACT DecodeMetaContact(MCONTACT hContact); bool IsSmileyProto(char *proto); -- cgit v1.2.3