summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_srv.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-04 07:55:00 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-04 07:55:00 +0000
commit8751885ea79df4b666b65bb2b6900617785e0da7 (patch)
tree676db28129ece760d7ad354b2d39ba371453db8c /protocols/MSN/src/msn_srv.cpp
parent09476981eccbcae37ef4526f3fbcb18fca686ffa (diff)
end of base64* zoo
git-svn-id: http://svn.miranda-ng.org/main/trunk@4879 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_srv.cpp')
-rw-r--r--protocols/MSN/src/msn_srv.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/protocols/MSN/src/msn_srv.cpp b/protocols/MSN/src/msn_srv.cpp
index cbff0068a8..55d46c4c80 100644
--- a/protocols/MSN/src/msn_srv.cpp
+++ b/protocols/MSN/src/msn_srv.cpp
@@ -341,33 +341,23 @@ void CMsnProto::MSN_SetNicknameUtf(const char* nickname)
void CMsnProto::msn_storeAvatarThread(void* arg)
{
StoreAvatarData* dat = (StoreAvatarData*)arg;
- char *szEncBuf = NULL;
+ ptrA szEncBuf;
if (dat)
- {
- size_t szEncPngSize = Netlib_GetBase64EncodedBufferSize(dat->dataSize);
- szEncBuf = (char*)mir_alloc(szEncPngSize);
- NETLIBBASE64 nlb = { szEncBuf, (int)szEncPngSize, dat->data, (int)dat->dataSize };
- CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
- }
+ szEncBuf = mir_base64_encode(dat->data, (unsigned)dat->dataSize);
if (photoid[0] && dat)
- {
MSN_StoreUpdateDocument(dat->szName, dat->szMimeType, szEncBuf);
- }
- else
- {
+ else {
MSN_StoreUpdateProfile(NULL, NULL, 1);
- if (photoid[0])
- {
+ if (photoid[0]) {
MSN_StoreDeleteRelationships(true);
MSN_StoreDeleteRelationships(false);
photoid[0] = 0;
}
- if (dat)
- {
+ if (dat) {
MSN_StoreCreateDocument(dat->szName, dat->szMimeType, szEncBuf);
MSN_StoreCreateRelationships();
}
@@ -379,7 +369,6 @@ void CMsnProto::msn_storeAvatarThread(void* arg)
if (dat)
{
- mir_free(szEncBuf);
mir_free(dat->szName);
mir_free(dat->data);
mir_free(dat);