summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-11-25 11:08:37 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-11-25 11:08:37 +0000
commite027d86c08e0b00e33152f2541bf58875bad8a51 (patch)
treed4bd547afe1dfe66b7ec44f0e1db60b9ffa6f260 /protocols
parent22c73a4ca5c842cc18ca9b45aa4b883d59d84012 (diff)
fixed getting of own avatar
git-svn-id: http://svn.miranda-ng.org/main/trunk@2475 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Skype/src/skype.cpp2
-rw-r--r--protocols/Skype/src/skype_profile.cpp42
-rw-r--r--protocols/Skype/src/skype_services.cpp1
3 files changed, 21 insertions, 24 deletions
diff --git a/protocols/Skype/src/skype.cpp b/protocols/Skype/src/skype.cpp
index 915a178276..7c19a055aa 100644
--- a/protocols/Skype/src/skype.cpp
+++ b/protocols/Skype/src/skype.cpp
@@ -333,7 +333,7 @@ int StartSkypeRuntime()
}
CloseHandle(snapshot);
- mir_sntprintf(param, SIZEOF(param), L"-p -m -f nodb -p %d", port);
+ mir_sntprintf(param, SIZEOF(param), L"-p -P %d", port);
int startingrt = CreateProcess(szFilename, param, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &cif, &pi);
return startingrt;
diff --git a/protocols/Skype/src/skype_profile.cpp b/protocols/Skype/src/skype_profile.cpp
index a5854ab9ff..eede0e216e 100644
--- a/protocols/Skype/src/skype_profile.cpp
+++ b/protocols/Skype/src/skype_profile.cpp
@@ -2,36 +2,32 @@
void CSkypeProto::UpdateOwnAvatar()
{
- /*uint newTS = 0;
+ uint newTS = 0;
this->account->GetPropAvatarTimestamp(newTS);
DWORD oldTS = this->GetSettingDword("AvatarTS");
- if (newTS > oldTS)
+ wchar_t *path = this->GetContactAvatarFilePath(NULL);
+ SEBinary data;
+ this->account->GetPropAvatarImage(data);
+ if ((newTS > oldTS) || (!newTS && data.size() > 0 && _waccess(path, 0) == -1) || (newTS && _waccess(path, 0) == -1)) //hack for avatars without timestamp
{
- SEBinary data;
- this->account->GetPropAvatarImage(data);
-
- if (data.size() > 0)
+ FILE* fp = _wfopen(path, L"wb");
+ if (fp)
{
- wchar_t *path = this->GetContactAvatarFilePath(NULL);
- FILE* fp = _wfopen(path, L"wb");
- if (fp)
- {
- fwrite(data.data(), sizeof(char), data.size(), fp);
- fclose(fp);
+ fwrite(data.data(), sizeof(char), data.size(), fp);
+ fclose(fp);
- this->SetSettingDword("AvatarTS", newTS);
+ 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);
+ 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;
- }
- }*/
+ this->SendBroadcast(ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&pai, 0);
+ }
+ delete path;
+ }
}
void CSkypeProto::UpdateOwnBirthday()
diff --git a/protocols/Skype/src/skype_services.cpp b/protocols/Skype/src/skype_services.cpp
index 09aa2f29f2..591a1d862b 100644
--- a/protocols/Skype/src/skype_services.cpp
+++ b/protocols/Skype/src/skype_services.cpp
@@ -113,6 +113,7 @@ int __cdecl CSkypeProto::SetMyAvatar(WPARAM, LPARAM lParam)
this->Log("Failed to copy our avatar to local storage.");
return iRet;
}
+ //this->account->SetBinProperty(Account::P_AVATAR_IMAGE, avt);
// todo: add avatar loading to skype server