summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_profile.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2012-10-28 19:35:19 +0000
committerAlexander Lantsev <aunsane@gmail.com>2012-10-28 19:35:19 +0000
commit25fb34c76a42858dc732250b769bb08324d3a996 (patch)
tree8709277b454f1c115f0101036d0653629d5afe48 /protocols/Skype/src/skype_profile.cpp
parentfbfdab9ebf0df810b548e502d93fa3be260acf61 (diff)
- fixed some issues in own info loading
- fixed avatar services git-svn-id: http://svn.miranda-ng.org/main/trunk@2105 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_profile.cpp')
-rw-r--r--protocols/Skype/src/skype_profile.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/protocols/Skype/src/skype_profile.cpp b/protocols/Skype/src/skype_profile.cpp
index 884a145358..a0e72d1f37 100644
--- a/protocols/Skype/src/skype_profile.cpp
+++ b/protocols/Skype/src/skype_profile.cpp
@@ -8,11 +8,28 @@ void CSkypeProto::UpdateOwnAvatar()
if (newTS > oldTS)
{
SEBinary data;
- //this->account->GetPropAvatarImage(data);
+ this->account->GetPropAvatarImage(data);
- //if (data.size() > 0)
+ if (data.size() > 0)
{
- // todo: add own avatar loading'n'registration
+ wchar_t *path = this->GetContactAvatarFilePath(this->GetSettingString("sid"));
+ FILE* fp = _wfopen(path, L"wb");
+ if (fp)
+ {
+ fwrite(data.data(), sizeof(char), data.size(), fp);
+ fclose(fp);
+
+ this->SetSettingDword("AvatarTS", newTS);
+
+ PROTO_AVATAR_INFORMATIONW pai = {0};
+ pai.cbSize = sizeof(pai);
+ pai.format = PA_FORMAT_JPEG;
+ pai.hContact = NULL;
+ wcscpy(pai.filename, path);
+
+ this->SendBroadcast(ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&pai, 0);
+ }
+ delete path;
}
}
}
@@ -22,9 +39,9 @@ void CSkypeProto::UpdateOwnBirthday()
uint data;
this->account->GetPropBirthday(data);
TCHAR date[9];
- _itot_s(data, date, 10);
if (data > 0)
{
+ _itot_s(data, date, 10);
INT day, month, year;
_stscanf(date, _T("%04d%02d%02d"), &year, &month, &day);
this->SetSettingByte("BirthDay", day);