From f63eb2bfc28dff8bbf9d56dd57b2bc6b53487f56 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 29 May 2017 23:45:19 +0300 Subject: Skype: - fixes #829; - massive code cleaning --- protocols/SkypeWeb/src/skype_avatars.cpp | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_avatars.cpp') diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp index 02129aa9cc..92f536de6b 100644 --- a/protocols/SkypeWeb/src/skype_avatars.cpp +++ b/protocols/SkypeWeb/src/skype_avatars.cpp @@ -19,8 +19,7 @@ along with this program. If not, see . INT_PTR CSkypeProto::SvcGetAvatarCaps(WPARAM wParam, LPARAM lParam) { - switch (wParam) - { + switch (wParam) { case AF_MAXSIZE: ((POINT*)lParam)->x = 98; ((POINT*)lParam)->y = 98; @@ -44,8 +43,7 @@ INT_PTR CSkypeProto::SvcGetAvatarCaps(WPARAM wParam, LPARAM lParam) void CSkypeProto::ReloadAvatarInfo(MCONTACT hContact) { - if (hContact == NULL) - { + if (hContact == NULL) { CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName, 0); return; } @@ -169,23 +167,18 @@ INT_PTR CSkypeProto::SvcSetMyAvatar(WPARAM, LPARAM lParam) wchar_t *path = (wchar_t*)lParam; wchar_t avatarPath[MAX_PATH]; GetAvatarFileName(NULL, avatarPath, _countof(avatarPath)); - if (path != NULL) - { - if (CopyFile(path, avatarPath, FALSE)) - { + if (path != NULL) { + if (CopyFile(path, avatarPath, FALSE)) { FILE *hFile = _wfopen(path, L"rb"); - if (hFile) - { + if (hFile) { fseek(hFile, 0, SEEK_END); size_t length = ftell(hFile); - if (length != -1) - { + if (length != -1) { rewind(hFile); mir_ptr data((PBYTE)mir_alloc(length)); - if (data != NULL && fread(data, sizeof(BYTE), length, hFile) == length) - { + if (data != NULL && fread(data, sizeof(BYTE), length, hFile) == length) { const char *szMime = "image/jpeg"; if (fii) szMime = fii->FI_GetFIFMimeType(fii->FI_GetFIFFromFilenameU(path)); @@ -200,13 +193,8 @@ INT_PTR CSkypeProto::SvcSetMyAvatar(WPARAM, LPARAM lParam) } return -1; } - else - { - if (IsFileExists(avatarPath)) - { - DeleteFile(avatarPath); - } - } + else if (IsFileExists(avatarPath)) + DeleteFile(avatarPath); return 0; } -- cgit v1.2.3