summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-03-24 19:44:39 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-03-24 19:44:39 +0300
commitb682217c769d54b073b5052c9e458dbd81722274 (patch)
tree0b93c5cd960db03c6a60cfbc0eca7dcae1b545b9 /protocols
parentf352e7958b6a97887da1db0aa75092fc4772cb23 (diff)
fixes #2800 (ICQ & Facebook create duplicate contacts after import in the service mode)
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Facebook/src/proto.cpp13
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp4
2 files changed, 9 insertions, 8 deletions
diff --git a/protocols/Facebook/src/proto.cpp b/protocols/Facebook/src/proto.cpp
index bfb6f9e71a..2873b2d8d3 100644
--- a/protocols/Facebook/src/proto.cpp
+++ b/protocols/Facebook/src/proto.cpp
@@ -49,12 +49,6 @@ FacebookProto::FacebookProto(const char *proto_name, const wchar_t *username) :
m_bLoginInvisible(this, "LoginInvisible", false),
m_wszDefaultGroup(this, "DefaultGroup", L"Facebook")
{
- for (auto &cc : AccContacts()) {
- CMStringA szId(getMStringA(cc, DBKEY_ID));
- if (!szId.IsEmpty())
- m_users.insert(new FacebookUser(_atoi64(szId), cc, isChatRoom(cc)));
- }
-
// to upgrade previous settings
if (getByte("Compatibility") < 1) {
setByte("Compatibility", 1);
@@ -140,6 +134,13 @@ void FacebookProto::OnModulesLoaded()
cont.path = wszPath;
CallService(MS_SMILEYADD_LOADCONTACTSMILEYS, 0, LPARAM(&cont));
+ // contacts cache
+ for (auto &cc : AccContacts()) {
+ CMStringA szId(getMStringA(cc, DBKEY_ID));
+ if (!szId.IsEmpty())
+ m_users.insert(new FacebookUser(_atoi64(szId), cc, isChatRoom(cc)));
+ }
+
// Default group
Clist_GroupCreate(0, m_wszDefaultGroup);
}
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index 558bbe2ce1..87a33e0502 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -114,8 +114,6 @@ CIcqProto::CIcqProto(const char *aProtoName, const wchar_t *aUserName) :
}
}
- InitContactCache();
-
m_hWorkerThread = ForkThreadEx(&CIcqProto::ServerThread, nullptr, nullptr);
}
@@ -129,6 +127,8 @@ CIcqProto::~CIcqProto()
void CIcqProto::OnModulesLoaded()
{
+ InitContactCache();
+
HookProtoEvent(ME_USERINFO_INITIALISE, &CIcqProto::OnUserInfoInit);
// load custom smilies