diff options
author | George Hazan <ghazan@miranda.im> | 2017-05-29 23:45:19 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-05-29 23:45:19 +0300 |
commit | f63eb2bfc28dff8bbf9d56dd57b2bc6b53487f56 (patch) | |
tree | f2c2a56e945fc1ea44d5f22f95cd397a0d251fa2 /protocols/SkypeWeb/src/skype_avatars.cpp | |
parent | 133826f5022c5b0d9beca9285d66afcb604e2fc4 (diff) |
Skype:
- fixes #829;
- massive code cleaning
Diffstat (limited to 'protocols/SkypeWeb/src/skype_avatars.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_avatars.cpp | 30 |
1 files changed, 9 insertions, 21 deletions
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 <http://www.gnu.org/licenses/>. 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<BYTE> 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;
}
|