summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-04-09 22:59:19 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-04-09 22:59:19 +0000
commit6b09aaa679a7263da7ed4ba7954f537e5c339d77 (patch)
tree25045137d425e7698db772631f602158c5a5b61d /protocols
parent78e94eee9374480bfd01b82c02f40e26ab2d0468 (diff)
reverted r12717, r12718
git-svn-id: http://svn.miranda-ng.org/main/trunk@12721 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/SkypeWeb/src/skype_contacts.cpp26
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp9
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h3
3 files changed, 4 insertions, 34 deletions
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp
index e4a46cd0e3..c33e1c5dca 100644
--- a/protocols/SkypeWeb/src/skype_contacts.cpp
+++ b/protocols/SkypeWeb/src/skype_contacts.cpp
@@ -43,23 +43,11 @@ MCONTACT CSkypeProto::GetContactFromAuthEvent(MEVENT hEvent)
MCONTACT CSkypeProto::GetContact(const char *skypename)
{
- std::map<std::string, MCONTACT>::iterator it = contactMap.find(skypename);
- if (it != contactMap.end())
- return it->second;
-
MCONTACT hContact = NULL;
- if (contactMap.empty())
- MCONTACT hContact = db_find_first(m_szModuleName);
- else
- {
- hContact = db_find_next(lastMapContact, m_szModuleName);
- }
- for (; hContact; hContact = db_find_next(hContact, m_szModuleName))
+ for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
{
- std::string cSkypename = ptrA(getStringA(hContact, SKYPE_SETTINGS_ID));
- if (!contactMap.count(cSkypename))
- contactMap[cSkypename] = lastMapContact = hContact;
- if (mir_strcmpi(skypename, cSkypename.c_str()) == 0)
+ ptrA cSkypename(getStringA(hContact, SKYPE_SETTINGS_ID));
+ if (mir_strcmpi(skypename, cSkypename) == 0)
break;
}
return hContact;
@@ -68,13 +56,11 @@ MCONTACT CSkypeProto::GetContact(const char *skypename)
MCONTACT CSkypeProto::AddContact(const char *skypename, bool isTemporary)
{
MCONTACT hContact = GetContact(skypename);
- if (hContact == NULL)
+ if (!hContact)
{
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
- contactMap[skypename] = lastMapContact = hContact;
-
setString(hContact, SKYPE_SETTINGS_ID, skypename);
DBVARIANT dbv;
@@ -261,9 +247,5 @@ INT_PTR CSkypeProto::OnGrantAuth(WPARAM hContact, LPARAM)
int CSkypeProto::OnContactDeleted(MCONTACT hContact, LPARAM)
{
- /*ptrA skypename(getStringA(hContact, SKYPE_SETTINGS_ID));
- std::map<std::string, MCONTACT>::iterator it = contactMap.find((char*)skypename);
- if (it != contactMap.end())
- contactMap.erase(it);*/
return 0;
} \ No newline at end of file
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index 1a5f7e1f71..4e3111ab2c 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -35,15 +35,6 @@ PROTO<CSkypeProto>(protoName, userName), password(NULL)
dbEventType.eventType = SKYPE_DB_EVENT_TYPE_ACTION;
dbEventType.descr = Translate("Action");
CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
-
- // make contact map
- lastMapContact = NULL;
- for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
- {
- std::string cSkypename = ptrA(getStringA(hContact, SKYPE_SETTINGS_ID));
- if (!contactMap.count(cSkypename))
- contactMap[cSkypename] = lastMapContact = hContact;
- }
}
CSkypeProto::~CSkypeProto()
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index 005616acc4..dd468e4941 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -164,9 +164,6 @@ private:
void LoadProfile(const NETLIBHTTPREQUEST *response);
// contacts
- MCONTACT lastMapContact;
- std::map<std::string, MCONTACT> contactMap;
-
WORD GetContactStatus(MCONTACT hContact);
void SetContactStatus(MCONTACT hContact, WORD status);
void SetAllContactsStatus(WORD status);