diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-04-25 16:04:06 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-04-25 16:04:06 +0000 |
commit | 3bf8dd214686baa698ec98c16d49f320d6f4eee8 (patch) | |
tree | d3786a64c6929919225ed2086deb8e59008f6a8f /protocols/SkypeWeb/src/skype_contacts.cpp | |
parent | ab53e157ddc1eddbfa072d43d62d244443f41815 (diff) |
SkypeWeb: database optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@16765 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_contacts.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_contacts.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index d88603cb6c..174cc0e7fd 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -77,7 +77,7 @@ MCONTACT CSkypeProto::FindContact(const char *skypename) MCONTACT hContact = NULL;
for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
{
- if (!mir_strcmpi(skypename, CID(this, hContact)))
+ if (!mir_strcmpi(skypename, Contacts[hContact]))
break;
}
return hContact;
@@ -299,8 +299,7 @@ INT_PTR CSkypeProto::OnRequestAuth(WPARAM hContact, LPARAM) if (hContact == INVALID_CONTACT_ID)
return 1;
- ptrA skypename(getStringA(hContact, SKYPE_SETTINGS_ID));
- PushRequest(new AddContactRequest(li, skypename));
+ PushRequest(new AddContactRequest(li, Contacts[hContact]));
return 0;
}
@@ -309,8 +308,7 @@ INT_PTR CSkypeProto::OnGrantAuth(WPARAM hContact, LPARAM) if (hContact == INVALID_CONTACT_ID)
return 1;
- ptrA skypename(getStringA(hContact, SKYPE_SETTINGS_ID));
- PushRequest(new AuthAcceptRequest(li, skypename));
+ PushRequest(new AuthAcceptRequest(li, Contacts[hContact]));
return 0;
}
@@ -319,7 +317,7 @@ int CSkypeProto::OnContactDeleted(MCONTACT hContact, LPARAM) if (!IsOnline()) return 1;
if (hContact && !isChatRoom(hContact))
- PushRequest(new DeleteContactRequest(li, ptrA(db_get_sa(hContact, m_szModuleName, SKYPE_SETTINGS_ID))));
+ PushRequest(new DeleteContactRequest(li, Contacts[hContact]));
return 0;
}
@@ -328,7 +326,7 @@ INT_PTR CSkypeProto::BlockContact(WPARAM hContact, LPARAM) if (!IsOnline()) return 1;
if (IDYES == MessageBox(NULL, TranslateT("Are you sure?"), TranslateT("Warning"), MB_YESNO | MB_ICONQUESTION))
- SendRequest(new BlockContactRequest(li, ptrA(db_get_sa(hContact, m_szModuleName, SKYPE_SETTINGS_ID))), &CSkypeProto::OnBlockContact, (void *)hContact);
+ SendRequest(new BlockContactRequest(li, Contacts[hContact]), &CSkypeProto::OnBlockContact, (void *)hContact);
return 0;
}
@@ -343,7 +341,7 @@ void CSkypeProto::OnBlockContact(const NETLIBHTTPREQUEST *response, void *p) INT_PTR CSkypeProto::UnblockContact(WPARAM hContact, LPARAM)
{
- SendRequest(new UnblockContactRequest(li, ptrA(db_get_sa(hContact, m_szModuleName, SKYPE_SETTINGS_ID))), &CSkypeProto::OnUnblockContact, (void *)hContact);
+ SendRequest(new UnblockContactRequest(li, Contacts[hContact]), &CSkypeProto::OnUnblockContact, (void *)hContact);
return 0;
}
|