diff options
Diffstat (limited to 'protocols/MRA/src')
-rw-r--r-- | protocols/MRA/src/MraAdvancedSearch.cpp | 44 | ||||
-rw-r--r-- | protocols/MRA/src/MraAntiSpam.cpp | 48 | ||||
-rw-r--r-- | protocols/MRA/src/MraAvatars.h | 4 | ||||
-rw-r--r-- | protocols/MRA/src/MraChat.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/MraFilesQueue.cpp | 70 | ||||
-rw-r--r-- | protocols/MRA/src/MraMRIMProxy.cpp | 2 | ||||
-rw-r--r-- | protocols/MRA/src/MraPopUp.cpp | 34 | ||||
-rw-r--r-- | protocols/MRA/src/MraProto.cpp | 12 | ||||
-rw-r--r-- | protocols/MRA/src/MraProto.h | 15 | ||||
-rw-r--r-- | protocols/MRA/src/MraRTFMsg.cpp | 2 | ||||
-rw-r--r-- | protocols/MRA/src/MraSendCommand.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_functions.cpp | 68 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_options.cpp | 70 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 84 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_svcs.cpp | 10 |
15 files changed, 228 insertions, 243 deletions
diff --git a/protocols/MRA/src/MraAdvancedSearch.cpp b/protocols/MRA/src/MraAdvancedSearch.cpp index 15c087aed1..641464c497 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->mraGetByte(NULL, "AdvancedSearchRemember", MRA_DEFAULT_SEARCH_REMEMBER)) {
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_GENDER, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchGender", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_FROM, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchAgeFrom", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_TO, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchAgeTo", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_MONTH, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchBirthDayMonth", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_DAY, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchBirthDayDay", 0), 0);
+ 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);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchZodiakID", 0), 0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_SETCURSEL, ppro->getWord(NULL, "AdvancedSearchZodiakID", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_COUNTRY, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchCountryID", 0), 0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_COUNTRY, CB_SETCURSEL, ppro->getWord(NULL, "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->mraGetWord(NULL, "AdvancedSearchStateID", 0), 0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_STATE, CB_SETCURSEL, ppro->getWord(NULL, "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->mraGetWord(NULL, "AdvancedSearchCityID", 0), 0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_CITY, CB_SETCURSEL, ppro->getWord(NULL, "AdvancedSearchCityID", 0), 0);
- CHECK_DLG_BUTTON(hWndDlg, IDC_ONLINEONLY, ppro->mraGetByte(NULL, "AdvancedSearchOnlineOnly", FALSE));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_ONLINEONLY, ppro->getByte(NULL, "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->mraSetWord(NULL, "AdvancedSearchGender", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_GENDER, CB_GETCURSEL, 0, 0));
- ppro->mraSetWord(NULL, "AdvancedSearchAgeFrom", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_FROM, CB_GETCURSEL, 0, 0));
- ppro->mraSetWord(NULL, "AdvancedSearchAgeTo", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_TO, CB_GETCURSEL, 0, 0));
- ppro->mraSetWord(NULL, "AdvancedSearchBirthDayMonth", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_MONTH, CB_GETCURSEL, 0, 0));
- ppro->mraSetWord(NULL, "AdvancedSearchBirthDayDay", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_DAY, CB_GETCURSEL, 0, 0));
+ 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->mraSetWord(NULL, "AdvancedSearchZodiakID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_GETCURSEL, 0, 0));
+ ppro->setWord(NULL, "AdvancedSearchZodiakID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_GETCURSEL, 0, 0));
- ppro->mraSetWord(NULL, "AdvancedSearchCityID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_CITY, CB_GETCURSEL, 0, 0));
- ppro->mraSetWord(NULL, "AdvancedSearchStateID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_STATE, CB_GETCURSEL, 0, 0));
- ppro->mraSetWord(NULL, "AdvancedSearchCountryID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_COUNTRY, 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->mraSetByte(NULL, "AdvancedSearchOnlineOnly", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ONLINEONLY));
- ppro->mraSetByte(NULL, "AdvancedSearchRemember", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_REMEMBER));
+ ppro->setByte(NULL, "AdvancedSearchOnlineOnly", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ONLINEONLY));
+ ppro->setByte(NULL, "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 e3bc5edd82..527a1c8d81 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->mraGetByte(NULL, "AntiSpamEnable", MRA_ANTISPAM_DEFAULT_ENABLE));
- CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_TEMP_CONTACTS, ppro->mraGetByte(NULL, "AntiSpamCheckTempContacts", MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS));
- CHECK_DLG_BUTTON(hWndDlg, IDC_DELETE_SPAMBOT_CONTACT, ppro->mraGetByte(NULL, "AntiSpamDeteleSpamBotContacts", MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT));
- CHECK_DLG_BUTTON(hWndDlg, IDC_CLN_NON_ALPHNUM, ppro->mraGetByte(NULL, "AntiSpamCleanNonAlphaNumeric", MRA_ANTISPAM_DEFAULT_CLN_NON_ALPHNUM));
- SetDlgItemInt(hWndDlg, IDC_MAX_LANG_CHANGES, ppro->mraGetDword(NULL, "AntiSpamMaxLangChanges", MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES), FALSE);
- CHECK_DLG_BUTTON(hWndDlg, IDC_SHOWPOPUP, ppro->mraGetByte(NULL, "AntiSpamShowPopUp", MRA_ANTISPAM_DEFAULT_SHOWPOP));
- CHECK_DLG_BUTTON(hWndDlg, IDC_WRITETOSYSTEMHISTORY, ppro->mraGetByte(NULL, "AntiSpamWriteToSystemHistory", MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY));
- CHECK_DLG_BUTTON(hWndDlg, IDC_SEND_SPAM_REPORT_TO_SERVER, ppro->mraGetByte(NULL, "AntiSpamSendSpamReportToSrv", MRA_ANTISPAM_DEFAULT_SEND_SPAM_REPORT_TO_SERVER));
+ 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));
{
// 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->mraSetByte(NULL, "AntiSpamEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
- ppro->mraSetByte(NULL, "AntiSpamCheckTempContacts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_TEMP_CONTACTS));
- ppro->mraSetByte(NULL, "AntiSpamDeteleSpamBotContacts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_DELETE_SPAMBOT_CONTACT));
- ppro->mraSetByte(NULL, "AntiSpamCleanNonAlphaNumeric", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CLN_NON_ALPHNUM));
- ppro->mraSetDword(NULL, "AntiSpamMaxLangChanges", (DWORD)GetDlgItemInt(hWndDlg, IDC_MAX_LANG_CHANGES, NULL, FALSE));
- ppro->mraSetByte(NULL, "AntiSpamShowPopUp", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SHOWPOPUP));
- ppro->mraSetByte(NULL, "AntiSpamWriteToSystemHistory", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_WRITETOSYSTEMHISTORY));
- ppro->mraSetByte(NULL, "AntiSpamSendSpamReportToSrv", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SEND_SPAM_REPORT_TO_SERVER));
+ 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));
dwCount = SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_GETCOUNT, 0, 0);
for (i = 0; i < dwCount; i++) {
@@ -307,7 +307,7 @@ BOOL CMraProto::MraAntiSpamHasMessageBadWordsW(LPWSTR lpwszMessage, size_t dwMes CharLowerBuffW(lpwszMessageConverted, DWORD(dwMessageSize));
// 1 проход: считаем колличество переключений языка
- dwtm = mraGetDword(NULL, "AntiSpamMaxLangChanges", MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES);
+ dwtm = getDword(NULL, "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 (mraGetByte(NULL, "AntiSpamCleanNonAlphaNumeric", MRA_ANTISPAM_DEFAULT_ENABLE)) {
+ if (getByte(NULL, "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 (mraGetByte(NULL, "AntiSpamEnable", MRA_ANTISPAM_DEFAULT_ENABLE))
+ if (getByte(NULL, "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 (mraGetByte(NULL, "AntiSpamCheckTempContacts", MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS) == FALSE ||
- (((dwMessageFlags&MESSAGE_FLAG_AUTHORIZE) && mraGetByte(NULL, "AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS) && mraGetByte(NULL, "AutoAuthGrandNewUsersDisableSPAMCheck", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK))))
+ 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))))
{// проверка временного контакта
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)mraGetByte(NULL, "AntiSpamShowPopUp", MRA_ANTISPAM_DEFAULT_SHOWPOP);
- bAntiSpamWriteToSystemHistory = (BOOL)mraGetByte(NULL, "AntiSpamWriteToSystemHistory", MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY);
- bAntiSpamDeteleSpamBotContacts = (BOOL)mraGetByte(NULL, "AntiSpamDeteleSpamBotContacts", MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT);
+ 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);
if (bAntiSpamShowPopup || bAntiSpamWriteToSystemHistory) {
char szEMail[MAX_EMAIL_LEN];
diff --git a/protocols/MRA/src/MraAvatars.h b/protocols/MRA/src/MraAvatars.h index 67c0eff121..683fb525e0 100644 --- a/protocols/MRA/src/MraAvatars.h +++ b/protocols/MRA/src/MraAvatars.h @@ -7,8 +7,8 @@ #endif // _MSC_VER > 1000
#define PA_FORMAT_DEFAULT 255 // return file name of def avatar
-#define GetContactAvatarFormat(hContact, dwDefaultFormat) mraGetByte(hContact, "AvatarType", dwDefaultFormat)
-#define SetContactAvatarFormat(hContact, dwFormat) mraSetByte(hContact, "AvatarType", (BYTE)dwFormat)
+#define GetContactAvatarFormat(hContact, dwDefaultFormat) getByte(hContact, "AvatarType", dwDefaultFormat)
+#define SetContactAvatarFormat(hContact, dwFormat) setByte(hContact, "AvatarType", (BYTE)dwFormat)
INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp index a7e55bc247..9efcbb1e2c 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 = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
+ BOOL bSlowSend = getByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
DWORD dwFlags = 0;
- if (mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact)&FEATURE_FLAG_RTF_MESSAGE))
+ if (getByte(NULL, "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 21d853f511..7ba7402c54 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->mraGetByte(NULL, "FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN));
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE, ppro->mraGetByte(NULL, "FileSendNoOutConnOnRcv", MRA_DEF_FS_NO_OUT_CONN_ON_RCV));
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND, ppro->mraGetByte(NULL, "FileSendNoOutConnOnSend", MRA_DEF_FS_NO_OUT_CONN_ON_SEND));
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS, ppro->mraGetByte(NULL, "FileSendIgnoryAdditionalPorts", MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS));
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES, ppro->mraGetByte(NULL, "FileSendHideMyAddresses", MRA_DEF_FS_HIDE_MY_ADDRESSES));
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS, ppro->mraGetByte(NULL, "FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES));
+ 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));
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->mraGetByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS, ppro->getByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS));
- SetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, ppro->mraGetDword(NULL, "FileSendBlockSize", MRA_DEFAULT_FILE_SEND_BLOCK_SIZE), FALSE);
+ SetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, ppro->getDword(NULL, "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->mraSetByte(NULL, "FileSendEnableDirectConn", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN));
- ppro->mraSetByte(NULL, "FileSendNoOutConnOnRcv", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE));
- ppro->mraSetByte(NULL, "FileSendNoOutConnOnSend", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND));
- ppro->mraSetByte(NULL, "FileSendIgnoryAdditionalPorts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS));
- ppro->mraSetByte(NULL, "FileSendHideMyAddresses", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES));
- ppro->mraSetByte(NULL, "FileSendAddExtraAddresses", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
+ 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));
GET_DLG_ITEM_TEXT(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS, szBuff, SIZEOF(szBuff));
ppro->mraSetStringW(NULL, "FileSendExtraAddresses", szBuff);
- ppro->mraSetDword(NULL, "FileSendBlockSize", (DWORD)GetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, NULL, FALSE));
- ppro->mraSetByte(NULL, "FileSendEnableMRIMProxyCons", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS));
+ 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));
}
return TRUE;
}
@@ -231,9 +231,9 @@ size_t CMraProto::MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBu CHAR szHostName[MAX_PATH] = {0};
LPSTR lpszCurPos = lpszBuff;
- if (mraGetByte(NULL, "FileSendHideMyAddresses", MRA_DEF_FS_HIDE_MY_ADDRESSES))
+ if (getByte(NULL, "FileSendHideMyAddresses", MRA_DEF_FS_HIDE_MY_ADDRESSES))
{// не выдаём врагу наш IP адрес!!! :)
- if (mraGetByte(NULL, "FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES) == FALSE)
+ if (getByte(NULL, "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(mraGetDword(NULL, "IP", 0));
+ dwSelfExternalIP = NTOHL(getDword(NULL, "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 (mraGetByte(NULL, "FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES))// добавляем произвольный адрес
+ if (getByte(NULL, "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 || !mraGetByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS))
+ if (!hFilesQueueHandle || !getByte(NULL, "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 (mraGetByte(NULL, "FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN) && InterlockedExchangeAdd((volatile LONG*)&dat->bIsWorking, 0) && ((dat->bSending == FALSE && mraGetByte(NULL, "FileSendNoOutConnOnRcv", MRA_DEF_FS_NO_OUT_CONN_ON_RCV) == FALSE) || (dat->bSending == TRUE && mraGetByte(NULL, "FileSendNoOutConnOnSend", MRA_DEF_FS_NO_OUT_CONN_ON_SEND) == FALSE))) {
+ 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))) {
BOOL bFiltering = FALSE, bIsHTTPSProxyUsed = IsHTTPSProxyUsed(hNetlibUser);
DWORD dwLocalPort = 0, dwConnectReTryCount, dwCurConnectReTryCount;
size_t dwAddrCount;
NETLIBOPENCONNECTION nloc = {0};
- if (mraGetByte(NULL, "FileSendIgnoryAdditionalPorts", MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS) || bIsHTTPSProxyUsed)
+ if (getByte(NULL, "FileSendIgnoryAdditionalPorts", MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS) || bIsHTTPSProxyUsed)
{// фильтруем порты для одного IP, вместо 3 будем коннектится только к одному
if (bIsHTTPSProxyUsed)
dwLocalPort = MRA_SERVER_PORT_HTTPS;
- else if ((dwLocalPort = mraGetWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT)) == MRA_SERVER_PORT_STANDART_NLB)
+ else if ((dwLocalPort = getWord(NULL, "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 = mraGetDword(NULL, "ConnectReTryCountFileSend", MRA_DEFAULT_CONN_RETRY_COUNT_FILES);
+ dwConnectReTryCount = getDword(NULL, "ConnectReTryCountFileSend", MRA_DEFAULT_CONN_RETRY_COUNT_FILES);
nloc.cbSize = sizeof(nloc);
nloc.flags = NLOCF_V2;
- nloc.timeout = mraGetDword(NULL, "TimeOutConnectFileSend", ((MRA_TIMEOUT_DIRECT_CONN-1)/(dwAddrCount*dwConnectReTryCount)));// -1 сек чтобы был запас
+ nloc.timeout = getDword(NULL, "TimeOutConnectFileSend", ((MRA_TIMEOUT_DIRECT_CONN-1)/(dwAddrCount*dwConnectReTryCount)));// -1 сек чтобы был запас
if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
@@ -497,8 +497,8 @@ HANDLE CMraProto::MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *dat) ProtoBroadcastAck(dat->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)dat->dwIDRequest, 0);
if (MraFilesQueueHandCheck(dat->hConnection, dat)) {
// связь установленная с тем кем нужно
- mraSetDword(dat->hContact, "OldIP", mraGetDword(dat->hContact, "IP", 0));
- mraSetDword(dat->hContact, "IP", HTONL(dat->malAddrList.pmaliAddress[i].dwAddr));
+ setDword(dat->hContact, "OldIP", getDword(dat->hContact, "IP", 0));
+ setDword(dat->hContact, "IP", HTONL(dat->malAddrList.pmaliAddress[i].dwAddr));
break;
}
else {
@@ -543,7 +543,7 @@ HANDLE CMraProto::MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *dat) size_t dwAddrListSize;
// копируем адреса в соответствии с правилами и начинаем слушать порт
- if (mraGetByte(NULL, "FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN)) {
+ if (getByte(NULL, "FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN)) {
NETLIBBIND nlbBind = {0};
nlbBind.cbSize = sizeof(nlbBind);
@@ -628,8 +628,8 @@ void MraFilesQueueConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, vo if ( dat->ppro->MraFilesQueueHandCheck(hNewConnection, dat)) { // связь установленная с тем кем нужно
dat->hConnection = hNewConnection;
ProtoBroadcastAck(dat->ppro->m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)dat->dwIDRequest, 0);
- dat->ppro->mraSetDword(dat->hContact, "OldIP", dat->ppro->mraGetDword(dat->hContact, "IP", 0));
- dat->ppro->mraSetDword(dat->hContact, "IP", dwRemoteIP);
+ dat->ppro->setDword(dat->hContact, "OldIP", dat->ppro->getDword(dat->hContact, "IP", 0));
+ dat->ppro->setDword(dat->hContact, "IP", dwRemoteIP);
SetEvent(dat->hWaitHandle);
}else {// кажется кто то не туда подключилися :)
ProtoBroadcastAck(dat->ppro->m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_LISTENING, (HANDLE)dat->dwIDRequest, 0);
@@ -663,7 +663,7 @@ DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags dat->dwIDRequest = dwIDRequest;
dat->dwFlags = dwFlags;
dat->hContact = hContact;
- if (mraGetByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS))
+ if (getByte(NULL, "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*mraGetDword(NULL, "TimeOutReceiveFileData", MRA_DEF_FS_TIMEOUT_RECV));
+ nls.dwTimeout = (1000*getDword(NULL, "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 (mraGetByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) dat->hMraMrimProxyData = MraMrimProxyCreate();
+ if (getByte(NULL, "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 = mraGetDword(NULL, "FileSendBlockSize", MRA_DEFAULT_FILE_SEND_BLOCK_SIZE);
+ dwSendBlockSize = getDword(NULL, "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 ebb4bfc722..bdbdf8eac6 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 = mraGetDword(NULL, "ConnectReTryCountMRIMProxy", MRA_DEFAULT_CONN_RETRY_COUNT_MRIMPROXY);
+ dwConnectReTryCount = getDword(NULL, "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 0f301ade1c..3b6a4a46fa 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->mraGetDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType);
+ bEnabled = GetBit(ppro->getDword(NULL, "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->mraGetByte(NULL, szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
+ bUseWinColors = ppro->getByte(NULL, 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->mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_BACK));
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL, 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->mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT));
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL, 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->mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_TIMEOUT), FALSE);
+ SetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, ppro->getDword(NULL, 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->mraGetDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER);
+ DWORD dwPopupsEventFilter = ppro->getDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER);
if (IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_ENABLE))
dwPopupsEventFilter |= (1<<dwType);
else
dwPopupsEventFilter &= ~(1<<dwType);
- ppro->mraSetDword(NULL, "PopupsEventFilter", dwPopupsEventFilter);
+ ppro->setDword(NULL, "PopupsEventFilter", dwPopupsEventFilter);
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
- ppro->mraSetByte(NULL, szBuff, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS));
+ ppro->setByte(NULL, szBuff, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
- ppro->mraSetDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_GETCOLOUR, 0, 0));
+ ppro->setDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_GETCOLOUR, 0, 0));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
- ppro->mraSetDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0));
+ ppro->setDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
- ppro->mraSetDword(NULL, szBuff, GetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, NULL, FALSE));
+ ppro->setDword(NULL, 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 (mraGetByte(NULL, "PopupsEnabled", MRA_DEFAULT_POPUPS_ENABLED))
- if (GetBit(mraGetDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType))
+ if (getByte(NULL, "PopupsEnabled", MRA_DEFAULT_POPUPS_ENABLED))
+ if (GetBit(getDword(NULL, "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 = mraGetByte(NULL, szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
+ bUseWinColors = getByte(NULL, 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 = mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_BACK);
+ ppd->colorBack = getDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_BACK);
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
- ppd->colorText = mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT);
+ ppd->colorText = getDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT);
}
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
- ppd->iSeconds = mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_TIMEOUT);
+ ppd->iSeconds = getDword(NULL, szBuff, MRA_DEFAULT_POPUP_TIMEOUT);
MraPopupThreadMarandaCallback((ULONG_PTR)ppd);
}
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 50bb5891b1..dd1353cebb 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 = mraGetByte(NULL, DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE);
+ m_iXStatus = getByte(NULL, 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 = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
+ bSlowSend = getByte(NULL, "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 = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
- if ( mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact) & FEATURE_FLAG_RTF_MESSAGE))
+ BOOL bSlowSend = getByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
+ if ( getByte(NULL, "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);
@@ -490,7 +490,7 @@ int CMraProto::SetApparentMode(HANDLE hContact, int mode) // Only 3 modes are supported
if (hContact && (mode == 0 || mode == ID_STATUS_ONLINE || mode == ID_STATUS_OFFLINE)) {
- DWORD dwOldMode = mraGetWord(hContact, "ApparentMode", 0);
+ DWORD dwOldMode = getWord(hContact, "ApparentMode", 0);
// Dont send redundant updates
if (mode != dwOldMode) {
@@ -598,7 +598,7 @@ HANDLE CMraProto::GetAwayMsg(HANDLE hContact) if ( mraGetStaticStringW(hContact, DBSETTING_BLOGSTATUS, szBlogStatus, SIZEOF(szBlogStatus), NULL)) {
SYSTEMTIME tt = {0};
- dwTime = mraGetDword(hContact, DBSETTING_BLOGSTATUSTIME, 0);
+ dwTime = getDword(hContact, DBSETTING_BLOGSTATUSTIME, 0);
if (dwTime && MakeLocalSystemTimeFromTime32(dwTime, &tt))
mir_sntprintf(szTime, SIZEOF(szTime), _T("%04ld.%02ld.%02ld %02ld:%02ld: "), tt.wYear, tt.wMonth, tt.wDay, tt.wHour, tt.wMinute);
else
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index 0037dcb81c..e47b815c0c 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -90,21 +90,6 @@ struct CMraProto : public PROTO<CMraProto> __forceinline void mraDelValue(HANDLE Contact, const char *valueName) {
db_unset(Contact, m_szModuleName, valueName); }
- __forceinline DWORD mraGetDword(HANDLE Contact, const char *valueName, DWORD parDefltValue) {
- return db_get_dw(Contact, m_szModuleName, valueName, parDefltValue); }
- __forceinline void mraSetDword(HANDLE Contact, const char *valueName, DWORD parValue) {
- db_set_dw(Contact, m_szModuleName, valueName, parValue); }
-
- __forceinline WORD mraGetWord(HANDLE Contact, const char *valueName, WORD parDefltValue) {
- return db_get_w(Contact, m_szModuleName, valueName, parDefltValue); }
- __forceinline void mraSetWord(HANDLE Contact, const char *valueName, WORD parValue) {
- db_set_w(Contact, m_szModuleName, valueName, parValue); }
-
- __forceinline BYTE mraGetByte(HANDLE Contact, const char *valueName, BYTE parDefltValue) {
- return db_get_b(Contact, m_szModuleName, valueName, parDefltValue); }
- __forceinline void mraSetByte(HANDLE Contact, const char *valueName, BYTE parValue) {
- db_set_b(Contact, m_szModuleName, valueName, parValue); }
-
__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 34a6389f2e..52a370da10 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 = mraGetDword(NULL, "RTFFontColour", MRA_DEFAULT_RTF_FONT_COLOUR);
+ dwRTFFontColour = getDword(NULL, "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 00f7558033..4709a97415 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 = mraGetDword(NULL, "RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR);
+ DWORD dwBackColour = getDword(NULL, "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 = mraGetDword(NULL, "RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR);
+ DWORD dwBackColour = getDword(NULL, "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 3d5b14bc64..6bb3bff0b3 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -186,11 +186,11 @@ void CMraProto::MraAddrListStoreToContact(HANDLE hContact, MRA_ADDR_LIST *pmalAd if (!pmalAddrList->dwAddrCount)
return;
- mraSetDword(hContact, "OldIP", mraGetDword(hContact, "IP", 0));
- mraSetDword(hContact, "IP", HTONL(pmalAddrList->pmaliAddress[0].dwAddr));
+ setDword(hContact, "OldIP", getDword(hContact, "IP", 0));
+ setDword(hContact, "IP", HTONL(pmalAddrList->pmaliAddress[0].dwAddr));
if (pmalAddrList->dwAddrCount > 1) {
- mraSetDword(hContact, "OldRealIP", mraGetDword(hContact, "RealIP", 0));
- mraSetDword(hContact, "RealIP", HTONL(pmalAddrList->pmaliAddress[1].dwAddr));
+ setDword(hContact, "OldRealIP", getDword(hContact, "RealIP", 0));
+ setDword(hContact, "RealIP", HTONL(pmalAddrList->pmaliAddress[1].dwAddr));
}
}
@@ -343,7 +343,7 @@ DWORD CMraProto::GetContactFlags(HANDLE hContact) CHAR szEMail[MAX_EMAIL_LEN];
size_t dwEMailSize;
- dwRet = mraGetDword(hContact, "ContactFlags", 0);
+ dwRet = getDword(hContact, "ContactFlags", 0);
dwRet &= ~(CONTACT_FLAG_REMOVED|CONTACT_FLAG_GROUP|CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE|CONTACT_FLAG_IGNORE|CONTACT_FLAG_SHADOW|CONTACT_FLAG_MULTICHAT);
dwRet |= CONTACT_FLAG_UNICODE_NAME;
@@ -357,7 +357,7 @@ DWORD CMraProto::GetContactFlags(HANDLE hContact) if (db_get_b(hContact, "CList", "Hidden", 0)) dwRet |= CONTACT_FLAG_SHADOW;
- switch (mraGetWord(hContact, "ApparentMode", 0)) {
+ switch (getWord(hContact, "ApparentMode", 0)) {
case ID_STATUS_OFFLINE:
dwRet |= CONTACT_FLAG_INVISIBLE;
break;
@@ -376,7 +376,7 @@ DWORD CMraProto::SetContactFlags(HANDLE hContact, DWORD dwContactFlag) if ( !IsContactMra(hContact))
return ERROR_INVALID_HANDLE;
- mraSetDword(hContact, "ContactFlags", dwContactFlag);
+ setDword(hContact, "ContactFlags", dwContactFlag);
if (dwContactFlag&CONTACT_FLAG_SHADOW)
db_set_b(hContact, "CList", "Hidden", 1);
@@ -385,13 +385,13 @@ DWORD CMraProto::SetContactFlags(HANDLE hContact, DWORD dwContactFlag) switch (dwContactFlag&(CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE)) {
case CONTACT_FLAG_INVISIBLE:
- mraSetWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
+ setWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
break;
case CONTACT_FLAG_VISIBLE:
- mraSetWord(hContact, "ApparentMode", ID_STATUS_ONLINE);
+ setWord(hContact, "ApparentMode", ID_STATUS_ONLINE);
break;
default:
- mraSetWord(hContact, "ApparentMode", 0);
+ setWord(hContact, "ApparentMode", 0);
break;
}
@@ -409,11 +409,11 @@ DWORD CMraProto::GetContactBasicInfoW(HANDLE hContact, DWORD *pdwID, DWORD *pdwG return ERROR_INVALID_HANDLE;
if (pdwID)
- *pdwID = mraGetDword(hContact, "ContactID", -1);
+ *pdwID = getDword(hContact, "ContactID", -1);
if (pdwGroupID)
- *pdwGroupID = mraGetDword(hContact, "GroupID", -1);
+ *pdwGroupID = getDword(hContact, "GroupID", -1);
if (pdwContactSeverFlags)
- *pdwContactSeverFlags = mraGetDword(hContact, "ContactSeverFlags", 0);
+ *pdwContactSeverFlags = getDword(hContact, "ContactSeverFlags", 0);
if (pdwStatus)
*pdwStatus = MraGetContactStatus(hContact);
if (pdwContactFlag)
@@ -447,11 +447,11 @@ DWORD CMraProto::SetContactBasicInfoW(HANDLE hContact, DWORD dwSetInfoFlags, DWO // LOCK
if (dwSetInfoFlags & SCBIFSI_LOCK_CHANGES_EVENTS)
- mraSetDword(hContact, "HooksLocked", TRUE);
+ setDword(hContact, "HooksLocked", TRUE);
// поля которые нужны, и изменения которых не отслеживаются
if (dwFlags & SCBIF_ID)
- mraSetDword(hContact, "ContactID", dwID);
+ setDword(hContact, "ContactID", dwID);
if (dwFlags & SCBIF_EMAIL)
if (lpszEMail && dwEMailSize)
@@ -459,7 +459,7 @@ DWORD CMraProto::SetContactBasicInfoW(HANDLE hContact, DWORD dwSetInfoFlags, DWO // поля изменения которых отслеживаются
if (dwFlags & SCBIF_GROUP_ID)
- mraSetDword(hContact, "GroupID", dwGroupID);
+ setDword(hContact, "GroupID", dwGroupID);
if (dwFlags & SCBIF_NICK) {
if ((dwFlags & SCBIF_FLAG) && ((dwContactFlag&CONTACT_FLAG_UNICODE_NAME) == 0))
@@ -504,7 +504,7 @@ DWORD CMraProto::SetContactBasicInfoW(HANDLE hContact, DWORD dwSetInfoFlags, DWO SetContactFlags(hContact, dwContactFlag);
if (dwFlags & SCBIF_SERVER_FLAG)
- mraSetDword(hContact, "ContactSeverFlags", dwContactSeverFlags);
+ setDword(hContact, "ContactSeverFlags", dwContactSeverFlags);
if (dwFlags & SCBIF_STATUS)
MraSetContactStatus(hContact, dwStatus);
@@ -512,7 +512,7 @@ DWORD CMraProto::SetContactBasicInfoW(HANDLE hContact, DWORD dwSetInfoFlags, DWO SetExtraIcons(hContact);
// UNLOCK
if (dwSetInfoFlags & SCBIFSI_LOCK_CHANGES_EVENTS)
- mraSetDword(hContact, "HooksLocked", FALSE);
+ setDword(hContact, "HooksLocked", FALSE);
return 0;
}
@@ -607,17 +607,17 @@ BOOL CMraProto::MraUpdateContactInfo(HANDLE hContact) DWORD CMraProto::MraContactCapabilitiesGet(HANDLE hContact)
{
- return mraGetDword(hContact, DBSETTING_CAPABILITIES, 0);
+ return getDword(hContact, DBSETTING_CAPABILITIES, 0);
}
void CMraProto::MraContactCapabilitiesSet(HANDLE hContact, DWORD dwFutureFlags)
{
- mraSetDword(hContact, DBSETTING_CAPABILITIES, dwFutureFlags);
+ setDword(hContact, DBSETTING_CAPABILITIES, dwFutureFlags);
}
DWORD CMraProto::MraGetContactStatus(HANDLE hContact)
{
- return mraGetWord(hContact, "Status", ID_STATUS_OFFLINE);
+ return getWord(hContact, "Status", ID_STATUS_OFFLINE);
}
DWORD CMraProto::MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus)
@@ -634,7 +634,7 @@ DWORD CMraProto::MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus) {
if (hContact)
{
- mraSetByte(hContact, DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE);
+ setByte(hContact, DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE);
mraDelValue(hContact, DBSETTING_XSTATUSNAME);
mraDelValue(hContact, DBSETTING_XSTATUSMSG);
mraDelValue(hContact, DBSETTING_BLOGSTATUSTIME);
@@ -644,7 +644,7 @@ DWORD CMraProto::MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus) MraContactCapabilitiesSet(hContact, 0);
if (bChatAgent) MraChatSessionDestroy(hContact);
}
- mraSetDword(hContact, "LogonTS", 0);
+ setDword(hContact, "LogonTS", 0);
mraDelValue(hContact, "IP");
mraDelValue(hContact, "RealIP");
}else {
@@ -652,15 +652,15 @@ DWORD CMraProto::MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus) {
DWORD dwTime = (DWORD)_time32(NULL);
- mraSetDword(hContact, "LogonTS", dwTime);
- mraSetDword(hContact, "OldLogonTS", dwTime);
+ setDword(hContact, "LogonTS", dwTime);
+ setDword(hContact, "OldLogonTS", dwTime);
if (bChatAgent) MraChatSessionNew(hContact);
}
MraAvatarsQueueGetAvatarSimple(hAvatarsQueueHandle, 0, hContact, 0);
}
- mraSetWord(hContact, "Status", (WORD)dwNewStatus);
+ setWord(hContact, "Status", (WORD)dwNewStatus);
}
return(dwOldStatus);
}
@@ -670,7 +670,7 @@ void CMraProto::MraUpdateEmailStatus(LPSTR lpszFrom, size_t dwFromSize, LPSTR lp BOOL bTrayIconNewMailNotify;
WCHAR szStatusText[MAX_SECONDLINE];
- bTrayIconNewMailNotify = mraGetByte(NULL, "TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY);
+ bTrayIconNewMailNotify = getByte(NULL, "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 (mraGetByte(NULL, "TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX))
+ if (getByte(NULL, "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 (mraGetByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY))
+ if (getByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY))
{
if (bTrayIconNewMailNotify) CallService(MS_CLIST_REMOVEEVENT, 0, (LPARAM)m_szModuleName);
PUDeletePopup(hWndEMailPopupStatus);
@@ -1304,7 +1304,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w }
else SendMessage(hWndDlg, WM_SETTEXT, 0, (LPARAM)TranslateW(L"Set my blog status"));
- DWORD dwTime = dat->ppro->mraGetDword(dat->hContact, DBSETTING_BLOGSTATUSTIME, 0);
+ DWORD dwTime = dat->ppro->getDword(dat->hContact, DBSETTING_BLOGSTATUSTIME, 0);
if (dwTime && MakeLocalSystemTimeFromTime32(dwTime, &stBlogStatusTime))
mir_sntprintf(szBuff, SIZEOF(szBuff), L"%s: %04ld.%02ld.%02ld %02ld:%02ld", TranslateW(L"Writed"), stBlogStatusTime.wYear, stBlogStatusTime.wMonth, stBlogStatusTime.wDay, stBlogStatusTime.wHour, stBlogStatusTime.wMinute);
else
@@ -1552,7 +1552,7 @@ BOOL CMraProto::SetPassDB(LPSTR lpszBuff, size_t dwBuffSize) RC4(btCryptedPass, sizeof(btCryptedPass), bthmacSHA1, SHA1HashSize);
- mraSetDword(NULL, "pCryptVer", MRA_PASS_CRYPT_VER);
+ setDword(NULL, "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 (mraGetDword(NULL, "pCryptVer", 0) == 1)
+ if (getDword(NULL, "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 (mraGetDword(NULL, "pCryptVer", 0) == 2)
+ if (getDword(NULL, "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 (mraGetDword(NULL, "pCryptVer", 0)) {
+ switch (getDword(NULL, "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 30e4be9759..d97be771c1 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->mraGetWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT), FALSE);
+ SetDlgItemInt(hWndDlg, IDC_SERVERPORT, ppro->getWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT), FALSE);
// if set SSL proxy, setting will ignored
- //CHECK_DLG_BUTTON(hWndDlg, IDC_KEEPALIVE, mraGetByte(NULL, "keepalive", 0));
- CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER, ppro->mraGetByte(NULL, "AutoAddContactsToServer", MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER));
- CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON, ppro->mraGetByte(NULL, "AutoAuthRequestOnLogon", MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON));
- CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST, ppro->mraGetByte(NULL, "AutoAuthGrandUsersInCList", MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST));
- CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS, ppro->mraGetByte(NULL, "AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS));
- CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK, ppro->mraGetByte(NULL, "AutoAuthGrandNewUsersDisableSPAMCheck", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK));
+ //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));
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->mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND));
- CHECK_DLG_BUTTON(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY, ppro->mraGetByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY));
- CHECK_DLG_BUTTON(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY, ppro->mraGetByte(NULL, "TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY));
- CHECK_DLG_BUTTON(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX, ppro->mraGetByte(NULL, "TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX));
- EnableWindow(GetDlgItem(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX), ppro->mraGetByte(NULL, "TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY));
+ 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_RTF_RECEIVE_ENABLE, ppro->mraGetByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_RTF_RECEIVE_ENABLE, ppro->getByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE));
- CHECK_DLG_BUTTON(hWndDlg, IDC_RTF_SEND_ENABLE, ppro->mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE));
- EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_SEND_SMART), ppro->mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE));
- EnableWindow(GetDlgItem(hWndDlg, IDC_BUTTON_FONT), ppro->mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE));
- EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_BGCOLOUR), ppro->mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE));
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_RTF_BGCOLOUR, CPM_SETCOLOUR, 0, ppro->mraGetDword(NULL, "RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR));
+ 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));
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->mraGetDword(NULL, "RTFFontColour", MRA_DEFAULT_RTF_FONT_COLOUR);
+ cf.rgbColors = ppro->getDword(NULL, "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->mraSetDword(NULL, "RTFFontColour", cf.rgbColors);
+ ppro->setDword(NULL, "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->mraSetWord(NULL, "ServerPort", (WORD)GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
- ppro->mraSetByte(NULL, "AutoAddContactsToServer", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER));
- ppro->mraSetByte(NULL, "AutoAuthRequestOnLogon", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON));
- ppro->mraSetByte(NULL, "AutoAuthGrandUsersInCList", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST));
- ppro->mraSetByte(NULL, "AutoAuthGrandNewUsers", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS));
- ppro->mraSetByte(NULL, "AutoAuthGrandNewUsersDisableSPAMCheck", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK));
-
- ppro->mraSetByte(NULL, "SlowSend", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SLOWSEND));
- ppro->mraSetByte(NULL, "IncrementalNewMailNotify", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY));
- ppro->mraSetByte(NULL, "TrayIconNewMailNotify", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY));
- ppro->mraSetByte(NULL, "TrayIconNewMailClkToInbox", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX));
-
- ppro->mraSetByte(NULL, "RTFReceiveEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_RECEIVE_ENABLE));
- ppro->mraSetByte(NULL, "RTFSendEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_SEND_ENABLE));
- ppro->mraSetDword(NULL, "RTFBackgroundColour", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_RTF_BGCOLOUR, CPM_GETCOLOUR, 0, 0));
+ 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));
return TRUE;
}
break;
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 8b4a9318ed..ee8c91cd66 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 = mraGetDword(NULL, "ConnectReTryCountMRIM", MRA_DEFAULT_CONN_RETRY_COUNT_MRIM);
+ dwConnectReTryCount = getDword(NULL, "ConnectReTryCountMRIM", MRA_DEFAULT_CONN_RETRY_COUNT_MRIM);
nloc.cbSize = sizeof(nloc);
nloc.flags = NLOCF_V2;
nloc.szHost = szHost;
- nloc.timeout = mraGetDword(NULL, "TimeOutConnectMRIM", MRA_DEFAULT_TIMEOUT_CONN_MRIM);
+ nloc.timeout = getDword(NULL, "TimeOutConnectMRIM", MRA_DEFAULT_TIMEOUT_CONN_MRIM);
if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
@@ -77,11 +77,11 @@ void CMraProto::MraThreadProc(LPVOID lpParameter) }
if (bConnected == FALSE)
- if (mraGetByte(NULL, "NLBFailDirectConnect", MRA_DEFAULT_NLB_FAIL_DIRECT_CONNECT)) {
+ if (getByte(NULL, "NLBFailDirectConnect", MRA_DEFAULT_NLB_FAIL_DIRECT_CONNECT)) {
if (IsHTTPSProxyUsed(hNetlibUser))
nloc.wPort = MRA_SERVER_PORT_HTTPS;
else {
- nloc.wPort = mraGetWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT);
+ nloc.wPort = getWord(NULL, "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 = mraGetDword(NULL, "ConnectReTryCountNLB", MRA_DEFAULT_CONN_RETRY_COUNT_NLB);
+ dwConnectReTryCount = getDword(NULL, "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 = mraGetWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT);
+ nloc.wPort = getWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT);
- nloc.timeout = mraGetDword(NULL, "TimeOutConnectNLB", MRA_DEFAULT_TIMEOUT_CONN_NLB);
+ nloc.timeout = getDword(NULL, "TimeOutConnectNLB", MRA_DEFAULT_TIMEOUT_CONN_NLB);
if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
if (nloc.timeout>MRA_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 * mraGetDword(NULL, "TimeOutReceiveNLB", MRA_DEFAULT_TIMEOUT_RECV_NLB);
+ nls.dwTimeout = 1000 * getDword(NULL, "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 = ((mraGetByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS);
+ dwFutureFlags = ((getByte(NULL, "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;
- mraSetDword(NULL, "IP", HTONL(inet_addr(lpszDelimiter)));
+ setDword(NULL, "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);
- mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ setDword(NULL, 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);
- //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
}
else if ( !_strnicmp(lpsString.lpszData, "mrim.status.open_search", 23)) {
GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
- //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
}
else if ( !_strnicmp(lpsString.lpszData, "rb.target.cookie", 16)) {
GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
- //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
}
else if ( !_strnicmp(lpsString.lpszData, "show_web_history_link", 21)) {
GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
- //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
}
else if ( !_strnicmp(lpsString.lpszData, "friends_suggest", 15)) {
GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
- //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
}
else if ( !_strnicmp(lpsString.lpszData, "timestamp", 9)) {
GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
- //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
}
else if ( !_strnicmp(lpsString.lpszData, "trusted_update", 14)) {
GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
- //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ //setDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
}
else {
#ifdef _DEBUG
@@ -675,9 +675,9 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwTemp, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL);
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);
+ setDword(hContact, "HooksLocked", TRUE);
db_unset(hContact, "CList", "NotOnList");
- mraSetDword(hContact, "HooksLocked", FALSE);
+ setDword(hContact, "HooksLocked", FALSE);
}
break;
@@ -785,13 +785,13 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd dwTemp = GetMiradaStatusFromMraStatus(dwStatus, GetMraXStatusIDFromMraUriStatus(lpsSpecStatusUri.lpszData, lpsSpecStatusUri.dwSize), &dwXStatus);
MraContactCapabilitiesSet(hContact, dwFutureFlags);
- mraSetByte(hContact, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
+ setByte(hContact, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
mraSetLPSStringW(hContact, DBSETTING_XSTATUSNAME, &lpsStatusTitle);
mraSetLPSStringW(hContact, DBSETTING_XSTATUSMSG, &lpsStatusDesc);
if (dwTemp != ID_STATUS_OFFLINE) { // пишем клиента только если юзер не отключён, иначе не затираем старое
if (lpsUserAgentFormated.dwSize) {
- if (mraGetByte(NULL, "MirVerRaw", MRA_DEFAULT_MIRVER_RAW) == FALSE) {
+ if (getByte(NULL, "MirVerRaw", MRA_DEFAULT_MIRVER_RAW) == FALSE) {
MraGetVersionStringFromFormatted(lpsUserAgentFormated.lpszData, lpsUserAgentFormated.dwSize, (LPSTR)szBuff, SIZEOF(szBuff), &dwStringSize);
lpsUserAgentFormated.lpszData = (LPSTR)szBuff;
lpsUserAgentFormated.dwSize = dwStringSize;
@@ -893,7 +893,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd // write to DB and exit loop
if (dwAckType == ACKTYPE_GETINFO && hContact) {
- mraSetDword(hContact, "InfoTS", (DWORD)_time32(NULL));
+ setDword(hContact, "InfoTS", (DWORD)_time32(NULL));
//MRA_LPS mralpsUsernameValue;
for (i = 0; i < dwFeildsNum; i++) {
if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Username", 8))
@@ -911,10 +911,10 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Sex", 3)) {
switch (StrToUNum32(pmralpsValues[i].lpszData, pmralpsValues[i].dwSize)) {
case 1:// мужской
- mraSetByte(hContact, "Gender", 'M');
+ setByte(hContact, "Gender", 'M');
break;
case 2:// женский
- mraSetByte(hContact, "Gender", 'F');
+ setByte(hContact, "Gender", 'F');
break;
default:// а фиг его знает
mraDelValue(hContact, "Gender");
@@ -928,11 +928,11 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd stTime.wYear = (WORD)StrToUNum32(pmralpsValues[i].lpszData, 4);
stTime.wMonth = (WORD)StrToUNum32((pmralpsValues[i].lpszData+5), 2);
stTime.wDay = (WORD)StrToUNum32((pmralpsValues[i].lpszData+8), 2);
- mraSetWord(hContact, "BirthYear", stTime.wYear);
- mraSetByte(hContact, "BirthMonth", (BYTE)stTime.wMonth);
- mraSetByte(hContact, "BirthDay", (BYTE)stTime.wDay);
+ setWord(hContact, "BirthYear", stTime.wYear);
+ setByte(hContact, "BirthMonth", (BYTE)stTime.wMonth);
+ setByte(hContact, "BirthDay", (BYTE)stTime.wDay);
- mraSetWord(hContact, "Age", (WORD)GetYears(&stTime));
+ setWord(hContact, "Age", (WORD)GetYears(&stTime));
}
else {
mraDelValue(hContact, "BirthYear");
@@ -1020,7 +1020,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd if (dwID == -1 || (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED)) {
dwStatus = StrHexToUNum32(pmralpsValues[i].lpszData, pmralpsValues[i].dwSize);
MraSetContactStatus(hContact, GetMiradaStatusFromMraStatus(dwStatus, MRA_MIR_XSTATUS_NONE, NULL));
- mraSetByte(hContact, DBSETTING_XSTATUSID, (BYTE)MRA_MIR_XSTATUS_NONE);
+ setByte(hContact, DBSETTING_XSTATUSID, (BYTE)MRA_MIR_XSTATUS_NONE);
}
}
}
@@ -1031,7 +1031,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd GetContactBasicInfoW(hContact, &dwID, NULL, NULL, &dwContactSeverFlags, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL);
if (dwID == -1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED) {
MraSetContactStatus(hContact, GetMiradaStatusFromMraStatus(dwStatus, GetMraXStatusIDFromMraUriStatus(pmralpsValues[i].lpszData, pmralpsValues[i].dwSize), &dwXStatus));
- mraSetByte(hContact, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
+ setByte(hContact, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
}
}
}
@@ -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 (mraGetByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY) == 0 || dwAckType<dwTemp || dwTemp == 0)
+ if (getByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY) == 0 || dwAckType<dwTemp || dwTemp == 0)
MraUpdateEmailStatus(NULL, 0, NULL, 0, 0, 0);
break;
@@ -1472,10 +1472,10 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd }
MraContactCapabilitiesSet(hContact, dwFutureFlags);
- mraSetByte(hContact, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
+ setByte(hContact, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
mraSetLPSStringW(hContact, DBSETTING_XSTATUSNAME, &lpsStatusTitle);
mraSetLPSStringW(hContact, DBSETTING_XSTATUSMSG, &lpsStatusDesc);
- mraSetDword(hContact, DBSETTING_BLOGSTATUSTIME, dwBlogStatusTime);
+ setDword(hContact, DBSETTING_BLOGSTATUSTIME, dwBlogStatusTime);
mraWriteContactSettingBlob(hContact, DBSETTING_BLOGSTATUSID, &dwBlogStatusID.QuadPart, sizeof(DWORDLONG));
mraSetLPSStringW(hContact, DBSETTING_BLOGSTATUS, &lpsBlogStatus);
mraSetLPSStringW(hContact, DBSETTING_BLOGSTATUSMUSIC, &lpsBlogStatusMusic);
@@ -1484,7 +1484,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd if (dwTemp != ID_STATUS_OFFLINE) { // пишем клиента только если юзер не отключён, иначе не затираем старое
if (lpsUserAgentFormated.dwSize) {
- if (mraGetByte(NULL, "MirVerRaw", MRA_DEFAULT_MIRVER_RAW) == FALSE) {
+ if (getByte(NULL, "MirVerRaw", MRA_DEFAULT_MIRVER_RAW) == FALSE) {
MraGetVersionStringFromFormatted(lpsUserAgentFormated.lpszData, lpsUserAgentFormated.dwSize, (LPSTR)szBuff, SIZEOF(szBuff), &dwStringSize);
lpsUserAgentFormated.lpszData = (LPSTR)szBuff;
lpsUserAgentFormated.dwSize = dwStringSize;
@@ -1498,7 +1498,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd }
if (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED)
- if (mraGetByte(NULL, "AutoAuthRequestOnLogon", MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON))
+ if (getByte(NULL, "AutoAuthRequestOnLogon", MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON))
CallProtoService(m_szModuleName, MRA_REQ_AUTH, (WPARAM)hContact, 0);
}
}
@@ -1532,7 +1532,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd else {
if (db_get_b(hContact, "CList", "NotOnList", 0) == 0) { // set extra icons and upload contact
SetExtraIcons(hContact);
- if (mraGetByte(NULL, "AutoAddContactsToServer", MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER)) { //add all contacts to server
+ if (getByte(NULL, "AutoAddContactsToServer", MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER)) { //add all contacts to server
GetContactBasicInfoW(hContact, NULL, &dwGroupID, NULL, NULL, NULL, NULL, 0, NULL, wszNick, SIZEOF(wszNick), &dwNickSize, szPhones, SIZEOF(szPhones), &dwPhonesSize);
MraAddContactW(hContact, (CONTACT_FLAG_VISIBLE|CONTACT_FLAG_UNICODE_NAME), dwGroupID, szEMail, dwEMailSize, wszNick, dwNickSize, szPhones, dwPhonesSize, wszAuthMessage, dwAuthMessageSize, 0);
}
@@ -1682,7 +1682,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd dwAckType = dwEmailMessagesUnread;// save old value
dwEmailMessagesUnread = dwTemp;// store new value
- if (mraGetByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY) == 0 || dwAckType<dwTemp || dwTemp == 0)
+ if (getByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY) == 0 || dwAckType<dwTemp || dwTemp == 0)
MraUpdateEmailStatus(lpsEMail.lpszData, lpsEMail.dwSize, lpsString.lpszData, lpsString.dwSize, dwDate, dwUIDL);
}
break;
@@ -1705,7 +1705,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd if (dwFlags & MRIM_BLOG_STATUS_MUSIC)
mraSetLPSStringW(hContact, DBSETTING_BLOGSTATUSMUSIC, &lpsText);
else {
- mraSetDword(hContact, DBSETTING_BLOGSTATUSTIME, dwTime);
+ setDword(hContact, DBSETTING_BLOGSTATUSTIME, dwTime);
mraWriteContactSettingBlob(hContact, DBSETTING_BLOGSTATUSID, &dwBlogStatusID, sizeof(DWORDLONG));
mraSetLPSStringW(hContact, DBSETTING_BLOGSTATUS, &lpsText);
}
@@ -1991,10 +1991,10 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *pl else {
// temporary contact
if (db_get_b(hContact, "CList", "NotOnList", 0)) {
- if (mraGetByte(NULL, "AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS))
+ if (getByte(NULL, "AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS))
bAutoGrantAuth = TRUE;
}
- else if (mraGetByte(NULL, "AutoAuthGrandUsersInCList", MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST))
+ else if (getByte(NULL, "AutoAuthGrandUsersInCList", MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST))
bAutoGrantAuth = TRUE;
}
@@ -2056,7 +2056,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *pl }
else { // standart message// flash animation
// пишем в ANSI, всё равно RTF
- if ((dwFlags & MESSAGE_FLAG_RTF) && (dwFlags & MESSAGE_FLAG_FLASH) == 0 && lpszMessageExt && dwMessageExtSize && mraGetByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)) {
+ if ((dwFlags & MESSAGE_FLAG_RTF) && (dwFlags & MESSAGE_FLAG_FLASH) == 0 && lpszMessageExt && dwMessageExtSize && getByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)) {
pre.flags = 0;
pre.szMessage = lpszMessageExt;
ProtoChainRecvMsg(hContact, &pre);
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index 83ea9a9544..926a9d9669 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -131,7 +131,7 @@ void CMraProto::SetExtraIcons(HANDLE hContact) DWORD dwXStatus = MRA_MIR_XSTATUS_NONE;
if (m_bLoggedIn) {
- dwXStatus = mraGetByte(hContact, DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE);
+ dwXStatus = getByte(hContact, DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE);
if (dwID == -1)
dwIconID = (dwContactSeverFlags == -1) ? ADV_ICON_DELETED : ADV_ICON_NOT_ON_SERVER;
else {
@@ -270,7 +270,7 @@ INT_PTR CMraProto::MraRequestAuthorization(WPARAM wParam, LPARAM lParam) if (dwMessageSize) {
HANDLE hContact = (HANDLE)wParam;
if ( mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
- BOOL bSlowSend = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
+ BOOL bSlowSend = getByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
int iRet = MraMessageW(bSlowSend, hContact, ACKTYPE_AUTHREQ, MESSAGE_FLAG_AUTHORIZE, szEMail, dwEMailSize, wszAuthMessage, dwMessageSize, NULL, 0);
if (bSlowSend == FALSE)
ProtoBroadcastAck(hContact, ACKTYPE_AUTHREQ, ACKRESULT_SUCCESS, (HANDLE)iRet, 0);
@@ -456,7 +456,7 @@ int CMraProto::MraDbSettingChanged(WPARAM wParam, LPARAM lParam) if (hContact) {
// это наш контакт, он не временный (есть в списке на сервере) и его обновление разрешено
- if ( IsContactMra(hContact) && !db_get_b(hContact, "CList", "NotOnList", 0) && mraGetDword(hContact, "HooksLocked", FALSE) == FALSE) {
+ if ( IsContactMra(hContact) && !db_get_b(hContact, "CList", "NotOnList", 0) && getDword(hContact, "HooksLocked", FALSE) == FALSE) {
CHAR szEMail[MAX_EMAIL_LEN], szPhones[MAX_EMAIL_LEN];
WCHAR wszNick[MAX_EMAIL_LEN];
DWORD dwID, dwGroupID, dwContactFlag;
@@ -769,7 +769,7 @@ DWORD CMraProto::MraSetXStatusInternal(DWORD dwXStatus) }
dwOldStatusMode = InterlockedExchange((volatile LONG*)&m_iXStatus, dwXStatus);
- mraSetByte(NULL, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
+ setByte(NULL, 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, ((mraGetByte(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(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS));
return 0;
}
|