summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r--protocols/SkypeWeb/src/http_request.h2
-rw-r--r--protocols/SkypeWeb/src/skype_avatars.cpp14
2 files changed, 5 insertions, 11 deletions
diff --git a/protocols/SkypeWeb/src/http_request.h b/protocols/SkypeWeb/src/http_request.h
index a730aa7fd6..80f301908f 100644
--- a/protocols/SkypeWeb/src/http_request.h
+++ b/protocols/SkypeWeb/src/http_request.h
@@ -268,7 +268,7 @@ public:
NETLIBHTTPREQUEST * Send(HANDLE hConnection)
{
if (url.Find("://") == -1)
- url.Insert(0, flags & NLHRF_SSL ? "https://" : "http://");
+ url.Insert(0, ((flags & NLHRF_SSL) ? "https://" : "http://"));
szUrl = url.GetBuffer();
if (!pData) {
diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp
index 254f64c757..7410ad7ab7 100644
--- a/protocols/SkypeWeb/src/skype_avatars.cpp
+++ b/protocols/SkypeWeb/src/skype_avatars.cpp
@@ -39,7 +39,6 @@ INT_PTR CSkypeProto::SvcGetAvatarCaps(WPARAM wParam, LPARAM lParam)
case AF_FETCHIFCONTACTOFFLINE:
return 1;
}
-
return 0;
}
@@ -194,21 +193,16 @@ INT_PTR CSkypeProto::SvcSetMyAvatar(WPARAM, LPARAM lParam)
}
rewind(hFile);
- char *data = (char*)mir_alloc(length);
- if (fread(data, sizeof(char), length, hFile) != length)
+ ptrA data((char*)mir_alloc(length));
+
+ if (data == NULL || fread(data, sizeof(char), length, hFile) != length)
{
debugLogA("CSkypeProto::SvcSetMyAvatar: failed to read avatar file");
- mir_free(data);
fclose(hFile);
return -1;
}
fclose(hFile);
-
- ptrA token(getStringA("TokenSecret"));
- ptrA skypename(getStringA(SKYPE_SETTINGS_ID));
- PushRequest(new SetAvatarRequest(token, skypename, data, length), &CSkypeProto::OnSentAvatar);
-
- mir_free(data);
+ PushRequest(new SetAvatarRequest(m_szTokenSecret, m_szSelfSkypeName, data, length), &CSkypeProto::OnSentAvatar);
}
else
{