summaryrefslogtreecommitdiff
path: root/plugins/ContactsPlus
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ContactsPlus')
-rw-r--r--plugins/ContactsPlus/src/main.cpp12
-rw-r--r--plugins/ContactsPlus/src/receive.cpp2
-rw-r--r--plugins/ContactsPlus/src/send.cpp4
-rw-r--r--plugins/ContactsPlus/src/utils.cpp14
4 files changed, 13 insertions, 19 deletions
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp
index 32534bea8f..2406d660e6 100644
--- a/plugins/ContactsPlus/src/main.cpp
+++ b/plugins/ContactsPlus/src/main.cpp
@@ -34,7 +34,7 @@ HANDLE ghSendWindowList;
HANDLE ghRecvWindowList;
gAckList gaAckData;
-HANDLE hContactMenuItem = NULL;
+HGENMENU hContactMenuItem;
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -122,7 +122,7 @@ static bool CheckContactsServiceSupport(const char* szProto)
static int HookPreBuildContactMenu(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact = (HANDLE)wParam;
- char* szProto =GetContactProto(hContact);
+ char *szProto = GetContactProto(hContact);
int bVisible = FALSE;
if (szProto && CheckContactsServiceSupport(szProto)) {
@@ -133,13 +133,7 @@ static int HookPreBuildContactMenu(WPARAM wParam, LPARAM lParam)
}
// update contact menu item's visibility
- CLISTMENUITEM mi = { sizeof(mi) };
- if (bVisible)
- mi.flags = CMIM_FLAGS;
- else
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuItem, (LPARAM)&mi);
+ Menu_ShowItem(hContactMenuItem, bVisible);
return 0;
}
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp
index 7b1c876a3e..dbb19d3330 100644
--- a/plugins/ContactsPlus/src/receive.cpp
+++ b/plugins/ContactsPlus/src/receive.cpp
@@ -95,7 +95,7 @@ static void RebuildGroupCombo(HWND hwndDlg)
int bHasGroups = !DBGetContactSettingT(NULL, "CListGroups", "0", &dbv);
HWND hGroupsCombo = GetDlgItem(hwndDlg, IDC_GROUPS);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (bHasGroups)
{
int curs = SendMessageT(hGroupsCombo, CB_GETCURSEL, 0, 0);
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp
index 03d9356062..454bd33b2d 100644
--- a/plugins/ContactsPlus/src/send.cpp
+++ b/plugins/ContactsPlus/src/send.cpp
@@ -227,7 +227,7 @@ static void SetAllContactChecks(HWND hwndList, HANDLE hReceiver) // doubtful nam
char* szProto =GetContactProto(hReceiver);
if (szProto == NULL) return;
- if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_HIDEEMPTYGROUPS && DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_USEGROUPS_DEFAULT))
+ if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_HIDEEMPTYGROUPS && db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_USEGROUPS_DEFAULT))
SendMessageT(hwndList, CLM_SETHIDEEMPTYGROUPS, (WPARAM) TRUE, 0);
else
SendMessageT(hwndList, CLM_SETHIDEEMPTYGROUPS, (WPARAM) FALSE, 0);
@@ -385,7 +385,7 @@ INT_PTR CALLBACK SendDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
if (!wndData->SendContacts(hwndDlg))
break;
- SetTimer(hwndDlg,TIMERID_MSGSEND,DBGetContactSettingDword(NULL,"SRMsg","MessageTimeout",TIMEOUT_MSGSEND),NULL);
+ SetTimer(hwndDlg,TIMERID_MSGSEND,db_get_dw(NULL,"SRMsg","MessageTimeout",TIMEOUT_MSGSEND),NULL);
break;
}
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp
index 5ff85344b8..78f5fa52e6 100644
--- a/plugins/ContactsPlus/src/utils.cpp
+++ b/plugins/ContactsPlus/src/utils.cpp
@@ -100,7 +100,7 @@ char *GetContactUID(HANDLE hContact, int bTchar)
SAFE_FREE((void**)&szAnsi);
}
}
- DBFreeVariant(&vrUid);
+ db_free(&vrUid);
}
}
if (bTchar)
@@ -120,7 +120,7 @@ int DBGetContactSettingT(HANDLE hContact, const char *szModule, const char* szSe
if (ServiceExists(MS_DB_CONTACT_GETSETTING_STR))
return DBGetContactSettingW(hContact, szModule, szSetting, dbv);
else
- return DBGetContactSetting(hContact, szModule, szSetting, dbv);
+ return db_get(hContact, szModule, szSetting, dbv);
}
@@ -129,18 +129,18 @@ TCHAR* DBGetContactSettingStringT(HANDLE hContact, const char *szModule, const c
DBVARIANT dbv = {DBVT_DELETED};
TCHAR* szRes;
- if (DBGetContactSettingWString(hContact, szModule, szSetting, &dbv))
+ if (db_get_ws(hContact, szModule, szSetting, &dbv))
return strdupT(szDef);
szRes = strdupT(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return szRes;
}
int DBWriteContactSettingStringT(HANDLE hContact, const char *szModule, const char* szSetting, TCHAR* szValue)
{
- return DBWriteContactSettingWString(hContact, szModule, szSetting, (WCHAR*)szValue);
+ return db_set_ws(hContact, szModule, szSetting, (WCHAR*)szValue);
}
@@ -193,7 +193,7 @@ void UpdateDialogTitle(HWND hwndDlg, HANDLE hContact, char* pszTitleStart)
if (strcmpT(uid?uid:contactName, oldTitle))
SetDlgItemTextT(hwndDlg, IDC_NAME, uid?uid:contactName);
- szStatus = MirandaStatusToStringT(szProto==NULL ? ID_STATUS_OFFLINE:DBGetContactSettingWord(hContact,szProto,"Status",ID_STATUS_OFFLINE));
+ szStatus = MirandaStatusToStringT(szProto==NULL ? ID_STATUS_OFFLINE:db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE));
_snprintfT(newtitle, 256, "%s %s (%s)", SRCTranslateT(pszTitleStart, str), contactName, szStatus);
SAFE_FREE((void**)&uid);
@@ -216,7 +216,7 @@ void UpdateDialogTitle(HWND hwndDlg, HANDLE hContact, char* pszTitleStart)
void UpdateDialogAddButton(HWND hwndDlg, HANDLE hContact)
{
- int bVisible = DBGetContactSettingByte(hContact,"CList","NotOnList",0);
+ int bVisible = db_get_b(hContact,"CList","NotOnList",0);
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), bVisible?SW_SHOW:SW_HIDE);
}