summaryrefslogtreecommitdiff
path: root/protocols/MRA/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-05 22:27:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-05 22:27:16 +0000
commit007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch)
treeb1ee30b70c6e36d1a06aed6885cb80dc560a68ca /protocols/MRA/src
parentf4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff)
- rest of menus cleared;
- old database macroses wiped out from all plugins (left in m_database.h for compatibility) git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/src')
-rw-r--r--protocols/MRA/src/MraAntiSpam.cpp2
-rw-r--r--protocols/MRA/src/MraAvatars.cpp28
-rw-r--r--protocols/MRA/src/MraChat.cpp2
-rw-r--r--protocols/MRA/src/MraIcons.cpp2
-rw-r--r--protocols/MRA/src/MraProto.cpp4
-rw-r--r--protocols/MRA/src/MraProto.h21
-rw-r--r--protocols/MRA/src/Mra_functions.cpp28
-rw-r--r--protocols/MRA/src/Mra_proto.cpp10
-rw-r--r--protocols/MRA/src/Mra_svcs.cpp24
9 files changed, 55 insertions, 66 deletions
diff --git a/protocols/MRA/src/MraAntiSpam.cpp b/protocols/MRA/src/MraAntiSpam.cpp
index 8b60ade855..0650dfe833 100644
--- a/protocols/MRA/src/MraAntiSpam.cpp
+++ b/protocols/MRA/src/MraAntiSpam.cpp
@@ -52,7 +52,7 @@ size_t MraAntiSpamLoadBadWordsW()
CharLowerBuffW(pmabwBadWords[i].lpwszBadWord, DWORD(dwValueSize));
pmabwBadWords[i].dwBadWordLen = DWORD(dwValueSize);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (pmabwBadWords[i].lpwszBadWord == NULL)
break;
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp
index a4612ab56d..9ca0b135e5 100644
--- a/protocols/MRA/src/MraAvatars.cpp
+++ b/protocols/MRA/src/MraAvatars.cpp
@@ -94,7 +94,7 @@ DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle)
InterlockedExchange((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning, TRUE);
pmraaqAvatarsQueue->hThreadEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- pmraaqAvatarsQueue->iThreadsCount = DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "WorkThreadsCount", MRA_AVT_DEFAULT_WRK_THREAD_COUNTS);
+ pmraaqAvatarsQueue->iThreadsCount = db_get_dw(NULL, MRA_AVT_SECT_NAME, "WorkThreadsCount", MRA_AVT_DEFAULT_WRK_THREAD_COUNTS);
if (pmraaqAvatarsQueue->iThreadsCount == 0)
pmraaqAvatarsQueue->iThreadsCount = 1;
if (pmraaqAvatarsQueue->iThreadsCount > MAXIMUM_WAIT_OBJECTS)
@@ -207,7 +207,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter)
bDefaultAvt = FALSE;
if (DB_GetStaticStringA(NULL, MRA_AVT_SECT_NAME, "Server", szServer, SIZEOF(szServer), NULL) == FALSE) memmove(szServer, MRA_AVT_DEFAULT_SERVER, sizeof(MRA_AVT_DEFAULT_SERVER));
- dwServerPort = DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "ServerPort", MRA_AVT_DEFAULT_SERVER_PORT);
+ dwServerPort = db_get_dw(NULL, MRA_AVT_SECT_NAME, "ServerPort", MRA_AVT_DEFAULT_SERVER_PORT);
bUseKeepAliveConn = db_get_b(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN);
if ( mraGetStaticStringA(pmraaqiAvatarsQueueItem->hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
@@ -288,7 +288,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter)
if (hFile != INVALID_HANDLE_VALUE) {
DWORD dwWritten = 0;
bContinue = TRUE;
- nls.dwTimeout = (1000*DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "TimeOutReceive", MRA_AVT_DEFAULT_TIMEOUT_RECV));
+ nls.dwTimeout = (1000*db_get_dw(NULL, MRA_AVT_SECT_NAME, "TimeOutReceive", MRA_AVT_DEFAULT_TIMEOUT_RECV));
nls.hReadConns[0] = hConnection;
while ( bContinue ) {
@@ -381,11 +381,11 @@ HANDLE MraAvatarsHttpConnect(HANDLE hNetlibUser, LPSTR lpszHost, DWORD dwPort)
nloc.flags = (NLOCF_HTTP|NLOCF_V2);
nloc.szHost = lpszHost;
nloc.wPort = ( IsHTTPSProxyUsed(hNetlibUser)) ? MRA_SERVER_PORT_HTTPS : dwPort;
- nloc.timeout = DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "TimeOutConnect", MRA_AVT_DEFAULT_TIMEOUT_CONN);
+ nloc.timeout = db_get_dw(NULL, MRA_AVT_SECT_NAME, "TimeOutConnect", MRA_AVT_DEFAULT_TIMEOUT_CONN);
if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
- DWORD dwConnectReTryCount = DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "ConnectReTryCount", MRA_AVT_DEFAULT_CONN_RETRY_COUNT);
+ DWORD dwConnectReTryCount = db_get_dw(NULL, MRA_AVT_SECT_NAME, "ConnectReTryCount", MRA_AVT_DEFAULT_CONN_RETRY_COUNT);
DWORD dwCurConnectReTryCount = dwConnectReTryCount;
HANDLE hConnection;
do {
@@ -602,7 +602,7 @@ DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFl
GetSystemTimeAsFileTime(&ftCurrentTime);
SystemTimeToFileTime(&stAvatarLastCheckTime, &ftExpireTime);
- (*((DWORDLONG*)&ftExpireTime)) += (FILETIME_MINUTE*(DWORDLONG)DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "CheckInterval", MRA_AVT_DEFAULT_CHK_INTERVAL));
+ (*((DWORDLONG*)&ftExpireTime)) += (FILETIME_MINUTE*(DWORDLONG)db_get_dw(NULL, MRA_AVT_SECT_NAME, "CheckInterval", MRA_AVT_DEFAULT_CHK_INTERVAL));
if ((*((DWORDLONG*)&ftExpireTime))>(*((DWORDLONG*)&ftCurrentTime)))
if ( MraAvatarsGetFileName(hAvatarsQueueHandle, hContact, GetContactAvatarFormat(hContact, PA_FORMAT_DEFAULT), wszFileName, SIZEOF(wszFileName), &dwPathSize) == NO_ERROR)
@@ -679,9 +679,9 @@ INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wPara
else
SET_DLG_ITEM_TEXTA(hWndDlg, IDC_SERVER, MRA_AVT_DEFAULT_SERVER);
- SetDlgItemInt(hWndDlg, IDC_SERVERPORT, DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "ServerPort", MRA_AVT_DEFAULT_SERVER_PORT), FALSE);
+ SetDlgItemInt(hWndDlg, IDC_SERVERPORT, db_get_dw(NULL, MRA_AVT_SECT_NAME, "ServerPort", MRA_AVT_DEFAULT_SERVER_PORT), FALSE);
CHECK_DLG_BUTTON(hWndDlg, IDC_USE_KEEPALIVE_CONN, db_get_b(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN));
- SetDlgItemInt(hWndDlg, IDC_UPD_CHECK_INTERVAL, DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "CheckInterval", MRA_AVT_DEFAULT_CHK_INTERVAL), FALSE);
+ SetDlgItemInt(hWndDlg, IDC_UPD_CHECK_INTERVAL, db_get_dw(NULL, MRA_AVT_SECT_NAME, "CheckInterval", MRA_AVT_DEFAULT_CHK_INTERVAL), FALSE);
CHECK_DLG_BUTTON(hWndDlg, IDC_RETURN_ABC_PATH, db_get_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", MRA_AVT_DEFAULT_RET_ABC_PATH));
CHECK_DLG_BUTTON(hWndDlg, IDC_DELETE_AVT_ON_CONTACT_DELETE, db_get_b(NULL, MRA_AVT_SECT_NAME, "DeleteAvtOnContactDelete", MRA_DELETE_AVT_ON_CONTACT_DELETE));
@@ -708,12 +708,12 @@ INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wPara
{
WCHAR szServer[MAX_PATH];
- DBWriteContactSettingByte(NULL, MRA_AVT_SECT_NAME, "Enable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
- DBWriteContactSettingByte(NULL, MRA_AVT_SECT_NAME, "DeleteAvtOnContactDelete", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_DELETE_AVT_ON_CONTACT_DELETE));
- DBWriteContactSettingByte(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RETURN_ABC_PATH));
- DBWriteContactSettingDword(NULL, MRA_AVT_SECT_NAME, "CheckInterval", GetDlgItemInt(hWndDlg, IDC_UPD_CHECK_INTERVAL, NULL, FALSE));
- DBWriteContactSettingByte(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_USE_KEEPALIVE_CONN));
- DBWriteContactSettingDword(NULL, MRA_AVT_SECT_NAME, "ServerPort", GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
+ db_set_b(NULL, MRA_AVT_SECT_NAME, "Enable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
+ db_set_b(NULL, MRA_AVT_SECT_NAME, "DeleteAvtOnContactDelete", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_DELETE_AVT_ON_CONTACT_DELETE));
+ db_set_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RETURN_ABC_PATH));
+ db_set_dw(NULL, MRA_AVT_SECT_NAME, "CheckInterval", GetDlgItemInt(hWndDlg, IDC_UPD_CHECK_INTERVAL, NULL, FALSE));
+ db_set_b(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_USE_KEEPALIVE_CONN));
+ db_set_dw(NULL, MRA_AVT_SECT_NAME, "ServerPort", GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
GET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szServer, SIZEOF(szServer));
db_set_ws(NULL, MRA_AVT_SECT_NAME, "Server", szServer);
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp
index 7eb0edc10b..1d052f8029 100644
--- a/protocols/MRA/src/MraChat.cpp
+++ b/protocols/MRA/src/MraChat.cpp
@@ -278,7 +278,7 @@ void CMraProto::MraChatSendPrivateMessage(LPWSTR lpwszEMail)
BOOL bAdded;
HANDLE hContact = MraHContactFromEmail(szEMail, dwEMailSize, TRUE, TRUE, &bAdded);
if (bAdded)
- DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ db_set_b(hContact, "CList", "Hidden", 1);
CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, IGNOREEVENT_ALL);
CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp
index df74806fc0..2165803c22 100644
--- a/protocols/MRA/src/MraIcons.cpp
+++ b/protocols/MRA/src/MraIcons.cpp
@@ -152,7 +152,7 @@ void CMraProto::InitContactMenu()
CListCreateMenu(2000060000, -500050000, NULL, NULL, FALSE, gdiContactMenuItems, SIZEOF(gdiContactMenuItems), hContactMenuItems);
}
-void CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, HICON hMainIcon, LPSTR pszContactOwner, BOOL bIsMain, const GUI_DISPLAY_ITEM *pgdiItems, size_t dwCount, HANDLE *hResult)
+void CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, HICON hMainIcon, LPSTR pszContactOwner, BOOL bIsMain, const GUI_DISPLAY_ITEM *pgdiItems, size_t dwCount, HGENMENU *hResult)
{
if (!pgdiItems || !dwCount || !hResult)
return;
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp
index e28eded3af..bc36693813 100644
--- a/protocols/MRA/src/MraProto.cpp
+++ b/protocols/MRA/src/MraProto.cpp
@@ -204,9 +204,9 @@ HANDLE CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR
mraSetStringW(hContact, "LastName", plpsLastName);
if (dwFlags & PALF_TEMPORARY)
- DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ db_set_b(hContact, "CList", "Hidden", 1);
else
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ db_unset(hContact, "CList", "NotOnList");
if (bAdded)
MraUpdateContactInfo(hContact);
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h
index e98a02f0fe..9af64edb8c 100644
--- a/protocols/MRA/src/MraProto.h
+++ b/protocols/MRA/src/MraProto.h
@@ -127,7 +127,7 @@ struct CMraProto : public PROTO_INTERFACE
__forceinline BOOL mraSetStringA(HANDLE Contact, const char *valueName, const char *parValue) {
return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue, lstrlenA(parValue)); }
__forceinline BOOL mraSetStringW(HANDLE Contact, const char *valueName, const WCHAR *parValue) {
- return DBWriteContactSettingWString(Contact, m_szModuleName, valueName, parValue); }
+ return db_set_ws(Contact, m_szModuleName, valueName, parValue); }
__forceinline BOOL mraSetLPSStringA(HANDLE Contact, const char *valueName, MRA_LPS *parValue) {
return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue->lpszData, parValue->dwSize); }
@@ -210,16 +210,16 @@ struct CMraProto : public PROTO_INTERFACE
HANDLE hAvatarsQueueHandle;
- HANDLE hMainMenuItems[MAIN_MENU_ITEMS_COUNT+4];
- HANDLE hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+4];
+ HGENMENU hMainMenuItems[MAIN_MENU_ITEMS_COUNT+4];
+ HGENMENU hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+4];
- HWND hWndEMailPopupStatus;
- DWORD dwEmailMessagesTotal, dwEmailMessagesUnread;
+ HWND hWndEMailPopupStatus;
+ DWORD dwEmailMessagesTotal, dwEmailMessagesUnread;
- BOOL bHideXStatusUI;
- HANDLE hXStatusMenuItems[MRA_XSTATUS_COUNT+4];
- HANDLE hExtraXstatusIcon;
- HANDLE hExtraInfo;
+ BOOL bHideXStatusUI;
+ HGENMENU hXStatusMenuItems[MRA_XSTATUS_COUNT+4];
+ HANDLE hExtraXstatusIcon;
+ HANDLE hExtraInfo;
char szNewMailSound[MAX_PATH];
@@ -299,8 +299,7 @@ struct CMraProto : public PROTO_INTERFACE
void InitMainMenu();
void InitContactMenu();
- void CListCreateMenu(LONG lPosition, LONG lPopupPosition, HICON hMainIcon, LPSTR pszContactOwner, BOOL bIsStatus, const struct GUI_DISPLAY_ITEM *pgdiItems, size_t dwCount, HANDLE *hResult);
- void CListShowMenuItem(HANDLE hMenuItem, BOOL bShow);
+ void CListCreateMenu(LONG lPosition, LONG lPopupPosition, HICON hMainIcon, LPSTR pszContactOwner, BOOL bIsStatus, const struct GUI_DISPLAY_ITEM *pgdiItems, size_t dwCount, HGENMENU *hResult);
DWORD ProtoBroadcastAckAsync(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam, size_t paramSize = 0);
DWORD CreateBlobFromContact(HANDLE hContact, LPWSTR lpwszRequestReason, size_t dwRequestReasonSize, LPBYTE lpbBuff, size_t dwBuffSize, size_t *pdwBuffSizeRet);
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index 7d645b10c8..5d07eab6cc 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -234,7 +234,7 @@ BOOL DB_GetStaticStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueNam
}
if (pdwRetBuffSize) (*pdwRetBuffSize) = dwRetBuffSizeLocal;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}else {
if (lpszRetBuff && dwRetBuffSize >= sizeof(WORD)) (*((WORD*)lpszRetBuff)) = 0;
if (pdwRetBuffSize) (*pdwRetBuffSize) = 0;
@@ -267,7 +267,7 @@ BOOL DB_GetStaticStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueNam
}
if (pdwRetBuffSize) (*pdwRetBuffSize) = dwReadedStringLen;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}else {
if (lpwszRetBuff && dwRetBuffSize >= sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff)) = 0;
if (pdwRetBuffSize) (*pdwRetBuffSize) = 0;
@@ -303,7 +303,7 @@ BOOL DB_SetStringExA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, L
}
else {
bRet = TRUE;
- DBDeleteContactSetting(hContact, lpszModule, lpszValueName);
+ db_unset(hContact, lpszModule, lpszValueName);
}
return bRet;
}
@@ -330,7 +330,7 @@ BOOL DB_SetStringExW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, L
}
else {
bRet = TRUE;
- DBDeleteContactSetting(hContact, lpszModule, lpszValueName);
+ db_unset(hContact, lpszModule, lpszValueName);
}
return bRet;
}
@@ -367,7 +367,7 @@ BOOL DB_GetContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszVal
}
if (pdwRetBuffSize) (*pdwRetBuffSize) = dbv.cpbVal;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else {
if (pdwRetBuffSize) (*pdwRetBuffSize) = 0;
@@ -421,9 +421,9 @@ DWORD CMraProto::SetContactFlags(HANDLE hContact, DWORD dwContactFlag)
mraSetDword(hContact, "ContactFlags", dwContactFlag);
if (dwContactFlag&CONTACT_FLAG_SHADOW)
- DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ db_set_b(hContact, "CList", "Hidden", 1);
else
- DBDeleteContactSetting(hContact, "CList", "Hidden");
+ db_unset(hContact, "CList", "Hidden");
switch (dwContactFlag&(CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE)) {
case CONTACT_FLAG_INVISIBLE:
@@ -577,7 +577,7 @@ HANDLE CMraProto::MraHContactFromEmail(LPSTR lpszEMail, size_t dwEMailSize, BOOL
if (mraGetStaticStringA(hContact, "e-mail", szEMailLocal, SIZEOF(szEMailLocal), &dwEMailLocalSize))
if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, szEMailLocal, dwEMailLocalSize, lpszEMail, dwEMailSize) == CSTR_EQUAL)
{
- if (bTemporary == FALSE) DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ if (bTemporary == FALSE) db_unset(hContact, "CList", "NotOnList");
bFound = TRUE;
break;
}
@@ -623,7 +623,7 @@ HANDLE CMraProto::MraHContactFromEmail(LPSTR lpszEMail, size_t dwEMailSize, BOOL
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_EMAIL), -1, -1, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, ID_STATUS_ONLINE, lpszEMail, dwEMailSize, NULL, 0, NULL, 0);
else {
if (bTemporary)
- DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
+ db_set_b(hContact, "CList", "NotOnList", 1);
mraSetStringExA(hContact, "MirVer", MIRVER_UNKNOWN, (sizeof(MIRVER_UNKNOWN)-1));
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_EMAIL), -1, -1, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, ID_STATUS_OFFLINE, lpszEMail, dwEMailSize, NULL, 0, NULL, 0);
}
@@ -1144,16 +1144,6 @@ DWORD CMraProto::CreateBlobFromContact(HANDLE hContact, LPWSTR lpwszRequestReaso
return dwRetErrorCode;
}
-void CMraProto::CListShowMenuItem(HANDLE hMenuItem, BOOL bShow)
-{
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
- if (bShow == FALSE)
- mi.flags |= CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem, (LPARAM)&mi);
-}
-
size_t CopyNumber(LPCVOID lpcOutBuff, LPCVOID lpcBuff, size_t dwLen)
{
BYTE btChar;
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp
index 162dd9686c..e927d2dd0f 100644
--- a/protocols/MRA/src/Mra_proto.cpp
+++ b/protocols/MRA/src/Mra_proto.cpp
@@ -676,7 +676,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd
dwTemp &= ~CONTACT_INTFLAG_NOT_AUTHORIZED;
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, SCBIF_SERVER_FLAG, 0, 0, 0, dwTemp, 0, NULL, 0, NULL, 0, NULL, 0);
mraSetDword(hContact, "HooksLocked", TRUE);
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ db_unset(hContact, "CList", "NotOnList");
mraSetDword(hContact, "HooksLocked", FALSE);
}
break;
@@ -1520,8 +1520,8 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd
if (GetContactBasicInfoW(hContact, &dwID, NULL, NULL, NULL, NULL, szEMail, SIZEOF(szEMail), &dwEMailSize, NULL, 0, NULL, NULL, 0, NULL) == NO_ERROR)
if (dwID == -1) {
if (IsEMailChatAgent(szEMail, dwEMailSize)) {// чат: ещё раз запросим авторизацию, пометим как видимый в списке, постоянный
- DBDeleteContactSetting(hContact, "CList", "Hidden");
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ db_unset(hContact, "CList", "Hidden");
+ db_unset(hContact, "CList", "NotOnList");
SetExtraIcons(hContact);
MraSetContactStatus(hContact, ID_STATUS_ONLINE);
@@ -1998,7 +1998,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *pl
}
if (bAdded)
- DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ db_set_b(hContact, "CList", "Hidden", 1);
if (bAutoGrantAuth) { // auto grant auth
DBEVENTINFO dbei = { sizeof(dbei) };
@@ -2018,7 +2018,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *pl
}
}
else {
- DBDeleteContactSetting(hContact, "CList", "Hidden");
+ db_unset(hContact, "CList", "Hidden");
if (dwFlags & MESSAGE_FLAG_CONTACT) { // contacts received
LPBYTE lpbBuffer, lpbBufferCurPos;
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp
index 9cbc06c9b3..4c5ebe50c0 100644
--- a/protocols/MRA/src/Mra_svcs.cpp
+++ b/protocols/MRA/src/Mra_svcs.cpp
@@ -529,7 +529,7 @@ int CMraProto::MraDbSettingChanged(WPARAM wParam, LPARAM lParam)
dwAuthMessageSize = lstrlenW(wszAuthMessage);
}
- DBDeleteContactSetting(hContact, "CList", "Hidden");
+ db_unset(hContact, "CList", "Hidden");
GetContactBasicInfoW(hContact, NULL, &dwGroupID, &dwContactFlag, NULL, NULL, szEMail, SIZEOF(szEMail), &dwEMailSize, wszNick, SIZEOF(wszNick), &dwNickSize, szPhones, SIZEOF(szPhones), &dwPhonesSize);
MraAddContactW(hContact, dwContactFlag, dwGroupID, szEMail, dwEMailSize, wszNick, dwNickSize, szPhones, dwPhonesSize, wszAuthMessage, dwAuthMessageSize, 0);
}
@@ -604,34 +604,34 @@ int CMraProto::MraRebuildContactMenu(WPARAM wParam, LPARAM lParam)
else bHasEMail = bHasEMailMR = bChatAgent = FALSE;
//"Request authorization"
- CListShowMenuItem(hContactMenuItems[0], (m_bLoggedIn && bIsContactMRA));// && (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
+ Menu_ShowItem(hContactMenuItems[0], (m_bLoggedIn && bIsContactMRA));// && (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
//"Grant authorization"
- CListShowMenuItem(hContactMenuItems[1], (m_bLoggedIn && bIsContactMRA && bChatAgent == FALSE));
+ Menu_ShowItem(hContactMenuItems[1], (m_bLoggedIn && bIsContactMRA && bChatAgent == FALSE));
//"&Send postcard"
- CListShowMenuItem(hContactMenuItems[2], (m_bLoggedIn && bHasEMail && bChatAgent == FALSE));
+ Menu_ShowItem(hContactMenuItems[2], (m_bLoggedIn && bHasEMail && bChatAgent == FALSE));
//"&View Album"
- CListShowMenuItem(hContactMenuItems[3], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
+ Menu_ShowItem(hContactMenuItems[3], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
//"&Read Blog"
- CListShowMenuItem(hContactMenuItems[4], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
+ Menu_ShowItem(hContactMenuItems[4], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
//"Reply Blog Status"
- CListShowMenuItem(hContactMenuItems[5], (m_bLoggedIn && dwBlogStatusMsgSize && bChatAgent == FALSE));
+ Menu_ShowItem(hContactMenuItems[5], (m_bLoggedIn && dwBlogStatusMsgSize && bChatAgent == FALSE));
//"View Video"
- CListShowMenuItem(hContactMenuItems[6], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
+ Menu_ShowItem(hContactMenuItems[6], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
//"Answers"
- CListShowMenuItem(hContactMenuItems[7], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
+ Menu_ShowItem(hContactMenuItems[7], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
//"World"
- CListShowMenuItem(hContactMenuItems[8], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
+ Menu_ShowItem(hContactMenuItems[8], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
//"Send &Nudge"
- CListShowMenuItem(hContactMenuItems[9], (!heNudgeReceived) ? (m_bLoggedIn && bIsContactMRA) : 0);
+ Menu_ShowItem(hContactMenuItems[9], (!heNudgeReceived) ? (m_bLoggedIn && bIsContactMRA) : 0);
return 0;
}
@@ -860,7 +860,7 @@ INT_PTR CMraProto::MraSetXStatusEx(WPARAM wParam, LPARAM lParam)
if (pData->flags & CSSF_DISABLE_UI) {
bHideXStatusUI = (*pData->wParam)? FALSE:TRUE;
for (DWORD i = 0; i < MRA_XSTATUS_COUNT; i++)
- CListShowMenuItem(hXStatusMenuItems[i], !bHideXStatusUI);
+ Menu_ShowItem(hXStatusMenuItems[i], !bHideXStatusUI);
}
}
return iRet;