diff options
author | George Hazan <ghazan@miranda.im> | 2021-04-30 17:52:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-04-30 17:52:29 +0300 |
commit | 9f00802dfbad293235fc44536069c64b236fdc50 (patch) | |
tree | d6d337bdc9334c5516e30f83d5edf9f742be2f35 /src | |
parent | 84f2722e07a23656bdc8d1a7f4040e86450fe91d (diff) |
fixes #2859 (Импорт: дублируются контакты ICQ и FaceBook)
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/proto_accs.cpp | 28 | ||||
-rw-r--r-- | src/mir_app/src/proto_chains.cpp | 3 | ||||
-rw-r--r-- | src/mir_app/src/proto_interface.cpp | 3 |
5 files changed, 24 insertions, 12 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 053f1e6d95..c7b62601aa 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -779,3 +779,4 @@ _Netlib_GetTlsUnique@8 @831 NONAME Chat_Mute @868
_WebSocket_SendBinary@12 @869 NONAME
_WebSocket_SendText@8 @870 NONAME
+?OnContactAdded@PROTO_INTERFACE@@UAEXI@Z @871 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index c33b8ede03..3885bb7d91 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -779,3 +779,4 @@ Netlib_GetTlsUnique @831 NONAME Chat_Mute @868
WebSocket_SendBinary @869 NONAME
WebSocket_SendText @870 NONAME
+?OnContactAdded@PROTO_INTERFACE@@UEAAXI@Z @871 NONAME
diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp index 4e2be22d74..dfbd4a0f2f 100644 --- a/src/mir_app/src/proto_accs.cpp +++ b/src/mir_app/src/proto_accs.cpp @@ -248,22 +248,26 @@ bool ActivateAccount(PROTOACCOUNT *pa, bool bIsDynamic) if (ppd->fnInit == nullptr) return false; - PROTO_INTERFACE *ppi = ppd->fnInit(pa->szModuleName, pa->tszAccountName); - if (ppi == nullptr) - return false; + PROTO_INTERFACE *ppi = pa->ppro; + if (ppi == nullptr) { + ppi = ppd->fnInit(pa->szModuleName, pa->tszAccountName); + if (ppi == nullptr) + return false; + + pa->ppro = ppi; + + if (bIsDynamic) { + if (g_bModulesLoadedFired) + pa->ppro->OnModulesLoaded(); + if (!db_get_b(0, "CList", "MoveProtoMenus", true)) + pa->ppro->OnBuildProtoMenu(); + pa->bDynDisabled = false; + } + } - pa->ppro = ppi; if (ppi->m_hProtoIcon == nullptr) ppi->m_hProtoIcon = IcoLib_IsManaged(Skin_LoadProtoIcon(pa->szModuleName, ID_STATUS_ONLINE)); ppi->m_iDesiredStatus = ppi->m_iStatus = ID_STATUS_OFFLINE; - - if (bIsDynamic) { - if (g_bModulesLoadedFired) - pa->ppro->OnModulesLoaded(); - if (!db_get_b(0, "CList", "MoveProtoMenus", true)) - pa->ppro->OnBuildProtoMenu(); - pa->bDynDisabled = false; - } return true; } diff --git a/src/mir_app/src/proto_chains.cpp b/src/mir_app/src/proto_chains.cpp index a2ad4b65b5..c66d4e1230 100644 --- a/src/mir_app/src/proto_chains.cpp +++ b/src/mir_app/src/proto_chains.cpp @@ -176,6 +176,9 @@ MIR_APP_DLL(int) Proto_AddToContact(MCONTACT hContact, const char *szProto) PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa) {
db_set_s(hContact, "Protocol", "p", szProto);
+
+ if (pa->ppro)
+ pa->ppro->OnContactAdded(hContact);
return 0;
}
return 1;
diff --git a/src/mir_app/src/proto_interface.cpp b/src/mir_app/src/proto_interface.cpp index 43ec3b3112..52bf10eea2 100644 --- a/src/mir_app/src/proto_interface.cpp +++ b/src/mir_app/src/proto_interface.cpp @@ -63,6 +63,9 @@ HGENMENU PROTO_INTERFACE::GetMenuItem(ProtoMenuItemType aType) void PROTO_INTERFACE::OnBuildProtoMenu() {} +void PROTO_INTERFACE::OnContactAdded(MCONTACT) +{} + void PROTO_INTERFACE::OnContactDeleted(MCONTACT) {} |