summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Skype/src/skype_utils.cpp')
-rw-r--r--protocols/Skype/src/skype_utils.cpp29
1 files changed, 9 insertions, 20 deletions
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