From 20885736f969af9eb55f30c373dc465ecfb481ea Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 8 Nov 2014 21:43:09 +0000 Subject: - fix for the global avatar's redrawing; - more _taccess; - version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@10933 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AVS/src/utils.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'plugins/AVS/src/utils.cpp') diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index a59f46af50..d9a4c07229 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -144,11 +144,9 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) return -1; _tcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE); - if ((hFile = CreateFile(tszFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) + if (_taccess(tszFilename, 4) == -1) return -2; - CloseHandle(hFile); - BOOL isTransparentImage = 0; ace->hbmPic = BmpFilterLoadBitmap(&isTransparentImage, tszFilename); ace->dwFlags = 0; @@ -186,9 +184,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) } // Make transparent? - if (!noTransparency && !isTransparentImage - && db_get_b(hContact, "ContactPhoto", "MakeTransparentBkg", - db_get_b(0, AVS_MODULE, "MakeTransparentBkg", 0))) { + if (!noTransparency && !isTransparentImage && db_get_b(hContact, "ContactPhoto", "MakeTransparentBkg", db_get_b(0, AVS_MODULE, "MakeTransparentBkg", 0))) { if (MakeTransparentBkg(hContact, &ace->hbmPic)) { ace->dwFlags |= AVS_CUSTOMTRANSPBKG | AVS_HASTRANSPARENCY; GetObject(ace->hbmPic, sizeof(bminfo), &bminfo); @@ -197,9 +193,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) } } else if (hContact == INVALID_CONTACT_ID) { // My avatars - if (!noTransparency && !isTransparentImage - && db_get_b(0, AVS_MODULE, "MakeTransparentBkg", 0) - && db_get_b(0, AVS_MODULE, "MakeMyAvatarsTransparent", 0)) { + if (!noTransparency && !isTransparentImage && db_get_b(0, AVS_MODULE, "MakeTransparentBkg", 0) && db_get_b(0, AVS_MODULE, "MakeMyAvatarsTransparent", 0)) { if (MakeTransparentBkg(0, &ace->hbmPic)) { ace->dwFlags |= AVS_CUSTOMTRANSPBKG | AVS_HASTRANSPARENCY; GetObject(ace->hbmPic, sizeof(bminfo), &bminfo); @@ -268,7 +262,7 @@ int GetFileHash(TCHAR* filename) } } } - while (dwRead == 1024); + while (dwRead == 1024); CloseHandle(hFile); -- cgit v1.2.3