From 23479c4e542e48ced40947777aa574e435153d34 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 28 Apr 2013 21:26:57 +0000 Subject: some fixes in avatar loading git-svn-id: http://svn.miranda-ng.org/main/trunk@4563 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_utils.cpp | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'protocols/Skype/src/skype_utils.cpp') diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp index 7201041afe..2bd14e00a5 100644 --- a/protocols/Skype/src/skype_utils.cpp +++ b/protocols/Skype/src/skype_utils.cpp @@ -505,27 +505,16 @@ CContact::AVAILABILITY CSkypeProto::MirandaToSkypeStatus(int status) return availability; } -SEBinary CSkypeProto::GetAvatarBinary(wchar_t *path) +bool CSkypeProto::FileExists(wchar_t *path) { - SEBinary avatar; - - if (::PathFileExists(path)) + //return ::GetFileAttributes(fileName) != DWORD(-1) + WIN32_FIND_DATA wfd; + HANDLE hFind = ::FindFirstFile(path, &wfd); + if (INVALID_HANDLE_VALUE != hFind) { - int len; - char *buffer; - FILE* fp = ::_wfopen(path, L"rb"); - if (fp) - { - ::fseek(fp, 0, SEEK_END); - len = ::ftell(fp); - ::fseek(fp, 0, SEEK_SET); - buffer = new char[len + 1]; - ::fread(buffer, len, 1, fp); - ::fclose(fp); - - avatar.set(buffer, len); - } + ::FindClose(hFind); + return true; } + return false; +} - return avatar; -} \ No newline at end of file -- cgit v1.2.3