diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 14:24:12 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 14:24:12 +0000 |
commit | 83310365c69bd40365ee0ae0e16c99c28e24cd0b (patch) | |
tree | 10ac18bfdc3fcf0fd62a5aba3ccb5dedffa2e410 /plugins/UserInfoEx/src/ex_import | |
parent | d68cd04d6f7b997692476b531bdc30f546a50efd (diff) |
- all static protocol services replaced with functions;
- m_protomod.h removed as useless
git-svn-id: http://svn.miranda-ng.org/main/trunk@14260 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src/ex_import')
5 files changed, 12 insertions, 14 deletions
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index a85bff5d88..0951d07ace 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -94,7 +94,7 @@ BYTE CExImContactBase::fromDB(MCONTACT hContact) if (!_hContact) return TRUE; // Proto - if (!(pszProto = DB::Contact::Proto(_hContact))) return FALSE; + if (!(pszProto = Proto_GetBaseAccountName(_hContact))) return FALSE; _pszProto = mir_strdup(pszProto); // AM_BaseProto @@ -229,21 +229,19 @@ MCONTACT CExImContactBase::toDB() { // create new contact if none exists if (_hContact == INVALID_CONTACT_ID && _pszProto && _pszUIDKey && _dbvUID.type != DBVT_DELETED) { - PROTOACCOUNT* pszAccount = 0; - if (NULL == (pszAccount = ProtoGetAccount( _pszProto ))) { + PROTOACCOUNT *pszAccount = Proto_GetAccount(_pszProto); + if (pszAccount == NULL) { //account does not exist return _hContact = INVALID_CONTACT_ID; } - if (!IsAccountEnabled(pszAccount)) { - ; - } + // create new contact _hContact = DB::Contact::Add(); if (!_hContact) { return _hContact = INVALID_CONTACT_ID; } // Add the protocol to the new contact - if (CallService(MS_PROTO_ADDTOCONTACT, _hContact, (LPARAM)_pszProto)) { + if (Proto_AddToContact(_hContact, _pszProto)) { DB::Contact::Delete(_hContact); return _hContact = INVALID_CONTACT_ID; } @@ -484,7 +482,7 @@ BYTE CExImContactBase::isHandle(MCONTACT hContact) if (!_pszProto) return hContact == NULL; // compare protocols - pszProto = DB::Contact::Proto(hContact); + pszProto = Proto_GetBaseAccountName(hContact); if (pszProto == NULL || (INT_PTR)pszProto == CALLSERVICE_NOTFOUND || mir_strcmp(pszProto, _pszProto)) return FALSE; diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 682110ae8a..374f296123 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -220,7 +220,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar name = (LPCTSTR) pDat->ExImContact->ptszName;
break;
case EXIM_ACCOUNT:
- PROTOACCOUNT* acc = ProtoGetAccount(pDat->ExImContact->pszName);
+ PROTOACCOUNT* acc = Proto_GetAccount(pDat->ExImContact->pszName);
name = (LPCTSTR) acc->tszAccountName;
break;
}
@@ -240,7 +240,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar TreeView_SetItemHeight(hTree, 18);
pszProto = (pDat->ExImContact->Typ == EXIM_CONTACT && pDat->ExImContact->hContact != NULL)
- ? (LPSTR)DB::Contact::Proto(pDat->ExImContact->hContact)
+ ? (LPSTR)Proto_GetBaseAccountName(pDat->ExImContact->hContact)
: NULL;
// add items that are always exported
@@ -298,7 +298,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar {
// ignore empty modules
if (!DB::Module::IsEmpty(hContact, p)) {
- pszProto = DB::Contact::Proto(hContact);
+ pszProto = Proto_GetBaseAccountName(hContact);
// Filter by mode
switch (pDat->ExImContact->Typ)
{
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index 8dff63f5d4..fb0a8ad16e 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -856,7 +856,7 @@ BYTE CVCardFileVCF::Open(MCONTACT hContact, LPCSTR pszFileName, LPCSTR pszMode) return FALSE;
if ((_hContact = hContact) == INVALID_CONTACT_ID)
return FALSE;
- if (!(_pszBaseProto = DB::Contact::Proto(_hContact)))
+ if (!(_pszBaseProto = Proto_GetBaseAccountName(_hContact)))
return FALSE;
return TRUE;
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index 6f5158a941..b2a0a1676f 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -177,7 +177,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName) break;
case EXIM_ACCOUNT:
// export only contact with selectet account name
- if (!mir_strncmp(ExImContact->pszName, DB::Contact::Proto(hContact), mir_strlen(ExImContact->pszName))) {
+ if (!mir_strncmp(ExImContact->pszName, Proto_GetBaseAccountName(hContact), mir_strlen(ExImContact->pszName))) {
if (vContact.fromDB(hContact)) {
vContact.Export(xmlfile, &Modules);
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index b67b99b966..3b7fea78fe 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -60,7 +60,7 @@ static void DisplayNameToFileName(lpExImParam ExImContact, LPSTR pszFileName, WO disp = temp;
break;
case EXIM_ACCOUNT:
- PROTOACCOUNT* acc = ProtoGetAccount(ExImContact->pszName);
+ PROTOACCOUNT* acc = Proto_GetAccount(ExImContact->pszName);
temp = mir_t2a(acc->tszAccountName);
disp = temp;
break;
|