From 1b8c910296597f394c0996017cfe4095fb55568d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 10 Jul 2013 20:24:23 +0000 Subject: protocol DB helpers for MRA git-svn-id: http://svn.miranda-ng.org/main/trunk@5318 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/src/MraAdvancedSearch.cpp | 44 ++++++++++---------- protocols/MRA/src/MraAntiSpam.cpp | 50 +++++++++++----------- protocols/MRA/src/MraAvatars.cpp | 2 +- protocols/MRA/src/MraChat.cpp | 4 +- protocols/MRA/src/MraFilesQueue.cpp | 62 +++++++++++++-------------- protocols/MRA/src/MraMRIMProxy.cpp | 2 +- protocols/MRA/src/MraPopUp.cpp | 34 +++++++-------- protocols/MRA/src/MraProto.cpp | 8 ++-- protocols/MRA/src/MraProto.h | 3 -- protocols/MRA/src/MraRTFMsg.cpp | 2 +- protocols/MRA/src/MraSendCommand.cpp | 4 +- protocols/MRA/src/Mra_functions.cpp | 30 ++++++------- protocols/MRA/src/Mra_options.cpp | 70 +++++++++++++++---------------- protocols/MRA/src/Mra_proto.cpp | 74 ++++++++++++++++----------------- protocols/MRA/src/Mra_svcs.cpp | 16 +++---- 15 files changed, 201 insertions(+), 204 deletions(-) diff --git a/protocols/MRA/src/MraAdvancedSearch.cpp b/protocols/MRA/src/MraAdvancedSearch.cpp index 641464c497..cf54c45733 100644 --- a/protocols/MRA/src/MraAdvancedSearch.cpp +++ b/protocols/MRA/src/MraAdvancedSearch.cpp @@ -146,26 +146,26 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam ResetComboBox(GetDlgItem(hWndDlg, IDC_CITY)); - if ( ppro->getByte(NULL, "AdvancedSearchRemember", MRA_DEFAULT_SEARCH_REMEMBER)) { - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_GENDER, CB_SETCURSEL, ppro->getWord(NULL, "AdvancedSearchGender", 0), 0); - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_FROM, CB_SETCURSEL, ppro->getWord(NULL, "AdvancedSearchAgeFrom", 0), 0); - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_TO, CB_SETCURSEL, ppro->getWord(NULL, "AdvancedSearchAgeTo", 0), 0); - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_MONTH, CB_SETCURSEL, ppro->getWord(NULL, "AdvancedSearchBirthDayMonth", 0), 0); - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_DAY, CB_SETCURSEL, ppro->getWord(NULL, "AdvancedSearchBirthDayDay", 0), 0); + if ( ppro->getByte("AdvancedSearchRemember", MRA_DEFAULT_SEARCH_REMEMBER)) { + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_GENDER, CB_SETCURSEL, ppro->getWord("AdvancedSearchGender", 0), 0); + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_FROM, CB_SETCURSEL, ppro->getWord("AdvancedSearchAgeFrom", 0), 0); + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_TO, CB_SETCURSEL, ppro->getWord("AdvancedSearchAgeTo", 0), 0); + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_MONTH, CB_SETCURSEL, ppro->getWord("AdvancedSearchBirthDayMonth", 0), 0); + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_DAY, CB_SETCURSEL, ppro->getWord("AdvancedSearchBirthDayDay", 0), 0); - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_SETCURSEL, ppro->getWord(NULL, "AdvancedSearchZodiakID", 0), 0); + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_SETCURSEL, ppro->getWord("AdvancedSearchZodiakID", 0), 0); - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_COUNTRY, CB_SETCURSEL, ppro->getWord(NULL, "AdvancedSearchCountryID", 0), 0); + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_COUNTRY, CB_SETCURSEL, ppro->getWord("AdvancedSearchCountryID", 0), 0); SendMessageW(hWndDlg, WM_COMMAND, (WPARAM)MAKELONG(IDC_COUNTRY, CBN_SELCHANGE), (LPARAM)GetDlgItem(hWndDlg, IDC_COUNTRY)); - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_STATE, CB_SETCURSEL, ppro->getWord(NULL, "AdvancedSearchStateID", 0), 0); + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_STATE, CB_SETCURSEL, ppro->getWord("AdvancedSearchStateID", 0), 0); SendMessageW(hWndDlg, WM_COMMAND, (WPARAM)MAKELONG(IDC_STATE, CBN_SELCHANGE), (LPARAM)GetDlgItem(hWndDlg, IDC_STATE)); - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_CITY, CB_SETCURSEL, ppro->getWord(NULL, "AdvancedSearchCityID", 0), 0); + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_CITY, CB_SETCURSEL, ppro->getWord("AdvancedSearchCityID", 0), 0); - CHECK_DLG_BUTTON(hWndDlg, IDC_ONLINEONLY, ppro->getByte(NULL, "AdvancedSearchOnlineOnly", FALSE)); + CHECK_DLG_BUTTON(hWndDlg, IDC_ONLINEONLY, ppro->getByte("AdvancedSearchOnlineOnly", FALSE)); CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_REMEMBER, TRUE); } TranslateDialogDefault(hWndDlg); @@ -173,20 +173,20 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam return TRUE; case WM_DESTROY: - ppro->setWord(NULL, "AdvancedSearchGender", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_GENDER, CB_GETCURSEL, 0, 0)); - ppro->setWord(NULL, "AdvancedSearchAgeFrom", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_FROM, CB_GETCURSEL, 0, 0)); - ppro->setWord(NULL, "AdvancedSearchAgeTo", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_TO, CB_GETCURSEL, 0, 0)); - ppro->setWord(NULL, "AdvancedSearchBirthDayMonth", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_MONTH, CB_GETCURSEL, 0, 0)); - ppro->setWord(NULL, "AdvancedSearchBirthDayDay", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_DAY, CB_GETCURSEL, 0, 0)); + ppro->setWord("AdvancedSearchGender", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_GENDER, CB_GETCURSEL, 0, 0)); + ppro->setWord("AdvancedSearchAgeFrom", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_FROM, CB_GETCURSEL, 0, 0)); + ppro->setWord("AdvancedSearchAgeTo", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_TO, CB_GETCURSEL, 0, 0)); + ppro->setWord("AdvancedSearchBirthDayMonth", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_MONTH, CB_GETCURSEL, 0, 0)); + ppro->setWord("AdvancedSearchBirthDayDay", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_DAY, CB_GETCURSEL, 0, 0)); - ppro->setWord(NULL, "AdvancedSearchZodiakID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_GETCURSEL, 0, 0)); + ppro->setWord("AdvancedSearchZodiakID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_GETCURSEL, 0, 0)); - ppro->setWord(NULL, "AdvancedSearchCityID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_CITY, CB_GETCURSEL, 0, 0)); - ppro->setWord(NULL, "AdvancedSearchStateID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_STATE, CB_GETCURSEL, 0, 0)); - ppro->setWord(NULL, "AdvancedSearchCountryID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0)); + ppro->setWord("AdvancedSearchCityID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_CITY, CB_GETCURSEL, 0, 0)); + ppro->setWord("AdvancedSearchStateID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_STATE, CB_GETCURSEL, 0, 0)); + ppro->setWord("AdvancedSearchCountryID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0)); - ppro->setByte(NULL, "AdvancedSearchOnlineOnly", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ONLINEONLY)); - ppro->setByte(NULL, "AdvancedSearchRemember", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_REMEMBER)); + ppro->setByte("AdvancedSearchOnlineOnly", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ONLINEONLY)); + ppro->setByte("AdvancedSearchRemember", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_REMEMBER)); break; case WM_COMMAND: diff --git a/protocols/MRA/src/MraAntiSpam.cpp b/protocols/MRA/src/MraAntiSpam.cpp index 527a1c8d81..4e19e005e6 100644 --- a/protocols/MRA/src/MraAntiSpam.cpp +++ b/protocols/MRA/src/MraAntiSpam.cpp @@ -85,14 +85,14 @@ INT_PTR CALLBACK MraAntiSpamDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, L SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam); ppro = (CMraProto*)lParam; - CHECK_DLG_BUTTON(hWndDlg, IDC_ENABLE, ppro->getByte(NULL, "AntiSpamEnable", MRA_ANTISPAM_DEFAULT_ENABLE)); - CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_TEMP_CONTACTS, ppro->getByte(NULL, "AntiSpamCheckTempContacts", MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS)); - CHECK_DLG_BUTTON(hWndDlg, IDC_DELETE_SPAMBOT_CONTACT, ppro->getByte(NULL, "AntiSpamDeteleSpamBotContacts", MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT)); - CHECK_DLG_BUTTON(hWndDlg, IDC_CLN_NON_ALPHNUM, ppro->getByte(NULL, "AntiSpamCleanNonAlphaNumeric", MRA_ANTISPAM_DEFAULT_CLN_NON_ALPHNUM)); - SetDlgItemInt(hWndDlg, IDC_MAX_LANG_CHANGES, ppro->getDword(NULL, "AntiSpamMaxLangChanges", MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES), FALSE); - CHECK_DLG_BUTTON(hWndDlg, IDC_SHOWPOPUP, ppro->getByte(NULL, "AntiSpamShowPopUp", MRA_ANTISPAM_DEFAULT_SHOWPOP)); - CHECK_DLG_BUTTON(hWndDlg, IDC_WRITETOSYSTEMHISTORY, ppro->getByte(NULL, "AntiSpamWriteToSystemHistory", MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY)); - CHECK_DLG_BUTTON(hWndDlg, IDC_SEND_SPAM_REPORT_TO_SERVER, ppro->getByte(NULL, "AntiSpamSendSpamReportToSrv", MRA_ANTISPAM_DEFAULT_SEND_SPAM_REPORT_TO_SERVER)); + CHECK_DLG_BUTTON(hWndDlg, IDC_ENABLE, ppro->getByte("AntiSpamEnable", MRA_ANTISPAM_DEFAULT_ENABLE)); + CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_TEMP_CONTACTS, ppro->getByte("AntiSpamCheckTempContacts", MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS)); + CHECK_DLG_BUTTON(hWndDlg, IDC_DELETE_SPAMBOT_CONTACT, ppro->getByte("AntiSpamDeteleSpamBotContacts", MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT)); + CHECK_DLG_BUTTON(hWndDlg, IDC_CLN_NON_ALPHNUM, ppro->getByte("AntiSpamCleanNonAlphaNumeric", MRA_ANTISPAM_DEFAULT_CLN_NON_ALPHNUM)); + SetDlgItemInt(hWndDlg, IDC_MAX_LANG_CHANGES, ppro->getDword("AntiSpamMaxLangChanges", MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES), FALSE); + CHECK_DLG_BUTTON(hWndDlg, IDC_SHOWPOPUP, ppro->getByte("AntiSpamShowPopUp", MRA_ANTISPAM_DEFAULT_SHOWPOP)); + CHECK_DLG_BUTTON(hWndDlg, IDC_WRITETOSYSTEMHISTORY, ppro->getByte("AntiSpamWriteToSystemHistory", MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY)); + CHECK_DLG_BUTTON(hWndDlg, IDC_SEND_SPAM_REPORT_TO_SERVER, ppro->getByte("AntiSpamSendSpamReportToSrv", MRA_ANTISPAM_DEFAULT_SEND_SPAM_REPORT_TO_SERVER)); { // fill list char szSettingName[MAX_PATH]; @@ -163,14 +163,14 @@ INT_PTR CALLBACK MraAntiSpamDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, L WCHAR szBadWord[MAX_PATH]; size_t i, dwCount; - ppro->setByte(NULL, "AntiSpamEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE)); - ppro->setByte(NULL, "AntiSpamCheckTempContacts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_TEMP_CONTACTS)); - ppro->setByte(NULL, "AntiSpamDeteleSpamBotContacts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_DELETE_SPAMBOT_CONTACT)); - ppro->setByte(NULL, "AntiSpamCleanNonAlphaNumeric", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CLN_NON_ALPHNUM)); - ppro->setDword(NULL, "AntiSpamMaxLangChanges", (DWORD)GetDlgItemInt(hWndDlg, IDC_MAX_LANG_CHANGES, NULL, FALSE)); - ppro->setByte(NULL, "AntiSpamShowPopUp", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SHOWPOPUP)); - ppro->setByte(NULL, "AntiSpamWriteToSystemHistory", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_WRITETOSYSTEMHISTORY)); - ppro->setByte(NULL, "AntiSpamSendSpamReportToSrv", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SEND_SPAM_REPORT_TO_SERVER)); + ppro->setByte("AntiSpamEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE)); + ppro->setByte("AntiSpamCheckTempContacts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_TEMP_CONTACTS)); + ppro->setByte("AntiSpamDeteleSpamBotContacts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_DELETE_SPAMBOT_CONTACT)); + ppro->setByte("AntiSpamCleanNonAlphaNumeric", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CLN_NON_ALPHNUM)); + ppro->setDword("AntiSpamMaxLangChanges", (DWORD)GetDlgItemInt(hWndDlg, IDC_MAX_LANG_CHANGES, NULL, FALSE)); + ppro->setByte("AntiSpamShowPopUp", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SHOWPOPUP)); + ppro->setByte("AntiSpamWriteToSystemHistory", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_WRITETOSYSTEMHISTORY)); + ppro->setByte("AntiSpamSendSpamReportToSrv", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SEND_SPAM_REPORT_TO_SERVER)); dwCount = SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_GETCOUNT, 0, 0); for (i = 0; i < dwCount; i++) { @@ -182,7 +182,7 @@ INT_PTR CALLBACK MraAntiSpamDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, L dwCount = ((i*2)+1024); for (; i < dwCount; i++) { mir_snprintf(szSettingName, SIZEOF(szSettingName), "AntiSpamBadWord %lu", i); - ppro->mraDelValue(NULL, szSettingName); + ppro->delSetting(szSettingName); } MraAntiSpamLoadBadWordsW(); @@ -307,7 +307,7 @@ BOOL CMraProto::MraAntiSpamHasMessageBadWordsW(LPWSTR lpwszMessage, size_t dwMes CharLowerBuffW(lpwszMessageConverted, DWORD(dwMessageSize)); // 1 проход: считаем колличество переключений языка - dwtm = getDword(NULL, "AntiSpamMaxLangChanges", MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES); + dwtm = getDword("AntiSpamMaxLangChanges", MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES); if (dwtm) if (dwtm <= MraAntiSpamCalcLangChanges(lpwszMessageConverted, dwMessageSize)) bRet = TRUE; @@ -318,7 +318,7 @@ BOOL CMraProto::MraAntiSpamHasMessageBadWordsW(LPWSTR lpwszMessage, size_t dwMes // 3 проход: оставляем только буквы + цифры и снова ищем плохие слова if (bRet == FALSE) - if (getByte(NULL, "AntiSpamCleanNonAlphaNumeric", MRA_ANTISPAM_DEFAULT_ENABLE)) { + if (getByte("AntiSpamCleanNonAlphaNumeric", MRA_ANTISPAM_DEFAULT_ENABLE)) { dwMessageSize = MraAntiSpamCleanNonAlphaNumeric(lpwszMessageConverted, dwMessageSize); bRet = MraAntiSpamTestMessageForBadWordsW(lpwszMessageConverted, dwMessageSize); } @@ -334,7 +334,7 @@ DWORD CMraProto::MraAntiSpamReceivedMessageW(LPSTR lpszEMail, size_t dwEMailSize DWORD dwRet = MESSAGE_NOT_SPAM;; if ((dwMessageFlags&(MESSAGE_FLAG_SYSTEM|MESSAGE_FLAG_CONTACT|MESSAGE_FLAG_NOTIFY|MESSAGE_FLAG_SMS|MESSAGE_SMS_DELIVERY_REPORT|MESSAGE_FLAG_ALARM|MESSAGE_FLAG_MULTICHAT)) == 0) - if (getByte(NULL, "AntiSpamEnable", MRA_ANTISPAM_DEFAULT_ENABLE)) + if (getByte("AntiSpamEnable", MRA_ANTISPAM_DEFAULT_ENABLE)) if (IsEMailChatAgent(lpszEMail, dwEMailSize) == FALSE) { // enabled, message must be checked BOOL bCheckMessage = TRUE; dwRet = MESSAGE_SPAM; @@ -349,8 +349,8 @@ DWORD CMraProto::MraAntiSpamReceivedMessageW(LPSTR lpszEMail, size_t dwEMailSize dwRet = MESSAGE_NOT_SPAM; } else { // temp contact - if (getByte(NULL, "AntiSpamCheckTempContacts", MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS) == FALSE || - (((dwMessageFlags&MESSAGE_FLAG_AUTHORIZE) && getByte(NULL, "AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS) && getByte(NULL, "AutoAuthGrandNewUsersDisableSPAMCheck", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK)))) + if (getByte("AntiSpamCheckTempContacts", MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS) == FALSE || + (((dwMessageFlags&MESSAGE_FLAG_AUTHORIZE) && getByte("AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS) && getByte("AutoAuthGrandNewUsersDisableSPAMCheck", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK)))) {// проверка временного контакта bCheckMessage = FALSE; dwRet = MESSAGE_NOT_SPAM; @@ -365,9 +365,9 @@ DWORD CMraProto::MraAntiSpamReceivedMessageW(LPSTR lpszEMail, size_t dwEMailSize if (dwRet == MESSAGE_SPAM) { BOOL bAntiSpamShowPopup, bAntiSpamWriteToSystemHistory, bAntiSpamDeteleSpamBotContacts; - bAntiSpamShowPopup = (BOOL)getByte(NULL, "AntiSpamShowPopUp", MRA_ANTISPAM_DEFAULT_SHOWPOP); - bAntiSpamWriteToSystemHistory = (BOOL)getByte(NULL, "AntiSpamWriteToSystemHistory", MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY); - bAntiSpamDeteleSpamBotContacts = (BOOL)getByte(NULL, "AntiSpamDeteleSpamBotContacts", MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT); + bAntiSpamShowPopup = (BOOL)getByte("AntiSpamShowPopUp", MRA_ANTISPAM_DEFAULT_SHOWPOP); + bAntiSpamWriteToSystemHistory = (BOOL)getByte("AntiSpamWriteToSystemHistory", MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY); + bAntiSpamDeteleSpamBotContacts = (BOOL)getByte("AntiSpamDeteleSpamBotContacts", MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT); if (bAntiSpamShowPopup || bAntiSpamWriteToSystemHistory) { char szEMail[MAX_EMAIL_LEN]; diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index 077489bed1..e80ee2e9df 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -509,7 +509,7 @@ void CMraProto::MraAvatarsSetContactTime(HANDLE hContact, LPSTR lpszValueName, S InternetTimeGetString(&itTime, (LPSTR)szBuff, SIZEOF(szBuff), &dwBuffUsedSize); mraSetStringExA(hContact, lpszValueName, (LPSTR)szBuff, dwBuffUsedSize); } - else mraDelValue(hContact, lpszValueName); + else delSetting(hContact, lpszValueName); } DWORD MraAvatarsGetFileFormat(LPTSTR lpszPath, size_t dwPathSize) diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp index 9efcbb1e2c..f4f0e0e3e1 100644 --- a/protocols/MRA/src/MraChat.cpp +++ b/protocols/MRA/src/MraChat.cpp @@ -233,10 +233,10 @@ int CMraProto::MraChatGcEventHook(WPARAM, LPARAM lParam) size_t dwMessageSize = lstrlenW(gch->ptszText); size_t dwEMailSize = (WideCharToMultiByte(MRA_CODE_PAGE, 0, gch->pDest->ptszID, -1, szEMail, SIZEOF(szEMail), NULL, NULL)-1); HANDLE hContact = MraHContactFromEmail(szEMail, dwEMailSize, FALSE, TRUE, NULL); - BOOL bSlowSend = getByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND); + BOOL bSlowSend = getByte("SlowSend", MRA_DEFAULT_SLOW_SEND); DWORD dwFlags = 0; - if (getByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact)&FEATURE_FLAG_RTF_MESSAGE)) + if (getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact)&FEATURE_FLAG_RTF_MESSAGE)) dwFlags |= MESSAGE_FLAG_RTF; INT_PTR iSendRet = MraMessageW(bSlowSend, hContact, ACKTYPE_MESSAGE, dwFlags, szEMail, dwEMailSize, gch->ptszText, dwMessageSize, NULL, 0); diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index 7ba7402c54..7e61679761 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -82,19 +82,19 @@ INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, ppro = (CMraProto*)lParam; { WCHAR szBuff[MAX_PATH]; - CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN, ppro->getByte(NULL, "FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN)); - CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE, ppro->getByte(NULL, "FileSendNoOutConnOnRcv", MRA_DEF_FS_NO_OUT_CONN_ON_RCV)); - CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND, ppro->getByte(NULL, "FileSendNoOutConnOnSend", MRA_DEF_FS_NO_OUT_CONN_ON_SEND)); - CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS, ppro->getByte(NULL, "FileSendIgnoryAdditionalPorts", MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS)); - CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES, ppro->getByte(NULL, "FileSendHideMyAddresses", MRA_DEF_FS_HIDE_MY_ADDRESSES)); - CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS, ppro->getByte(NULL, "FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES)); + CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN, ppro->getByte("FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN)); + CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE, ppro->getByte("FileSendNoOutConnOnRcv", MRA_DEF_FS_NO_OUT_CONN_ON_RCV)); + CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND, ppro->getByte("FileSendNoOutConnOnSend", MRA_DEF_FS_NO_OUT_CONN_ON_SEND)); + CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS, ppro->getByte("FileSendIgnoryAdditionalPorts", MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS)); + CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES, ppro->getByte("FileSendHideMyAddresses", MRA_DEF_FS_HIDE_MY_ADDRESSES)); + CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS, ppro->getByte("FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES)); if (ppro->mraGetStaticStringW(NULL, "FileSendExtraAddresses", szBuff, SIZEOF(szBuff), NULL)) SET_DLG_ITEM_TEXT(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS, szBuff); - CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS, ppro->getByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)); + CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS, ppro->getByte("FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)); - SetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, ppro->getDword(NULL, "FileSendBlockSize", MRA_DEFAULT_FILE_SEND_BLOCK_SIZE), FALSE); + SetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, ppro->getDword("FileSendBlockSize", MRA_DEFAULT_FILE_SEND_BLOCK_SIZE), FALSE); MraFilesQueueDlgEnableDirectConsControls(hWndDlg, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN)); } @@ -117,16 +117,16 @@ INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, { WCHAR szBuff[MAX_PATH]; - ppro->setByte(NULL, "FileSendEnableDirectConn", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN)); - ppro->setByte(NULL, "FileSendNoOutConnOnRcv", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE)); - ppro->setByte(NULL, "FileSendNoOutConnOnSend", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND)); - ppro->setByte(NULL, "FileSendIgnoryAdditionalPorts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS)); - ppro->setByte(NULL, "FileSendHideMyAddresses", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES)); - ppro->setByte(NULL, "FileSendAddExtraAddresses", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS)); + ppro->setByte("FileSendEnableDirectConn", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN)); + ppro->setByte("FileSendNoOutConnOnRcv", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE)); + ppro->setByte("FileSendNoOutConnOnSend", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND)); + ppro->setByte("FileSendIgnoryAdditionalPorts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS)); + ppro->setByte("FileSendHideMyAddresses", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES)); + ppro->setByte("FileSendAddExtraAddresses", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS)); GET_DLG_ITEM_TEXT(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS, szBuff, SIZEOF(szBuff)); ppro->mraSetStringW(NULL, "FileSendExtraAddresses", szBuff); - ppro->setDword(NULL, "FileSendBlockSize", (DWORD)GetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, NULL, FALSE)); - ppro->setByte(NULL, "FileSendEnableMRIMProxyCons", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS)); + ppro->setDword("FileSendBlockSize", (DWORD)GetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, NULL, FALSE)); + ppro->setByte("FileSendEnableMRIMProxyCons", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS)); } return TRUE; } @@ -231,9 +231,9 @@ size_t CMraProto::MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBu CHAR szHostName[MAX_PATH] = {0}; LPSTR lpszCurPos = lpszBuff; - if (getByte(NULL, "FileSendHideMyAddresses", MRA_DEF_FS_HIDE_MY_ADDRESSES)) + if (getByte("FileSendHideMyAddresses", MRA_DEF_FS_HIDE_MY_ADDRESSES)) {// не выдаём врагу наш IP адрес!!! :) - if (getByte(NULL, "FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES) == FALSE) + if (getByte("FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES) == FALSE) {// только если не добавляем адрес роутера lpszCurPos += mir_snprintf(lpszCurPos, (dwBuffSize-((size_t)lpszCurPos-(size_t)lpszBuff)), MRA_FILES_NULL_ADDRR); } @@ -244,7 +244,7 @@ size_t CMraProto::MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBu size_t dwAdapter = 0; hostent *sh; - dwSelfExternalIP = NTOHL(getDword(NULL, "IP", 0)); + dwSelfExternalIP = NTOHL(getDword("IP", 0)); if (dwSelfExternalIP) { memmove(&btAddress, &dwSelfExternalIP, sizeof(DWORD)); lpszCurPos += mir_snprintf(lpszCurPos, (dwBuffSize-((size_t)lpszCurPos-(size_t)lpszBuff)), "%lu.%lu.%lu.%lu:%lu;", btAddress[0], btAddress[1], btAddress[2], btAddress[3], dwPort); @@ -259,7 +259,7 @@ size_t CMraProto::MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBu } } - if (getByte(NULL, "FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES))// добавляем произвольный адрес + if (getByte("FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES))// добавляем произвольный адрес if (mraGetStaticStringA(NULL, "FileSendExtraAddresses", szHostName, SIZEOF(szHostName), NULL)) lpszCurPos += mir_snprintf(lpszCurPos, (dwBuffSize-((size_t)lpszCurPos-(size_t)lpszBuff)), "%s:%lu;", szHostName, dwPort); @@ -336,7 +336,7 @@ DWORD CMraProto::MraFilesQueueCancel(HANDLE hFilesQueueHandle, DWORD dwIDRequest DWORD CMraProto::MraFilesQueueStartMrimProxy(HANDLE hFilesQueueHandle, DWORD dwIDRequest) { - if (!hFilesQueueHandle || !getByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) + if (!hFilesQueueHandle || !getByte("FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) return ERROR_INVALID_HANDLE; MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)hFilesQueueHandle; @@ -445,17 +445,17 @@ HANDLE CMraProto::MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *dat) if (!dat) return NULL; - if (getByte(NULL, "FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN) && InterlockedExchangeAdd((volatile LONG*)&dat->bIsWorking, 0) && ((dat->bSending == FALSE && getByte(NULL, "FileSendNoOutConnOnRcv", MRA_DEF_FS_NO_OUT_CONN_ON_RCV) == FALSE) || (dat->bSending == TRUE && getByte(NULL, "FileSendNoOutConnOnSend", MRA_DEF_FS_NO_OUT_CONN_ON_SEND) == FALSE))) { + if (getByte("FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN) && InterlockedExchangeAdd((volatile LONG*)&dat->bIsWorking, 0) && ((dat->bSending == FALSE && getByte("FileSendNoOutConnOnRcv", MRA_DEF_FS_NO_OUT_CONN_ON_RCV) == FALSE) || (dat->bSending == TRUE && getByte("FileSendNoOutConnOnSend", MRA_DEF_FS_NO_OUT_CONN_ON_SEND) == FALSE))) { BOOL bFiltering = FALSE, bIsHTTPSProxyUsed = IsHTTPSProxyUsed(hNetlibUser); DWORD dwLocalPort = 0, dwConnectReTryCount, dwCurConnectReTryCount; size_t dwAddrCount; NETLIBOPENCONNECTION nloc = {0}; - if (getByte(NULL, "FileSendIgnoryAdditionalPorts", MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS) || bIsHTTPSProxyUsed) + if (getByte("FileSendIgnoryAdditionalPorts", MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS) || bIsHTTPSProxyUsed) {// фильтруем порты для одного IP, вместо 3 будем коннектится только к одному if (bIsHTTPSProxyUsed) dwLocalPort = MRA_SERVER_PORT_HTTPS; - else if ((dwLocalPort = getWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT)) == MRA_SERVER_PORT_STANDART_NLB) + else if ((dwLocalPort = getWord("ServerPort", MRA_DEFAULT_SERVER_PORT)) == MRA_SERVER_PORT_STANDART_NLB) dwLocalPort = MRA_SERVER_PORT_STANDART; dwAddrCount = 0; @@ -472,10 +472,10 @@ HANDLE CMraProto::MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *dat) if (dwAddrCount) { dat->hConnection = NULL; - dwConnectReTryCount = getDword(NULL, "ConnectReTryCountFileSend", MRA_DEFAULT_CONN_RETRY_COUNT_FILES); + dwConnectReTryCount = getDword("ConnectReTryCountFileSend", MRA_DEFAULT_CONN_RETRY_COUNT_FILES); nloc.cbSize = sizeof(nloc); nloc.flags = NLOCF_V2; - nloc.timeout = getDword(NULL, "TimeOutConnectFileSend", ((MRA_TIMEOUT_DIRECT_CONN-1)/(dwAddrCount*dwConnectReTryCount)));// -1 сек чтобы был запас + nloc.timeout = getDword("TimeOutConnectFileSend", ((MRA_TIMEOUT_DIRECT_CONN-1)/(dwAddrCount*dwConnectReTryCount)));// -1 сек чтобы был запас if (nloc.timeoutMRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ; @@ -543,7 +543,7 @@ HANDLE CMraProto::MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *dat) size_t dwAddrListSize; // копируем адреса в соответствии с правилами и начинаем слушать порт - if (getByte(NULL, "FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN)) { + if (getByte("FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN)) { NETLIBBIND nlbBind = {0}; nlbBind.cbSize = sizeof(nlbBind); @@ -663,7 +663,7 @@ DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags dat->dwIDRequest = dwIDRequest; dat->dwFlags = dwFlags; dat->hContact = hContact; - if (getByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) + if (getByte("FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) dat->hMraMrimProxyData = MraMrimProxyCreate(); dwFileNameTotalSize = 0; @@ -854,7 +854,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) bOK = FALSE; bContinue = TRUE; dwUpdateTimeNext = GetTickCount(); - nls.dwTimeout = (1000*getDword(NULL, "TimeOutReceiveFileData", MRA_DEF_FS_TIMEOUT_RECV)); + nls.dwTimeout = (1000*getDword("TimeOutReceiveFileData", MRA_DEF_FS_TIMEOUT_RECV)); nls.hReadConns[0] = dat->hConnection; ProtoBroadcastAck(dat->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)dat->dwIDRequest, (LPARAM)&pfts); @@ -973,7 +973,7 @@ DWORD CMraProto::MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, H dat->dwIDRequest = InterlockedIncrement((LONG volatile*)&dwCMDNum);// уникальный, рандомный идентификатор dat->dwFlags = dwFlags; dat->hContact = hContact; - if (getByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) dat->hMraMrimProxyData = MraMrimProxyCreate(); + if (getByte("FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) dat->hMraMrimProxyData = MraMrimProxyCreate(); dat->dwFilesCount = dwFilesCount; dat->pmfqfFiles = (MRA_FILES_QUEUE_FILE*)mir_calloc((sizeof(MRA_FILES_QUEUE_FILE)*(dat->dwFilesCount+1))); dat->dwFilesTotalSize = 0; @@ -1034,7 +1034,7 @@ void CMraProto::MraFilesQueueSendThreadProc(LPVOID lpParameter) pfts.totalBytes = dat->dwFilesTotalSize; pfts.wszWorkingDir = dat->lpwszPath; - dwSendBlockSize = getDword(NULL, "FileSendBlockSize", MRA_DEFAULT_FILE_SEND_BLOCK_SIZE); + dwSendBlockSize = getDword("FileSendBlockSize", MRA_DEFAULT_FILE_SEND_BLOCK_SIZE); if (dwSendBlockSize>SIZEOF(btBuff)) dwSendBlockSize = SIZEOF(btBuff); if (dwSendBlockSize<512) dwSendBlockSize = MRA_DEFAULT_FILE_SEND_BLOCK_SIZE; diff --git a/protocols/MRA/src/MraMRIMProxy.cpp b/protocols/MRA/src/MraMRIMProxy.cpp index bdbdf8eac6..485cf14c6b 100644 --- a/protocols/MRA/src/MraMRIMProxy.cpp +++ b/protocols/MRA/src/MraMRIMProxy.cpp @@ -111,7 +111,7 @@ DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnect if (pmmpd->malAddrList.dwAddrCount) { pmmpd->hConnection = NULL; bIsHTTPSProxyUsed = IsHTTPSProxyUsed(hNetlibUser); - dwConnectReTryCount = getDword(NULL, "ConnectReTryCountMRIMProxy", MRA_DEFAULT_CONN_RETRY_COUNT_MRIMPROXY); + dwConnectReTryCount = getDword("ConnectReTryCountMRIMProxy", MRA_DEFAULT_CONN_RETRY_COUNT_MRIMPROXY); nloc.cbSize = sizeof(nloc); nloc.flags = NLOCF_V2; nloc.timeout = ((MRA_TIMEOUT_DIRECT_CONN-1)/(pmmpd->malAddrList.dwAddrCount*dwConnectReTryCount));// -1 сек чтобы был запас diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp index 3b6a4a46fa..135ba88f80 100644 --- a/protocols/MRA/src/MraPopUp.cpp +++ b/protocols/MRA/src/MraPopUp.cpp @@ -44,24 +44,24 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR char szBuff[MAX_PATH]; DWORD dwType = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COMBO_POPUP_TYPE); - bEnabled = GetBit(ppro->getDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType); + bEnabled = GetBit(ppro->getDword("PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType); CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_ENABLE, bEnabled); mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]); - bUseWinColors = ppro->getByte(NULL, szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS); + bUseWinColors = ppro->getByte(szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS); CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_USE_WIN_COLORS, bUseWinColors); EnableWindow(GetDlgItem(hWndDlg, IDC_CHK_USE_WIN_COLORS), bEnabled); mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]); - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_BACK)); + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_BACK)); EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_BACKCOLOR), (bEnabled && bUseWinColors == FALSE)); mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]); - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT)); + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT)); EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TEXTCOLOR), (bEnabled && bUseWinColors == FALSE)); mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]); - SetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, ppro->getDword(NULL, szBuff, MRA_DEFAULT_POPUP_TIMEOUT), FALSE); + SetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_TIMEOUT), FALSE); EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TIMEOUT), bEnabled); } break; @@ -98,25 +98,25 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR { char szBuff[MAX_PATH]; DWORD dwType = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COMBO_POPUP_TYPE); - DWORD dwPopupsEventFilter = ppro->getDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER); + DWORD dwPopupsEventFilter = ppro->getDword("PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER); if (IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_ENABLE)) dwPopupsEventFilter |= (1<setDword(NULL, "PopupsEventFilter", dwPopupsEventFilter); + ppro->setDword("PopupsEventFilter", dwPopupsEventFilter); mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]); - ppro->setByte(NULL, szBuff, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS)); + ppro->setByte(szBuff, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS)); mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]); - ppro->setDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_GETCOLOUR, 0, 0)); + ppro->setDword(szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_GETCOLOUR, 0, 0)); mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]); - ppro->setDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0)); + ppro->setDword(szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0)); mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]); - ppro->setDword(NULL, szBuff, GetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, NULL, FALSE)); + ppro->setDword(szBuff, GetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, NULL, FALSE)); } return TRUE; } @@ -229,8 +229,8 @@ void CMraProto::MraPopupShowFromContactW(HANDLE hContact, DWORD dwType, DWORD dw void CMraProto::MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPWSTR lpszMessage) { - if (getByte(NULL, "PopupsEnabled", MRA_DEFAULT_POPUPS_ENABLED)) - if (GetBit(getDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType)) + if (getByte("PopupsEnabled", MRA_DEFAULT_POPUPS_ENABLED)) + if (GetBit(getDword("PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType)) if ( ServiceExists(MS_POPUP_ADDPOPUPW)) { BOOL bUseWinColors; char szBuff[MAX_PATH]; @@ -281,21 +281,21 @@ void CMraProto::MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWS ppd->PluginData = dat; mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]); - bUseWinColors = getByte(NULL, szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS); + bUseWinColors = getByte(szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS); if (bUseWinColors) { ppd->colorBack = GetSysColor(COLOR_BTNFACE); ppd->colorText = GetSysColor(COLOR_WINDOWTEXT); } else { mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]); - ppd->colorBack = getDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_BACK); + ppd->colorBack = getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_BACK); mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]); - ppd->colorText = getDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT); + ppd->colorText = getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT); } mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]); - ppd->iSeconds = getDword(NULL, szBuff, MRA_DEFAULT_POPUP_TIMEOUT); + ppd->iSeconds = getDword(szBuff, MRA_DEFAULT_POPUP_TIMEOUT); MraPopupThreadMarandaCallback((ULONG_PTR)ppd); } diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index dd1353cebb..86b9d52f04 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -63,7 +63,7 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : hExtraInfo = ExtraIcon_Register("MRAStatus", LPGEN("Mail.ru extra info"), "mra_xstatus49"); bHideXStatusUI = FALSE; - m_iXStatus = getByte(NULL, DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE); + m_iXStatus = getByte(DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE); if ( !IsXStatusValid(m_iXStatus)) m_iXStatus = MRA_MIR_XSTATUS_NONE; @@ -417,7 +417,7 @@ int CMraProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* h } } - bSlowSend = getByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND); + bSlowSend = getByte("SlowSend", MRA_DEFAULT_SLOW_SEND); iRet = MraMessageW(bSlowSend, hContact, ACKTYPE_CONTACTS, MESSAGE_FLAG_CONTACT, szEMail, dwEMailSize, lpwszData, (lpwszDataCurrent-lpwszData), NULL, 0); if (bSlowSend == FALSE) ProtoBroadcastAck(hContact, ACKTYPE_CONTACTS, ACKRESULT_SUCCESS, (HANDLE)iRet, 0); @@ -468,8 +468,8 @@ int CMraProto::SendMsg(HANDLE hContact, int flags, const char *lpszMessage) size_t dwEMailSize; if ( mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) { - BOOL bSlowSend = getByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND); - if ( getByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact) & FEATURE_FLAG_RTF_MESSAGE)) + BOOL bSlowSend = getByte("SlowSend", MRA_DEFAULT_SLOW_SEND); + if ( getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact) & FEATURE_FLAG_RTF_MESSAGE)) dwFlags |= MESSAGE_FLAG_RTF; iRet = MraMessageW(bSlowSend, hContact, ACKTYPE_MESSAGE, dwFlags, szEMail, dwEMailSize, lpwszMessage, lstrlen(lpwszMessage), NULL, 0); diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index e47b815c0c..3506aa51bf 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -87,9 +87,6 @@ struct CMraProto : public PROTO __forceinline void MraPopupShowFromAgentW(DWORD dwType, DWORD dwFlags, LPWSTR lpszMessage) { MraPopupShowFromContactW(NULL, dwType, dwFlags, lpszMessage); } - __forceinline void mraDelValue(HANDLE Contact, const char *valueName) { - db_unset(Contact, m_szModuleName, valueName); } - __forceinline BOOL mraGetStaticStringA(HANDLE Contact, const char *ValueName, char *Ret, size_t RetBuffSize, size_t *pRetBuffSize) { return DB_GetStaticStringA(Contact, m_szModuleName, ValueName, Ret, RetBuffSize, pRetBuffSize); } __forceinline BOOL mraGetStaticStringW(HANDLE Contact, const char *ValueName, WCHAR *Ret, size_t RetBuffSize, size_t *pRetBuffSize) { diff --git a/protocols/MRA/src/MraRTFMsg.cpp b/protocols/MRA/src/MraRTFMsg.cpp index 52a370da10..f69d080b26 100644 --- a/protocols/MRA/src/MraRTFMsg.cpp +++ b/protocols/MRA/src/MraRTFMsg.cpp @@ -213,7 +213,7 @@ DWORD CMraProto::MraConvertToRTFW(LPCWSTR lpwszMessage, size_t dwMessageSize, LP WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszMessage, dwMessageSize, lpszMessage, (dwMessageSize+32), NULL, NULL); - dwRTFFontColour = getDword(NULL, "RTFFontColour", MRA_DEFAULT_RTF_FONT_COLOUR); + dwRTFFontColour = getDword("RTFFontColour", MRA_DEFAULT_RTF_FONT_COLOUR); if ( !mraGetContactSettingBlob(NULL, "RTFFont", &lf, sizeof(LOGFONT), NULL)) { HDC hDC = GetDC(NULL);// kegl lf.lfCharSet = MRA_DEFAULT_RTF_FONT_CHARSET; diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp index 4709a97415..55ffd86bba 100644 --- a/protocols/MRA/src/MraSendCommand.cpp +++ b/protocols/MRA/src/MraSendCommand.cpp @@ -107,7 +107,7 @@ DWORD CMraProto::MraMessageW(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, lpszMessageRTF = (LPSTR)mir_calloc(dwRFTBuffSize); ptrA lpbRTFData((char*)mir_calloc(dwRFTBuffSize)); if (lpszMessageRTF && lpbRTFData) { - DWORD dwBackColour = getDword(NULL, "RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR); + DWORD dwBackColour = getDword("RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR); lpbDataCurrent = (LPBYTE)lpszMessageRTF; WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszMessage, dwMessageSize, (LPSTR)lpbRTFData, dwRFTBuffSize, NULL, NULL); @@ -133,7 +133,7 @@ DWORD CMraProto::MraMessageW(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, ptrA lpbRTFData((char*)mir_calloc(dwRFTBuffSize)); if (lpszMessageRTF && lpbRTFData) { if ( !MraConvertToRTFW(lpwszMessage, dwMessageSize, (LPSTR)lpbRTFData, dwRFTBuffSize, &dwRTFDataSize)) { - DWORD dwBackColour = getDword(NULL, "RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR); + DWORD dwBackColour = getDword("RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR); lpbDataCurrent = (LPBYTE)lpszMessageRTF; SetUL(&lpbDataCurrent, 2); diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 6bb3bff0b3..c8eaa7b6df 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -635,18 +635,18 @@ DWORD CMraProto::MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus) if (hContact) { setByte(hContact, DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE); - mraDelValue(hContact, DBSETTING_XSTATUSNAME); - mraDelValue(hContact, DBSETTING_XSTATUSMSG); - mraDelValue(hContact, DBSETTING_BLOGSTATUSTIME); - mraDelValue(hContact, DBSETTING_BLOGSTATUSID); - mraDelValue(hContact, DBSETTING_BLOGSTATUS); - mraDelValue(hContact, DBSETTING_BLOGSTATUSMUSIC); + delSetting(hContact, DBSETTING_XSTATUSNAME); + delSetting(hContact, DBSETTING_XSTATUSMSG); + delSetting(hContact, DBSETTING_BLOGSTATUSTIME); + delSetting(hContact, DBSETTING_BLOGSTATUSID); + delSetting(hContact, DBSETTING_BLOGSTATUS); + delSetting(hContact, DBSETTING_BLOGSTATUSMUSIC); MraContactCapabilitiesSet(hContact, 0); if (bChatAgent) MraChatSessionDestroy(hContact); } setDword(hContact, "LogonTS", 0); - mraDelValue(hContact, "IP"); - mraDelValue(hContact, "RealIP"); + delSetting(hContact, "IP"); + delSetting(hContact, "RealIP"); }else { if (dwOldStatus == ID_STATUS_OFFLINE) { @@ -670,7 +670,7 @@ void CMraProto::MraUpdateEmailStatus(LPSTR lpszFrom, size_t dwFromSize, LPSTR lp BOOL bTrayIconNewMailNotify; WCHAR szStatusText[MAX_SECONDLINE]; - bTrayIconNewMailNotify = getByte(NULL, "TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY); + bTrayIconNewMailNotify = getByte("TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY); if (dwEmailMessagesUnread) { @@ -714,7 +714,7 @@ void CMraProto::MraUpdateEmailStatus(LPSTR lpszFrom, size_t dwFromSize, LPSTR lp cle.pszService = ""; cle.ptszTooltip = szStatusText; - if (getByte(NULL, "TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX)) + if (getByte("TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX)) { strncpy(szServiceFunction, m_szModuleName, MAX_PATH); pszServiceFunctionName = szServiceFunction+strlen(m_szModuleName); @@ -733,7 +733,7 @@ void CMraProto::MraUpdateEmailStatus(LPSTR lpszFrom, size_t dwFromSize, LPSTR lp MraPopupShowFromAgentW(MRA_POPUP_TYPE_EMAIL_STATUS, (MRA_POPUP_ALLOW_ENTER), szStatusText); } }else { - if (getByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY)) + if (getByte("IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY)) { if (bTrayIconNewMailNotify) CallService(MS_CLIST_REMOVEEVENT, 0, (LPARAM)m_szModuleName); PUDeletePopup(hWndEMailPopupStatus); @@ -1552,7 +1552,7 @@ BOOL CMraProto::SetPassDB(LPSTR lpszBuff, size_t dwBuffSize) RC4(btCryptedPass, sizeof(btCryptedPass), bthmacSHA1, SHA1HashSize); - setDword(NULL, "pCryptVer", MRA_PASS_CRYPT_VER); + setDword("pCryptVer", MRA_PASS_CRYPT_VER); mraWriteContactSettingBlob(NULL, "pCryptData", btRandomData, sizeof(btRandomData)); mraWriteContactSettingBlob(NULL, "pCryptPass", btCryptedPass, sizeof(btCryptedPass)); @@ -1569,7 +1569,7 @@ BOOL CMraProto::GetPassDB_v1(LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffS char szEMail[MAX_EMAIL_LEN] = {0}; size_t dwRandomDataSize, dwCryptedPass, dwEMailSize, dwPassSize; - if (getDword(NULL, "pCryptVer", 0) == 1) + if (getDword("pCryptVer", 0) == 1) if (mraGetContactSettingBlob(NULL, "pCryptData", btRandomData, sizeof(btRandomData), &dwRandomDataSize)) if (dwRandomDataSize == sizeof(btRandomData)) if (mraGetContactSettingBlob(NULL, "pCryptPass", btCryptedPass, sizeof(btCryptedPass), &dwCryptedPass)) @@ -1606,7 +1606,7 @@ BOOL CMraProto::GetPassDB_v2(LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffS char szEMail[MAX_EMAIL_LEN] = {0}; size_t dwRandomDataSize, dwCryptedPass, dwEMailSize, dwPassSize; - if (getDword(NULL, "pCryptVer", 0) == 2) + if (getDword("pCryptVer", 0) == 2) if (mraGetContactSettingBlob(NULL, "pCryptData", btRandomData, sizeof(btRandomData), &dwRandomDataSize)) if (dwRandomDataSize == sizeof(btRandomData)) if (mraGetContactSettingBlob(NULL, "pCryptPass", btCryptedPass, sizeof(btCryptedPass), &dwCryptedPass)) @@ -1641,7 +1641,7 @@ BOOL CMraProto::GetPassDB(LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSize mraGetStaticStringA(NULL, "Pass", lpszBuff, dwBuffSize, pdwBuffSize); return TRUE; #else - switch (getDword(NULL, "pCryptVer", 0)) { + switch (getDword("pCryptVer", 0)) { case 1: return GetPassDB_v1(lpszBuff, dwBuffSize, pdwBuffSize); case 2: diff --git a/protocols/MRA/src/Mra_options.cpp b/protocols/MRA/src/Mra_options.cpp index d97be771c1..ea80cce8c0 100644 --- a/protocols/MRA/src/Mra_options.cpp +++ b/protocols/MRA/src/Mra_options.cpp @@ -117,30 +117,30 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L else SET_DLG_ITEM_TEXTA(hWndDlg, IDC_SERVER, MRA_DEFAULT_SERVER); - SetDlgItemInt(hWndDlg, IDC_SERVERPORT, ppro->getWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT), FALSE); + SetDlgItemInt(hWndDlg, IDC_SERVERPORT, ppro->getWord("ServerPort", MRA_DEFAULT_SERVER_PORT), FALSE); // if set SSL proxy, setting will ignored - //CHECK_DLG_BUTTON(hWndDlg, IDC_KEEPALIVE, getByte(NULL, "keepalive", 0)); - CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER, ppro->getByte(NULL, "AutoAddContactsToServer", MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER)); - CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON, ppro->getByte(NULL, "AutoAuthRequestOnLogon", MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON)); - CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST, ppro->getByte(NULL, "AutoAuthGrandUsersInCList", MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST)); - CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS, ppro->getByte(NULL, "AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS)); - CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK, ppro->getByte(NULL, "AutoAuthGrandNewUsersDisableSPAMCheck", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK)); + //CHECK_DLG_BUTTON(hWndDlg, IDC_KEEPALIVE, getByte("keepalive", 0)); + CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER, ppro->getByte("AutoAddContactsToServer", MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER)); + CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON, ppro->getByte("AutoAuthRequestOnLogon", MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON)); + CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST, ppro->getByte("AutoAuthGrandUsersInCList", MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST)); + CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS, ppro->getByte("AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS)); + CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK, ppro->getByte("AutoAuthGrandNewUsersDisableSPAMCheck", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK)); EnableWindow(GetDlgItem(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS)); - CHECK_DLG_BUTTON(hWndDlg, IDC_SLOWSEND, ppro->getByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND)); - CHECK_DLG_BUTTON(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY, ppro->getByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY)); - CHECK_DLG_BUTTON(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY, ppro->getByte(NULL, "TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY)); - CHECK_DLG_BUTTON(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX, ppro->getByte(NULL, "TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX)); - EnableWindow(GetDlgItem(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX), ppro->getByte(NULL, "TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY)); + CHECK_DLG_BUTTON(hWndDlg, IDC_SLOWSEND, ppro->getByte("SlowSend", MRA_DEFAULT_SLOW_SEND)); + CHECK_DLG_BUTTON(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY, ppro->getByte("IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY)); + CHECK_DLG_BUTTON(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY, ppro->getByte("TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY)); + CHECK_DLG_BUTTON(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX, ppro->getByte("TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX)); + EnableWindow(GetDlgItem(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX), ppro->getByte("TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY)); - CHECK_DLG_BUTTON(hWndDlg, IDC_RTF_RECEIVE_ENABLE, ppro->getByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)); + CHECK_DLG_BUTTON(hWndDlg, IDC_RTF_RECEIVE_ENABLE, ppro->getByte("RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)); - CHECK_DLG_BUTTON(hWndDlg, IDC_RTF_SEND_ENABLE, ppro->getByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE)); - EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_SEND_SMART), ppro->getByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE)); - EnableWindow(GetDlgItem(hWndDlg, IDC_BUTTON_FONT), ppro->getByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE)); - EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_BGCOLOUR), ppro->getByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE)); - SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_RTF_BGCOLOUR, CPM_SETCOLOUR, 0, ppro->getDword(NULL, "RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR)); + CHECK_DLG_BUTTON(hWndDlg, IDC_RTF_SEND_ENABLE, ppro->getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE)); + EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_SEND_SMART), ppro->getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE)); + EnableWindow(GetDlgItem(hWndDlg, IDC_BUTTON_FONT), ppro->getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE)); + EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_BGCOLOUR), ppro->getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE)); + SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_RTF_BGCOLOUR, CPM_SETCOLOUR, 0, ppro->getDword("RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR)); return TRUE; case WM_COMMAND: @@ -167,7 +167,7 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L cf.lStructSize = sizeof(cf); cf.lpLogFont = &lf; - cf.rgbColors = ppro->getDword(NULL, "RTFFontColour", MRA_DEFAULT_RTF_FONT_COLOUR); + cf.rgbColors = ppro->getDword("RTFFontColour", MRA_DEFAULT_RTF_FONT_COLOUR); cf.Flags = (CF_SCREENFONTS|CF_EFFECTS|CF_FORCEFONTEXIST|CF_INITTOLOGFONTSTRUCT); if (ppro->mraGetContactSettingBlob(NULL, "RTFFont", &lf, sizeof(LOGFONT), NULL) == FALSE) { HDC hDC = GetDC(NULL);// kegl @@ -179,7 +179,7 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L if (ChooseFont(&cf)) { ppro->mraWriteContactSettingBlob(NULL, "RTFFont", &lf, sizeof(LOGFONT)); - ppro->setDword(NULL, "RTFFontColour", cf.rgbColors); + ppro->setDword("RTFFontColour", cf.rgbColors); } } break; @@ -193,21 +193,21 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L case PSN_APPLY: GET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szBuff, SIZEOF(szBuff)); ppro->mraSetStringW(NULL, "Server", szBuff); - ppro->setWord(NULL, "ServerPort", (WORD)GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE)); - ppro->setByte(NULL, "AutoAddContactsToServer", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER)); - ppro->setByte(NULL, "AutoAuthRequestOnLogon", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON)); - ppro->setByte(NULL, "AutoAuthGrandUsersInCList", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST)); - ppro->setByte(NULL, "AutoAuthGrandNewUsers", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS)); - ppro->setByte(NULL, "AutoAuthGrandNewUsersDisableSPAMCheck", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK)); - - ppro->setByte(NULL, "SlowSend", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SLOWSEND)); - ppro->setByte(NULL, "IncrementalNewMailNotify", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY)); - ppro->setByte(NULL, "TrayIconNewMailNotify", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY)); - ppro->setByte(NULL, "TrayIconNewMailClkToInbox", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX)); - - ppro->setByte(NULL, "RTFReceiveEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_RECEIVE_ENABLE)); - ppro->setByte(NULL, "RTFSendEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_SEND_ENABLE)); - ppro->setDword(NULL, "RTFBackgroundColour", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_RTF_BGCOLOUR, CPM_GETCOLOUR, 0, 0)); + ppro->setWord("ServerPort", (WORD)GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE)); + ppro->setByte("AutoAddContactsToServer", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER)); + ppro->setByte("AutoAuthRequestOnLogon", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON)); + ppro->setByte("AutoAuthGrandUsersInCList", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST)); + ppro->setByte("AutoAuthGrandNewUsers", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS)); + ppro->setByte("AutoAuthGrandNewUsersDisableSPAMCheck", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK)); + + ppro->setByte("SlowSend", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SLOWSEND)); + ppro->setByte("IncrementalNewMailNotify", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY)); + ppro->setByte("TrayIconNewMailNotify", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY)); + ppro->setByte("TrayIconNewMailClkToInbox", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX)); + + ppro->setByte("RTFReceiveEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_RECEIVE_ENABLE)); + ppro->setByte("RTFSendEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_SEND_ENABLE)); + ppro->setDword("RTFBackgroundColour", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_RTF_BGCOLOUR, CPM_GETCOLOUR, 0, 0)); return TRUE; } break; diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index ee8c91cd66..a733c433bf 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -54,12 +54,12 @@ void CMraProto::MraThreadProc(LPVOID lpParameter) SleepEx(100, FALSE);// to prevent high CPU load by some status plugins like allwaysonline - dwConnectReTryCount = getDword(NULL, "ConnectReTryCountMRIM", MRA_DEFAULT_CONN_RETRY_COUNT_MRIM); + dwConnectReTryCount = getDword("ConnectReTryCountMRIM", MRA_DEFAULT_CONN_RETRY_COUNT_MRIM); nloc.cbSize = sizeof(nloc); nloc.flags = NLOCF_V2; nloc.szHost = szHost; - nloc.timeout = getDword(NULL, "TimeOutConnectMRIM", MRA_DEFAULT_TIMEOUT_CONN_MRIM); + nloc.timeout = getDword("TimeOutConnectMRIM", MRA_DEFAULT_TIMEOUT_CONN_MRIM); if (nloc.timeoutMRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ; @@ -77,11 +77,11 @@ void CMraProto::MraThreadProc(LPVOID lpParameter) } if (bConnected == FALSE) - if (getByte(NULL, "NLBFailDirectConnect", MRA_DEFAULT_NLB_FAIL_DIRECT_CONNECT)) { + if (getByte("NLBFailDirectConnect", MRA_DEFAULT_NLB_FAIL_DIRECT_CONNECT)) { if (IsHTTPSProxyUsed(hNetlibUser)) nloc.wPort = MRA_SERVER_PORT_HTTPS; else { - nloc.wPort = getWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT); + nloc.wPort = getWord("ServerPort", MRA_DEFAULT_SERVER_PORT); if (nloc.wPort == MRA_SERVER_PORT_STANDART_NLB) nloc.wPort = MRA_SERVER_PORT_STANDART; } @@ -143,7 +143,7 @@ DWORD CMraProto::MraGetNLBData(LPSTR lpszHost, size_t dwHostBuffSize, WORD *pwPo NETLIBSELECT nls = {0}; NETLIBOPENCONNECTION nloc = {0}; - dwConnectReTryCount = getDword(NULL, "ConnectReTryCountNLB", MRA_DEFAULT_CONN_RETRY_COUNT_NLB); + dwConnectReTryCount = getDword("ConnectReTryCountNLB", MRA_DEFAULT_CONN_RETRY_COUNT_NLB); nloc.cbSize = sizeof(nloc); nloc.flags = NLOCF_V2; @@ -155,9 +155,9 @@ DWORD CMraProto::MraGetNLBData(LPSTR lpszHost, size_t dwHostBuffSize, WORD *pwPo if ( IsHTTPSProxyUsed(hNetlibUser)) nloc.wPort = MRA_SERVER_PORT_HTTPS; else - nloc.wPort = getWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT); + nloc.wPort = getWord("ServerPort", MRA_DEFAULT_SERVER_PORT); - nloc.timeout = getDword(NULL, "TimeOutConnectNLB", MRA_DEFAULT_TIMEOUT_CONN_NLB); + nloc.timeout = getDword("TimeOutConnectNLB", MRA_DEFAULT_TIMEOUT_CONN_NLB); if (nloc.timeoutMRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ; @@ -170,7 +170,7 @@ DWORD CMraProto::MraGetNLBData(LPSTR lpszHost, size_t dwHostBuffSize, WORD *pwPo if (nls.hReadConns[0]) { nls.cbSize = sizeof(nls); - nls.dwTimeout = 1000 * getDword(NULL, "TimeOutReceiveNLB", MRA_DEFAULT_TIMEOUT_RECV_NLB); + nls.dwTimeout = 1000 * getDword("TimeOutReceiveNLB", MRA_DEFAULT_TIMEOUT_RECV_NLB); InterlockedExchange((volatile LONG*)&dwThreadWorkerLastPingTime, GetTickCount()); while (m_iStatus != ID_STATUS_OFFLINE && bContinue) { @@ -434,7 +434,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd szSelfVersionString, __FILEVERSION_STRING, PROTO_VERSION_MAJOR, PROTO_VERSION_MINOR); } - dwFutureFlags = ((getByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS); + dwFutureFlags = ((getByte("RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS); if (mraGetStaticStringA(NULL, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) MraLogin2W(szEMail, dwEMailSize, (LPSTR)szBuff, dwStringSize, dwStatus, lpcszStatusUri[dwXStatus], lstrlenA(lpcszStatusUri[dwXStatus]), lpwszStatusTitle, dwStatusTitleSize, lpwszStatusDesc, dwStatusDescSize, dwFutureFlags, szUserAgentFormated, dwUserAgentFormattedSize, szSelfVersionString, dwSelfVersionSize); @@ -552,7 +552,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd if (lpszDelimiter) { (*lpszDelimiter) = 0; lpszDelimiter = (LPSTR)szBuff; - setDword(NULL, "IP", HTONL(inet_addr(lpszDelimiter))); + setDword("IP", HTONL(inet_addr(lpszDelimiter))); } } else if ( !_strnicmp(lpsString.lpszData, "connect.xml", 11)) { @@ -574,7 +574,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd } else if ( !_strnicmp(lpsString.lpszData, "micblog.status.time", 19)) { GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString); - setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); + setDword(DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); } else if ( !_strnicmp(lpsString.lpszData, "micblog.status.text", 19)) { GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString); @@ -582,31 +582,31 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd } else if ( !_strnicmp(lpsString.lpszData, "HAS_MYMAIL", 10)) { GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString); - //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); + //setDword(DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); } else if ( !_strnicmp(lpsString.lpszData, "mrim.status.open_search", 23)) { GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString); - //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); + //setDword(DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); } else if ( !_strnicmp(lpsString.lpszData, "rb.target.cookie", 16)) { GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString); - //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); + //setDword(DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); } else if ( !_strnicmp(lpsString.lpszData, "show_web_history_link", 21)) { GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString); - //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); + //setDword(DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); } else if ( !_strnicmp(lpsString.lpszData, "friends_suggest", 15)) { GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString); - //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); + //setDword(DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); } else if ( !_strnicmp(lpsString.lpszData, "timestamp", 9)) { GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString); - //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); + //setDword(DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); } else if ( !_strnicmp(lpsString.lpszData, "trusted_update", 14)) { GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString); - //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); + //setDword(DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize)); } else { #ifdef _DEBUG @@ -791,7 +791,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd if (dwTemp != ID_STATUS_OFFLINE) { // пишем клиента только если юзер не отключён, иначе не затираем старое if (lpsUserAgentFormated.dwSize) { - if (getByte(NULL, "MirVerRaw", MRA_DEFAULT_MIRVER_RAW) == FALSE) { + if (getByte("MirVerRaw", MRA_DEFAULT_MIRVER_RAW) == FALSE) { MraGetVersionStringFromFormatted(lpsUserAgentFormated.lpszData, lpsUserAgentFormated.dwSize, (LPSTR)szBuff, SIZEOF(szBuff), &dwStringSize); lpsUserAgentFormated.lpszData = (LPSTR)szBuff; lpsUserAgentFormated.dwSize = dwStringSize; @@ -917,7 +917,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd setByte(hContact, "Gender", 'F'); break; default:// а фиг его знает - mraDelValue(hContact, "Gender"); + delSetting(hContact, "Gender"); break; } } @@ -935,10 +935,10 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd setWord(hContact, "Age", (WORD)GetYears(&stTime)); } else { - mraDelValue(hContact, "BirthYear"); - mraDelValue(hContact, "BirthMonth"); - mraDelValue(hContact, "BirthDay"); - mraDelValue(hContact, "Age"); + delSetting(hContact, "BirthYear"); + delSetting(hContact, "BirthMonth"); + delSetting(hContact, "BirthDay"); + delSetting(hContact, "Age"); } } else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "City_id", 7)) { @@ -951,7 +951,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd } } } - else mraDelValue(hContact, "City"); + else delSetting(hContact, "City"); } else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Location", 8)) mraSetLPSStringW(hContact, "About", &pmralpsValues[i]); @@ -971,12 +971,12 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd } } } - else mraDelValue(hContact, "Country"); + else delSetting(hContact, "Country"); } else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Phone", 5)) { - mraDelValue(hContact, "Phone"); - mraDelValue(hContact, "Cellular"); - mraDelValue(hContact, "Fax"); + delSetting(hContact, "Phone"); + delSetting(hContact, "Cellular"); + delSetting(hContact, "Fax"); if (pmralpsValues[i].dwSize) { lpsString.lpszData = pmralpsValues[i].lpszData; @@ -1157,7 +1157,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd dwAckType = dwEmailMessagesUnread;// save old value dwEmailMessagesUnread = dwTemp;// store new value - if (getByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY) == 0 || dwAckTypecbSize != sizeof(LISTENINGTOINFO)) { MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, NULL, 0, 0); - mraDelValue(NULL, DBSETTING_BLOGSTATUSMUSIC); + delSetting(DBSETTING_BLOGSTATUSMUSIC); } else if (pliInfo->dwFlags & LTI_UNICODE) { LPWSTR pwszListeningTo; @@ -713,7 +713,7 @@ int CMraProto::MraMusicChanged(WPARAM wParam, LPARAM lParam) case WAT_EVENT_PLAYERSTATUS: // stopped if (1 == lParam) { - mraDelValue(NULL, DBSETTING_BLOGSTATUSMUSIC); + delSetting(DBSETTING_BLOGSTATUSMUSIC); MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, NULL, 0, 0); } break; @@ -760,16 +760,16 @@ DWORD CMraProto::MraSetXStatusInternal(DWORD dwXStatus) if (dwBuffSize>STATUS_DESC_MAX) dwBuffSize = STATUS_DESC_MAX; mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, szBuff, dwBuffSize); } - else mraDelValue(NULL, DBSETTING_XSTATUSMSG); + else delSetting(DBSETTING_XSTATUSMSG); } else { - mraDelValue(NULL, DBSETTING_XSTATUSNAME); - mraDelValue(NULL, DBSETTING_XSTATUSMSG); + delSetting(DBSETTING_XSTATUSNAME); + delSetting(DBSETTING_XSTATUSMSG); dwXStatus = MRA_MIR_XSTATUS_NONE; } dwOldStatusMode = InterlockedExchange((volatile LONG*)&m_iXStatus, dwXStatus); - setByte(NULL, DBSETTING_XSTATUSID, (BYTE)dwXStatus); + setByte(DBSETTING_XSTATUSID, (BYTE)dwXStatus); MraSendNewStatus(m_iStatus, dwXStatus, NULL, 0, NULL, 0); @@ -968,7 +968,7 @@ DWORD CMraProto::MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, LPCWSTR } } - MraChangeStatusW(dwStatus, lpcszStatusUri[dwXStatus], lstrlenA(lpcszStatusUri[dwXStatus]), lpwszStatusTitle, dwStatusTitleSize, lpwszStatusDesc, dwStatusDescSize, ((getByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS)); + MraChangeStatusW(dwStatus, lpcszStatusUri[dwXStatus], lstrlenA(lpcszStatusUri[dwXStatus]), lpwszStatusTitle, dwStatusTitleSize, lpwszStatusDesc, dwStatusDescSize, ((getByte("RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS)); return 0; } -- cgit v1.2.3