From 1c419d4db5f48e3ccae1b09c53c99d2863b03c9e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 30 Sep 2014 19:07:24 +0000 Subject: empty accounts to be reused by import git-svn-id: http://svn.miranda-ng.org/main/trunk@10655 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Import/src/import.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index f038a2fe86..0d8c448b20 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -202,6 +202,7 @@ static PROTOACCOUNT* FindMyAccount(const char *szProto, const char *szBaseProto) PROTOACCOUNT **destAccs; CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&destProtoCount, (LPARAM)&destAccs); + PROTOACCOUNT *pProto = NULL; for (int i = 0; i < destProtoCount; i++) { PROTOACCOUNT *pa = destAccs[i]; if (lstrcmpA(pa->szProtoName, szBaseProto)) @@ -212,12 +213,16 @@ static PROTOACCOUNT* FindMyAccount(const char *szProto, const char *szBaseProto) return pa; char *pszUniqueSetting = (char*)CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0); - if (!pszUniqueSetting || INT_PTR(pszUniqueSetting) == CALLSERVICE_NOTFOUND) + if (!pszUniqueSetting || INT_PTR(pszUniqueSetting) == CALLSERVICE_NOTFOUND) { + pProto = pa; continue; + } DBVARIANT dbSrc, dbDst; - if (dstDb->GetContactSetting(NULL, pa->szModuleName, pszUniqueSetting, &dbDst)) + if (dstDb->GetContactSetting(NULL, pa->szModuleName, pszUniqueSetting, &dbDst)) { + pProto = pa; continue; + } bool bEqual = false; if (!myGet(NULL, szProto, pszUniqueSetting, &dbSrc)) { @@ -229,7 +234,7 @@ static PROTOACCOUNT* FindMyAccount(const char *szProto, const char *szBaseProto) if (bEqual) return pa; } - return NULL; + return pProto; } void ImportAccounts() -- cgit v1.2.3