summaryrefslogtreecommitdiff
path: root/protocols/Facebook/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-04-30 17:52:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-04-30 17:52:29 +0300
commit9f00802dfbad293235fc44536069c64b236fdc50 (patch)
treed6d337bdc9334c5516e30f83d5edf9f742be2f35 /protocols/Facebook/src/proto.cpp
parent84f2722e07a23656bdc8d1a7f4040e86450fe91d (diff)
fixes #2859 (Импорт: дублируются контакты ICQ и FaceBook)
Diffstat (limited to 'protocols/Facebook/src/proto.cpp')
-rw-r--r--protocols/Facebook/src/proto.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/protocols/Facebook/src/proto.cpp b/protocols/Facebook/src/proto.cpp
index 2873b2d8d3..3b9eb5101b 100644
--- a/protocols/Facebook/src/proto.cpp
+++ b/protocols/Facebook/src/proto.cpp
@@ -122,6 +122,18 @@ FacebookProto::~FacebookProto()
{
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// protocol events
+
+void FacebookProto::OnContactAdded(MCONTACT hContact)
+{
+ __int64 userId = _atoi64(getMStringA(hContact, DBKEY_ID));
+ if (userId && !FindUser(userId)) {
+ mir_cslock lck(m_csUsers);
+ m_users.insert(new FacebookUser(userId, hContact));
+ }
+}
+
void FacebookProto::OnModulesLoaded()
{
VARSW wszCache(L"%miranda_avatarcache%");
@@ -162,8 +174,8 @@ MCONTACT FacebookProto::AddToList(int, PROTOSEARCHRESULT *psr)
return pUser->hContact;
MCONTACT hContact = db_add_contact();
- Proto_AddToContact(hContact, m_szModuleName);
setWString(hContact, DBKEY_ID, psr->id.w);
+ Proto_AddToContact(hContact, m_szModuleName);
return hContact;
}