summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_contacts.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2012-10-25 16:23:47 +0000
committerAlexander Lantsev <aunsane@gmail.com>2012-10-25 16:23:47 +0000
commitb2e29d4d5ad48ccfd9071f96eb84572145a1fce1 (patch)
treeee52ad84529c5aa6e9d47e25b0f59d40fdd842ae /protocols/Skype/src/skype_contacts.cpp
parent8df1a93786fdae3a67cd64b1eaff09821ce7f84f (diff)
- fixed auth menus
git-svn-id: http://svn.miranda-ng.org/main/trunk@2069 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_contacts.cpp')
-rw-r--r--protocols/Skype/src/skype_contacts.cpp72
1 files changed, 11 insertions, 61 deletions
diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp
index e1d21ef8f8..60d062f9cd 100644
--- a/protocols/Skype/src/skype_contacts.cpp
+++ b/protocols/Skype/src/skype_contacts.cpp
@@ -19,14 +19,19 @@ void CSkypeProto::UpdateContactAuthState(HANDLE hContact, CContact::Ref contact)
DWORD oldTS = this->GetSettingDword(hContact, "AuthTS");
if (newTS > oldTS)
{
- CContact::AVAILABILITY data;
- contact->GetPropAvailability(data);
- this->SetSettingWord(hContact, SKYPE_SETTINGS_STATUS, this->SkypeToMirandaStatus(data));
-
- if (data == CContact::PENDINGAUTH)
- this->SetSettingWord(hContact, "Auth", 1);
+ bool result;
+ if (contact->HasAuthorizedMe(result) && !result)
+ {
+ this->SetSettingByte(hContact, "Auth", !result);
+ }
else
+ {
this->DeleteSetting(hContact, "Auth");
+ if (contact->IsMemberOfHardwiredGroup(CContactGroup::ALL_BUDDIES, result) && !result)
+ this->SetSettingByte(hContact, "Grant", !result);
+ else
+ this->DeleteSetting(hContact, "Grant");
+ }
this->SetSettingDword(hContact, "AuthTS", newTS);
}
@@ -681,47 +686,6 @@ void CSkypeProto::OnContactChanged(CContact::Ref contact, int prop)
break;
}
}
- else
- {
- }
- //else
- //{
- // switch(prop)
- // {
- // case CContact::P_RECEIVED_AUTHREQUEST:
- // contact->GetPropDisplayname(data);
- // wchar_t* displayName = ::mir_a2u((const char*)data);
-
- // CCSDATA ccs = {0};
- // ccs.szProtoService = PSR_AUTH;
- // ccs.hContact = this->AddContactBySkypeName(skypeName, displayName, PALF_TEMPORARY);
- // //pre.szMessage = (LPSTR)btBuff;
- // //CreateBlobFromContact(ccs.hContact, lpwszMessage, dwMessageSize, btBuff, SIZEOF(btBuff), (size_t*)&pre.lParam);
- // CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
- // break;
- // }
- //}
-
- //if (prop == CContact::P_AVAILABILITY)
- //{
- // SEString data;
-
- // contact->GetPropSkypename(data);
- // wchar_t* skypeName = ::mir_a2u((const char*)data);
-
- // HANDLE hContact = this->GetContactBySkypeName(skypeName);
- // if (hContact)
- // {
- // CContact::AVAILABILITY availability;
- // contact->GetPropAvailability(availability);
- // this->SetSettingWord(hContact, SKYPE_SETTINGS_STATUS, this->SkypeToMirandaStatus(availability));
-
- // if (availability == CContact::PENDINGAUTH)
- // this->SetSettingWord(hContact, "Auth", 1);
- // else
- // this->DeleteSetting(hContact, "Auth");
- // }
- //}
}
void CSkypeProto::OnContactListChanged(const ContactRef& contact)
@@ -867,20 +831,6 @@ int CSkypeProto::SkypeToMirandaStatus(CContact::AVAILABILITY availability)
return status;
}
-void CSkypeProto::RemoveContact(HANDLE hContact)
-{
- if (this->IsOnline() && hContact)
- {
- CContact::Ref contact;
- SEString sid(::mir_u2a(this->GetSettingString(hContact, "sid")));
- if (g_skype->GetContact(sid, contact))
- {
- contact->SetBuddyStatus(false);
- this->contactList.remove_val(contact);
- }
- }
-}
-
CContact::AVAILABILITY CSkypeProto::MirandaToSkypeStatus(int status)
{
CContact::AVAILABILITY availability = CContact::UNKNOWN;