diff options
Diffstat (limited to 'protocols/MRA')
-rw-r--r-- | protocols/MRA/src/Mra.cpp | 2 | ||||
-rw-r--r-- | protocols/MRA/src/MraAdvancedSearch.cpp | 8 | ||||
-rw-r--r-- | protocols/MRA/src/MraAvatars.cpp | 48 | ||||
-rw-r--r-- | protocols/MRA/src/MraChat.cpp | 22 | ||||
-rw-r--r-- | protocols/MRA/src/MraFilesQueue.cpp | 54 | ||||
-rw-r--r-- | protocols/MRA/src/MraIcons.cpp | 14 | ||||
-rw-r--r-- | protocols/MRA/src/MraMPop.cpp | 12 | ||||
-rw-r--r-- | protocols/MRA/src/MraMRIMProxy.cpp | 12 | ||||
-rw-r--r-- | protocols/MRA/src/MraOfflineMsg.cpp | 14 | ||||
-rw-r--r-- | protocols/MRA/src/MraPopUp.cpp | 22 | ||||
-rw-r--r-- | protocols/MRA/src/MraProto.cpp | 34 | ||||
-rw-r--r-- | protocols/MRA/src/MraRTFMsg.cpp | 8 | ||||
-rw-r--r-- | protocols/MRA/src/MraSelectEMail.cpp | 2 | ||||
-rw-r--r-- | protocols/MRA/src/MraSendQueue.cpp | 8 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_menus.cpp | 18 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_options.cpp | 8 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 68 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_svcs.cpp | 52 |
18 files changed, 203 insertions, 203 deletions
diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp index 20bfae5769..d162edeb5e 100644 --- a/protocols/MRA/src/Mra.cpp +++ b/protocols/MRA/src/Mra.cpp @@ -101,7 +101,7 @@ extern "C" __declspec(dllexport) int Unload(void) DestroyXStatusIcons();
if (g_hDLLXStatusIcons) {
FreeLibrary(g_hDLLXStatusIcons);
- g_hDLLXStatusIcons = NULL;
+ g_hDLLXStatusIcons = nullptr;
}
return 0;
diff --git a/protocols/MRA/src/MraAdvancedSearch.cpp b/protocols/MRA/src/MraAdvancedSearch.cpp index cfcda90d31..bb365c8c67 100644 --- a/protocols/MRA/src/MraAdvancedSearch.cpp +++ b/protocols/MRA/src/MraAdvancedSearch.cpp @@ -14,7 +14,7 @@ static const FieldNames GenderField[] = {
{ 1, LPGENW("Male") },
{ 2, LPGENW("Female") },
- { 0, NULL }
+ { 0, nullptr }
};
static const FieldNames MonthField[] =
@@ -31,7 +31,7 @@ static const FieldNames MonthField[] = { 10, LPGENW("October") },
{ 11, LPGENW("November") },
{ 12, LPGENW("December") },
- { 0, NULL }
+ { 0, nullptr }
};
static const FieldNames ZodiakField[] =
@@ -48,7 +48,7 @@ static const FieldNames ZodiakField[] = { 10, LPGENW("Capricorn") },
{ 11, LPGENW("Aquarius") },
{ 12, LPGENW("Pisces") },
- { 0, NULL }
+ { 0, nullptr }
};
void ResetComboBox(HWND hWndCombo)
@@ -309,5 +309,5 @@ HWND CMraProto::CreateExtendedSearchUI(HWND owner) if (g_hInstance && owner)
return CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_MRAADVANCEDSEARCH), owner, AdvancedSearchDlgProc, (LPARAM)this);
- return NULL;
+ return nullptr;
}
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index d28e9e6ff1..961c5c3329 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -37,7 +37,7 @@ DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle) {
mir_snprintf(szAvtSectName, "%s Avatars", m_szModuleName);
- if (phAvatarsQueueHandle == NULL)
+ if (phAvatarsQueueHandle == nullptr)
return ERROR_INVALID_HANDLE;
MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = new MRA_AVATARS_QUEUE();
@@ -77,7 +77,7 @@ void CMraProto::MraAvatarsQueueClear(HANDLE hQueue) PROTO_AVATAR_INFORMATION ai = { 0 };
ai.format = PA_FORMAT_UNKNOWN;
- while (FifoMTItemPop(pmraaqAvatarsQueue, NULL, (LPVOID*)&pmraaqiAvatarsQueueItem) == NO_ERROR) {
+ while (FifoMTItemPop(pmraaqAvatarsQueue, nullptr, (LPVOID*)&pmraaqiAvatarsQueueItem) == NO_ERROR) {
ai.hContact = pmraaqiAvatarsQueueItem->hContact;
ProtoBroadcastAck(pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, 0);
mir_free(pmraaqiAvatarsQueueItem);
@@ -105,7 +105,7 @@ void CMraProto::MraAvatarsQueueDestroy(HANDLE hQueue) DWORD CMraProto::MraAvatarsQueueAdd(HANDLE hQueue, DWORD dwFlags, MCONTACT hContact, DWORD *pdwAvatarsQueueID)
{
MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)hQueue;
- if (pmraaqAvatarsQueue == NULL || g_bShutdown)
+ if (pmraaqAvatarsQueue == nullptr || g_bShutdown)
return ERROR_INVALID_HANDLE;
MRA_AVATARS_QUEUE_ITEM *pmraaqiAvatarsQueueItem = (MRA_AVATARS_QUEUE_ITEM*)mir_calloc(sizeof(MRA_AVATARS_QUEUE_ITEM));
@@ -139,21 +139,21 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) size_t dwAvatarSizeServer;
FILETIME ftLastModifiedTimeServer, ftLastModifiedTimeLocal;
SYSTEMTIME stAvatarLastModifiedTimeLocal;
- HNETLIBCONN hConnection = NULL;
+ HNETLIBCONN hConnection = nullptr;
NETLIBSELECT nls = { 0 };
INTERNET_TIME itAvatarLastModifiedTimeServer;
WCHAR szErrorText[2048];
Thread_SetName("MRA: AvatarsThreadProc");
- HANDLE hThreadEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ HANDLE hThreadEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
{
mir_cslock lck(pmraaqAvatarsQueue->cs);
pmraaqAvatarsQueue->hThreadEvents[pmraaqAvatarsQueue->iThreadsRunning++] = hThreadEvent;
}
while (!g_bShutdown) {
- if (FifoMTItemPop(pmraaqAvatarsQueue, NULL, (LPVOID*)&pmraaqiAvatarsQueueItem) != NO_ERROR) { // waiting until service stop or new task
+ if (FifoMTItemPop(pmraaqAvatarsQueue, nullptr, (LPVOID*)&pmraaqiAvatarsQueueItem) != NO_ERROR) { // waiting until service stop or new task
NETLIB_CLOSEHANDLE(hConnection);
WaitForSingleObjectEx(hThreadEvent, INFINITE, FALSE);
continue;
@@ -175,12 +175,12 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) CMStringA szUser = szEmail.Tokenize("@", iStart);
CMStringA szDomain = szEmail.Tokenize("@", iStart);
if (!szUser.IsEmpty() && !szDomain.IsEmpty()) {
- ProtoBroadcastAck(pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_CONNECTING, NULL, 0);
- if (hConnection == NULL)
+ ProtoBroadcastAck(pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_CONNECTING, nullptr, 0);
+ if (hConnection == nullptr)
hConnection = MraAvatarsHttpConnect(pmraaqAvatarsQueue->hNetlibUser, szServer, dwServerPort);
if (hConnection) {
- ProtoBroadcastAck(pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_CONNECTED, NULL, 0);
- ProtoBroadcastAck(pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_SENTREQUEST, NULL, 0);
+ ProtoBroadcastAck(pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_CONNECTED, nullptr, 0);
+ ProtoBroadcastAck(pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_SENTREQUEST, nullptr, 0);
if (!MraAvatarsHttpTransaction(hConnection, REQUEST_HEAD, szUser, szDomain, szServer, MAHTRO_AVTMRIM, bUseKeepAliveConn, &dwResultCode, &bKeepAlive, &dwAvatarFormat, &dwAvatarSizeServer, &itAvatarLastModifiedTimeServer)) {
switch (dwResultCode) {
case 200:
@@ -226,14 +226,14 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) }
if (bDownloadNew) {
- if (hConnection == NULL)
+ if (hConnection == nullptr)
hConnection = MraAvatarsHttpConnect(pmraaqAvatarsQueue->hNetlibUser, szServer, dwServerPort);
if (hConnection) {
- ProtoBroadcastAck(pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_DATA, NULL, 0);
+ ProtoBroadcastAck(pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_DATA, nullptr, 0);
if (MraAvatarsHttpTransaction(hConnection, REQUEST_GET, szUser, szDomain, szServer, MAHTRO_AVT, bUseKeepAliveConn, &dwResultCode, &bKeepAlive, &dwAvatarFormat, &dwAvatarSizeServer, &itAvatarLastModifiedTimeServer) == NO_ERROR && dwResultCode == 200) {
if (!MraAvatarsGetFileName(pmraaqAvatarsQueue, pmraaqiAvatarsQueueItem->hContact, dwAvatarFormat, wszFileName)) {
- HANDLE hFile = CreateFile(wszFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ HANDLE hFile = CreateFile(wszFileName, GENERIC_WRITE, FILE_SHARE_READ, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hFile != INVALID_HANDLE_VALUE) {
DWORD dwWritten = 0;
bContinue = TRUE;
@@ -256,7 +256,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) bContinue = FALSE;
}
else {
- if (WriteFile(hFile, (LPVOID)&btBuff, dwReceived, &dwReceived, NULL)) {
+ if (WriteFile(hFile, (LPVOID)&btBuff, dwReceived, &dwReceived, nullptr)) {
dwWritten += dwReceived;
if (dwWritten >= dwAvatarSizeServer)
bContinue = FALSE;
@@ -335,7 +335,7 @@ HNETLIBCONN MraAvatarsHttpConnect(HNETLIBUSER hNetlibUser, LPCSTR lpszHost, DWOR do {
hConnection = Netlib_OpenConnection(hNetlibUser, &nloc);
}
- while (--dwCurConnectReTryCount && hConnection == NULL);
+ while (--dwCurConnectReTryCount && hConnection == nullptr);
return hConnection;
}
@@ -365,7 +365,7 @@ DWORD MraAvatarsHttpTransaction(HNETLIBCONN hConnection, DWORD dwRequestType, LP mir_snprintf(szBuff, "http://%s/%s/%s/%s", lpszHost, lpszDomain, lpszUser, lpszReqObj);
CMStringA szSelfVersionString = MraGetSelfVersionString();
- NETLIBHTTPHEADER nlbhHeaders[8] = { 0 };
+ NETLIBHTTPHEADER nlbhHeaders[8] = {};
nlbhHeaders[0].szName = "User-Agent"; nlbhHeaders[0].szValue = (LPSTR)szSelfVersionString.c_str();
nlbhHeaders[1].szName = "Accept-Encoding"; nlbhHeaders[1].szValue = "deflate";
nlbhHeaders[2].szName = "Pragma"; nlbhHeaders[2].szValue = "no-cache";
@@ -416,8 +416,8 @@ bool CMraProto::MraAvatarsGetContactTime(MCONTACT hContact, LPSTR lpszValueName, INTERNET_TIME itAvatarLastModifiedTimeLocal;
CMStringA szBuff;
- if (NULL == lpszValueName ||
- NULL == pstTime)
+ if (nullptr == lpszValueName ||
+ nullptr == pstTime)
return false;
if (false == mraGetStringA(hContact, lpszValueName, szBuff))
return false;
@@ -448,7 +448,7 @@ void CMraProto::MraAvatarsSetContactTime(MCONTACT hContact, LPSTR lpszValueName, DWORD CMraProto::MraAvatarsGetFileName(HANDLE hQueue, MCONTACT hContact, DWORD dwFormat, CMStringW &res)
{
res.Empty();
- if (hQueue == NULL)
+ if (hQueue == nullptr)
return ERROR_INVALID_HANDLE;
if (IsContactChatAgent(hContact))
@@ -522,7 +522,7 @@ DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hQueue, DWORD dwFlags, MCONTACT if (bQueueAdd || (dwFlags & GAIF_FORCE))
if (!MraAvatarsQueueAdd(hQueue, dwFlags, hContact, pdwAvatarsQueueID)) {
- MraAvatarsSetContactTime(hContact, "AvatarLastCheckTime", NULL);
+ MraAvatarsSetContactTime(hContact, "AvatarLastCheckTime", nullptr);
dwRetCode = GAIR_WAITFOR;
}
return dwRetCode;
@@ -535,7 +535,7 @@ DWORD CMraProto::MraAvatarsQueueGetAvatarSimple(HANDLE hQueue, DWORD dwFlags, MC PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- DWORD dwRetCode = MraAvatarsQueueGetAvatar(hQueue, dwFlags, hContact, NULL, (DWORD*)&ai.format, ai.filename);
+ DWORD dwRetCode = MraAvatarsQueueGetAvatar(hQueue, dwFlags, hContact, nullptr, (DWORD*)&ai.format, ai.filename);
if (dwRetCode != GAIR_SUCCESS)
return dwRetCode;
@@ -606,9 +606,9 @@ INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wPara db_set_b(NULL, MRA_AVT_SECT_NAME, "Enable", IsDlgButtonChecked(hWndDlg, IDC_ENABLE));
db_set_b(NULL, MRA_AVT_SECT_NAME, "DeleteAvtOnContactDelete", IsDlgButtonChecked(hWndDlg, IDC_DELETE_AVT_ON_CONTACT_DELETE));
db_set_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", IsDlgButtonChecked(hWndDlg, IDC_RETURN_ABC_PATH));
- db_set_dw(NULL, MRA_AVT_SECT_NAME, "CheckInterval", GetDlgItemInt(hWndDlg, IDC_UPD_CHECK_INTERVAL, NULL, FALSE));
+ db_set_dw(NULL, MRA_AVT_SECT_NAME, "CheckInterval", GetDlgItemInt(hWndDlg, IDC_UPD_CHECK_INTERVAL, nullptr, FALSE));
db_set_b(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", IsDlgButtonChecked(hWndDlg, IDC_USE_KEEPALIVE_CONN));
- db_set_dw(NULL, MRA_AVT_SECT_NAME, "ServerPort", GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
+ db_set_dw(NULL, MRA_AVT_SECT_NAME, "ServerPort", GetDlgItemInt(hWndDlg, IDC_SERVERPORT, nullptr, FALSE));
wchar_t szServer[MAX_PATH];
GetDlgItemText(hWndDlg, IDC_SERVER, szServer, _countof(szServer));
@@ -623,7 +623,7 @@ INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wPara DWORD CMraProto::MraAvatarsDeleteContactAvatarFile(HANDLE hQueue, MCONTACT hContact)
{
- if (hQueue == NULL)
+ if (hQueue == nullptr)
return ERROR_INVALID_HANDLE;
DWORD dwAvatarFormat = GetContactAvatarFormat(hContact, PA_FORMAT_UNKNOWN);
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp index 69e663239f..44dbfab5f8 100644 --- a/protocols/MRA/src/MraChat.cpp +++ b/protocols/MRA/src/MraChat.cpp @@ -64,7 +64,7 @@ INT_PTR CMraProto::MraChatSessionEventSendByHandle(MCONTACT hContactChatSession, CMStringW wszID, wszUID, wszNick;
- GCEVENT gce = { m_szModuleName, 0, iType };
+ GCEVENT gce = { m_szModuleName, nullptr, iType };
if (hContactChatSession) {
mraGetStringW(hContactChatSession, "e-mail", wszID);
gce.ptszID = wszID.c_str();
@@ -88,7 +88,7 @@ INT_PTR CMraProto::MraChatSessionEventSendByHandle(MCONTACT hContactChatSession, gce.ptszNick = wszNick;
}
else {
- MCONTACT hContactSender = MraHContactFromEmail(lpszUID, FALSE, TRUE, NULL);
+ MCONTACT hContactSender = MraHContactFromEmail(lpszUID, FALSE, TRUE, nullptr);
wszUID = lpszUID;
if (hContactSender)
gce.ptszNick = pcli->pfnGetContactDisplayName(hContactSender, 0);
@@ -106,7 +106,7 @@ INT_PTR CMraProto::MraChatSessionInvite(MCONTACT hContactChatSession, const CMSt CMStringW wszBuff;
wszBuff.Format(L"[%s]: %s", _A2T(lpszEMailInMultiChat.c_str()), TranslateT("invite sender"));
- return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime);
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, nullptr, wszBuff, 0, dwTime);
}
INT_PTR CMraProto::MraChatSessionMembersAdd(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
@@ -116,7 +116,7 @@ INT_PTR CMraProto::MraChatSessionMembersAdd(MCONTACT hContactChatSession, const CMStringW wszBuff;
wszBuff.Format(L"[%s]: %s", _A2T(lpszEMailInMultiChat), TranslateT("invite new members"));
- return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime);
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, nullptr, wszBuff, 0, dwTime);
}
INT_PTR CMraProto::MraChatSessionJoinUser(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
@@ -130,7 +130,7 @@ INT_PTR CMraProto::MraChatSessionJoinUser(MCONTACT hContactChatSession, const CM INT_PTR CMraProto::MraChatSessionLeftUser(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
{
if (hContactChatSession)
- return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_PART, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, NULL, 0, dwTime);
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_PART, GCEF_ADDTOLOG, lpszEMailInMultiChat, nullptr, nullptr, 0, dwTime);
return 1;
}
@@ -138,7 +138,7 @@ INT_PTR CMraProto::MraChatSessionLeftUser(MCONTACT hContactChatSession, const CM INT_PTR CMraProto::MraChatSessionSetIviter(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat)
{
if (hContactChatSession && !lpszEMailInMultiChat.IsEmpty())
- return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_INVITER], NULL, 0, 0);
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_INVITER], nullptr, 0, 0);
return 1;
}
@@ -146,7 +146,7 @@ INT_PTR CMraProto::MraChatSessionSetIviter(MCONTACT hContactChatSession, const C INT_PTR CMraProto::MraChatSessionSetOwner(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat)
{
if (hContactChatSession && !lpszEMailInMultiChat.IsEmpty())
- return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_OWNER], NULL, 0, 0);
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_OWNER], nullptr, 0, 0);
return 1;
}
@@ -155,7 +155,7 @@ INT_PTR CMraProto::MraChatSessionSetOwner(MCONTACT hContactChatSession, const CM INT_PTR CMraProto::MraChatSessionMessageAdd(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &lpwszMessage, DWORD dwTime)
{
if (hContactChatSession)
- return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_MESSAGE, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, lpwszMessage, 0, dwTime);
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_MESSAGE, GCEF_ADDTOLOG, lpszEMailInMultiChat, nullptr, lpwszMessage, 0, dwTime);
return 1;
}
@@ -171,18 +171,18 @@ int CMraProto::MraChatGcEventHook(WPARAM, LPARAM lParam) case GC_USER_MESSAGE:
if (gch->ptszText && mir_wstrlen(gch->ptszText)) {
CMStringA szEmail = gch->ptszID;
- MCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL);
+ MCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, nullptr);
BOOL bSlowSend = getByte("SlowSend", MRA_DEFAULT_SLOW_SEND);
DWORD dwFlags = 0;
if (getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact)&FEATURE_FLAG_RTF_MESSAGE))
dwFlags |= MESSAGE_FLAG_RTF;
- INT_PTR iSendRet = MraMessage(bSlowSend, hContact, ACKTYPE_MESSAGE, dwFlags, szEmail, gch->ptszText, NULL, 0);
+ INT_PTR iSendRet = MraMessage(bSlowSend, hContact, ACKTYPE_MESSAGE, dwFlags, szEmail, gch->ptszText, nullptr, 0);
if (bSlowSend == FALSE)
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)iSendRet, 0);
- MraChatSessionEventSendByHandle(hContact, GC_EVENT_MESSAGE, GCEF_ADDTOLOG, "", NULL, gch->ptszText, 0, (DWORD)_time32(NULL));
+ MraChatSessionEventSendByHandle(hContact, GC_EVENT_MESSAGE, GCEF_ADDTOLOG, "", nullptr, gch->ptszText, 0, (DWORD)_time32(nullptr));
}
break;
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index e540e98d94..ae7938fe4b 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -124,7 +124,7 @@ INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, WCHAR szBuff[MAX_PATH];
GetDlgItemText(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS, szBuff, _countof(szBuff));
ppro->mraSetStringW(NULL, "FileSendExtraAddresses", szBuff);
- ppro->setDword("FileSendBlockSize", (DWORD)GetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, NULL, FALSE));
+ ppro->setDword("FileSendBlockSize", (DWORD)GetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, nullptr, FALSE));
ppro->setByte("FileSendEnableMRIMProxyCons", IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS));
return TRUE;
}
@@ -159,7 +159,7 @@ void MraFilesQueueDestroy(HANDLE hQueue) MRA_FILES_QUEUE_ITEM *dat;
{
mir_cslock l(pmrafqFilesQueue->cs);
- while (ListMTItemGetFirst(pmrafqFilesQueue, NULL, (LPVOID*)&dat) == NO_ERROR)
+ while (ListMTItemGetFirst(pmrafqFilesQueue, nullptr, (LPVOID*)&dat) == NO_ERROR)
MraFilesQueueItemFree(dat);
}
delete pmrafqFilesQueue;
@@ -177,7 +177,7 @@ DWORD MraFilesQueueItemFindByID(HANDLE hQueue, DWORD dwIDRequest, MRA_FILES_QUEU mir_cslock l(pmrafqFilesQueue->cs);
ListMTIteratorMoveFirst(pmrafqFilesQueue, &lmtiIterator);
do {
- if (ListMTIteratorGet(&lmtiIterator, NULL, (LPVOID*)&dat) == NO_ERROR)
+ if (ListMTIteratorGet(&lmtiIterator, nullptr, (LPVOID*)&dat) == NO_ERROR)
if (dat->dwIDRequest == dwIDRequest) {
if (ppmrafqFilesQueueItem)
*ppmrafqFilesQueueItem = dat;
@@ -195,7 +195,7 @@ HANDLE MraFilesQueueItemProxyByID(HANDLE hQueue, DWORD dwIDRequest) if (!MraFilesQueueItemFindByID(hQueue, dwIDRequest, &dat))
return dat->hMraMrimProxyData;
- return NULL;
+ return nullptr;
}
void MraFilesQueueItemFree(MRA_FILES_QUEUE_ITEM *dat)
@@ -282,7 +282,7 @@ DWORD CMraProto::MraFilesQueueAccept(HANDLE hQueue, DWORD dwIDRequest, LPCWSTR l pmftpp->hFilesQueueHandle = hFilesQueueHandle;
pmftpp->dat = dat;
- dat->hThread = ForkThreadEx(&CMraProto::MraFilesQueueRecvThreadProc, pmftpp, 0);
+ dat->hThread = ForkThreadEx(&CMraProto::MraFilesQueueRecvThreadProc, pmftpp, nullptr);
}
return dwRetErrorCode;
}
@@ -313,7 +313,7 @@ DWORD CMraProto::MraFilesQueueCancel(HANDLE hQueue, DWORD dwIDRequest, BOOL bSen SetEvent(dat->hWaitHandle);
- if (dat->hThread == NULL)
+ if (dat->hThread == nullptr)
MraFilesQueueItemFree(dat);
}
return dwRetErrorCode;
@@ -347,7 +347,7 @@ DWORD MraFilesQueueFree(HANDLE hQueue, DWORD dwIDRequest) mir_cslock l(pmrafqFilesQueue->cs);
ListMTIteratorMoveFirst(pmrafqFilesQueue, &lmtiIterator);
do {
- if (ListMTIteratorGet(&lmtiIterator, NULL, (LPVOID*)&dat) == NO_ERROR)
+ if (ListMTIteratorGet(&lmtiIterator, nullptr, (LPVOID*)&dat) == NO_ERROR)
if (dat->dwIDRequest == dwIDRequest) {
MraFilesQueueItemFree(dat);
return 0;
@@ -372,7 +372,7 @@ DWORD CMraProto::MraFilesQueueSendMirror(HANDLE hQueue, DWORD dwIDRequest, const MraAddrListGetFromBuff(szAddresses, &dat->malAddrList);
MraAddrListStoreToContact(dat->hContact, &dat->malAddrList);
- dat->hConnection = NULL;
+ dat->hConnection = nullptr;
SetEvent(dat->hWaitHandle);
}
return dwRetErrorCode;
@@ -427,7 +427,7 @@ bool CMraProto::MraFilesQueueHandCheck(HNETLIBCONN hConnection, MRA_FILES_QUEUE_ HANDLE CMraProto::MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *dat)
{
if (!dat)
- return NULL;
+ return nullptr;
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(m_hNetlibUser);
@@ -453,7 +453,7 @@ HANDLE CMraProto::MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *dat) dwAddrCount = dat->malAddrList.dwAddrCount;
if (dwAddrCount) {
- dat->hConnection = NULL;
+ dat->hConnection = nullptr;
dwConnectReTryCount = getDword("ConnectReTryCountFileSend", MRA_DEFAULT_CONN_RETRY_COUNT_FILES);
nloc.cbSize = sizeof(nloc);
nloc.flags = NLOCF_V2;
@@ -473,7 +473,7 @@ HANDLE CMraProto::MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *dat) do {
dat->hConnection = Netlib_OpenConnection(m_hNetlibUser, &nloc);
}
- while (--dwCurConnectReTryCount && dat->hConnection == NULL);
+ while (--dwCurConnectReTryCount && dat->hConnection == nullptr);
if (dat->hConnection) {
ProtoBroadcastAck(dat->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)dat->dwIDRequest, 0);
@@ -510,9 +510,9 @@ LPWSTR GetFileNameFromFullPathW(LPWSTR lpwszFullPath, size_t dwFullPathSize) HANDLE CMraProto::MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *dat)
{
if (!dat)
- return NULL;
+ return nullptr;
if (!InterlockedExchangeAdd((volatile LONG*)&dat->bIsWorking, 0))
- return NULL;
+ return nullptr;
CMStringA szEmail;
if (mraGetStringA(dat->hContact, "e-mail", szEmail)) {
@@ -547,7 +547,7 @@ HANDLE CMraProto::MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *dat) }
if (dwAddrListSize) {
- dat->hWaitHandle = CreateEvent(NULL, TRUE, FALSE, NULL);
+ dat->hWaitHandle = CreateEvent(nullptr, TRUE, FALSE, nullptr);
if (dat->bSending == FALSE) // запрашиваем зеркальное соединение, тк сами подключится не смогли
MraFileTransferAck(FILE_TRANSFER_MIRROR, szEmail, dat->dwIDRequest, szAddrList);
else { // здесь отправляем запрос на передачу(установление соединения)
@@ -569,7 +569,7 @@ HANDLE CMraProto::MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *dat) if (dat->hMraMrimProxyData) {
// устанавливаем данные для майловской прокси, если она разрешена
CMStringA lpszFiles = lpwszFiles;
- MraMrimProxySetData(dat->hMraMrimProxyData, szEmail, dat->dwIDRequest, MRIM_PROXY_TYPE_FILES, lpszFiles, "", NULL);
+ MraMrimProxySetData(dat->hMraMrimProxyData, szEmail, dat->dwIDRequest, MRIM_PROXY_TYPE_FILES, lpszFiles, "", nullptr);
}
MraFileTransfer(szEmail, dat->dwIDRequest, dat->dwFilesTotalSize, lpwszFiles, szAddrList);
@@ -578,7 +578,7 @@ HANDLE CMraProto::MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *dat) }
WaitForSingleObjectEx(dat->hWaitHandle, INFINITE, FALSE);
CloseHandle(dat->hWaitHandle);
- dat->hWaitHandle = NULL;
+ dat->hWaitHandle = nullptr;
}
}
return dat->hConnection;
@@ -694,7 +694,7 @@ DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hQueue, DWORD dwFlags, MCONTACT // Send chain event
PROTORECVFILET prf;
prf.dwFlags = PRFF_UNICODE;
- prf.timestamp = _time32(NULL);
+ prf.timestamp = _time32(nullptr);
prf.descr.w = dat->pwszDescription;
prf.fileCount = 1;
prf.files.w = &dat->pwszFilesList;
@@ -791,20 +791,20 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) //dwBuffSizeUsed = (mir_snprintf((LPSTR)btBuff, _countof(btBuff), "%s %S", MRA_FT_GET_FILE, dat->pmfqfFiles[i].lpwszName)+1);
memcpy(btBuff, MRA_FT_GET_FILE, sizeof(MRA_FT_GET_FILE));
btBuff[(sizeof(MRA_FT_GET_FILE)-1)] = ' ';
- dwBuffSizeUsed = sizeof(MRA_FT_GET_FILE) + WideCharToMultiByte(MRA_CODE_PAGE, 0, dat->pmfqfFiles[i].lpwszName, (int)dat->pmfqfFiles[i].dwNameLen, (LPSTR)(btBuff + sizeof(MRA_FT_GET_FILE)), (int)(_countof(btBuff) - sizeof(MRA_FT_GET_FILE)), NULL, NULL);
+ dwBuffSizeUsed = sizeof(MRA_FT_GET_FILE) + WideCharToMultiByte(MRA_CODE_PAGE, 0, dat->pmfqfFiles[i].lpwszName, (int)dat->pmfqfFiles[i].dwNameLen, (LPSTR)(btBuff + sizeof(MRA_FT_GET_FILE)), (int)(_countof(btBuff) - sizeof(MRA_FT_GET_FILE)), nullptr, nullptr);
btBuff[dwBuffSizeUsed] = 0;
dwBuffSizeUsed++;
if (dwBuffSizeUsed == (size_t)Netlib_Send(dat->hConnection, (LPSTR)btBuff, (int)dwBuffSizeUsed, 0)) {// file request sended
- hFile = CreateFileW(wszFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ hFile = CreateFileW(wszFileName, GENERIC_WRITE, FILE_SHARE_READ, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hFile != INVALID_HANDLE_VALUE) {// file opened/created, pre allocating disk space, for best perfomance
bOK = FALSE;
liFileSize.QuadPart = (LONGLONG)dat->pmfqfFiles[i].dwSize;
- if (SetFilePointerEx(hFile, liFileSize, NULL, FILE_BEGIN))
+ if (SetFilePointerEx(hFile, liFileSize, nullptr, FILE_BEGIN))
if (SetEndOfFile(hFile)) {
liFileSize.QuadPart = 0;
- bOK = SetFilePointerEx(hFile, liFileSize, NULL, FILE_BEGIN);
+ bOK = SetFilePointerEx(hFile, liFileSize, nullptr, FILE_BEGIN);
}
if (bOK) {// disk space pre allocated
@@ -831,7 +831,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) bContinue = FALSE;
}
else {
- if (WriteFile(hFile, (LPVOID)&btBuff, dwReceived, &dwReceived, NULL)) {
+ if (WriteFile(hFile, (LPVOID)&btBuff, dwReceived, &dwReceived, nullptr)) {
pfts.currentFileProgress += dwReceived;
pfts.totalProgress += dwReceived;
@@ -955,7 +955,7 @@ DWORD CMraProto::MraFilesQueueAddSend(HANDLE hQueue, DWORD dwFlags, MCONTACT hCo MRA_FILES_THREADPROC_PARAMS *pmftpp = (MRA_FILES_THREADPROC_PARAMS*)mir_calloc(sizeof(MRA_FILES_THREADPROC_PARAMS));
pmftpp->hFilesQueueHandle = hQueue;
pmftpp->dat = dat;
- dat->hThread = ForkThreadEx(&CMraProto::MraFilesQueueSendThreadProc, pmftpp, 0);
+ dat->hThread = ForkThreadEx(&CMraProto::MraFilesQueueSendThreadProc, pmftpp, nullptr);
return NO_ERROR;
}
@@ -1042,7 +1042,7 @@ void CMraProto::MraFilesQueueSendThreadProc(LPVOID lpParameter) bFailed = TRUE;
for (j = 0; j < dat->dwFilesCount; j++) {
lpwszFileName = GetFileNameFromFullPathW(dat->pmfqfFiles[j].lpwszName, dat->pmfqfFiles[j].dwNameLen);
- szFileName[WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszFileName, (int)(dat->pmfqfFiles[j].dwNameLen - (lpwszFileName - dat->pmfqfFiles[j].lpwszName)), szFileName, _countof(szFileName), NULL, NULL)] = 0;
+ szFileName[WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszFileName, (int)(dat->pmfqfFiles[j].dwNameLen - (lpwszFileName - dat->pmfqfFiles[j].lpwszName)), szFileName, _countof(szFileName), nullptr, nullptr)] = 0;
if (!_memicmp(btBuff + sizeof(MRA_FT_GET_FILE), szFileName, dwBuffSizeUsed - (sizeof(MRA_FT_GET_FILE)+1))) {
bFailed = FALSE;
@@ -1051,7 +1051,7 @@ void CMraProto::MraFilesQueueSendThreadProc(LPVOID lpParameter) }
if (bFailed == FALSE) {
- HANDLE hFile = CreateFileW(dat->pmfqfFiles[j].lpwszName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, (FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN), NULL);
+ HANDLE hFile = CreateFileW(dat->pmfqfFiles[j].lpwszName, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, (FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN), nullptr);
if (hFile != INVALID_HANDLE_VALUE) {
bOK = FALSE;
dwUpdateTimeNext = GetTickCount();
@@ -1061,11 +1061,11 @@ void CMraProto::MraFilesQueueSendThreadProc(LPVOID lpParameter) pfts.currentFileProgress = 0;
//pfts.currentFileTime; //as seconds since 1970
- WideCharToMultiByte(MRA_CODE_PAGE, 0, dat->pmfqfFiles[j].lpwszName, (int)dat->pmfqfFiles[j].dwNameLen, szFileName, _countof(szFileName), NULL, NULL);
+ WideCharToMultiByte(MRA_CODE_PAGE, 0, dat->pmfqfFiles[j].lpwszName, (int)dat->pmfqfFiles[j].dwNameLen, szFileName, _countof(szFileName), nullptr, nullptr);
ProtoBroadcastAck(dat->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)dat->dwIDRequest, (LPARAM)&pfts);
while (TRUE) { // read and sending
- if (ReadFile(hFile, btBuff, dwSendBlockSize, (DWORD*)&dwBuffSizeUsed, NULL)) {
+ if (ReadFile(hFile, btBuff, dwSendBlockSize, (DWORD*)&dwBuffSizeUsed, nullptr)) {
dwReceived = Netlib_Send(dat->hConnection, (LPSTR)btBuff, (int)dwBuffSizeUsed, 0);
if (dwBuffSizeUsed == dwReceived) {
pfts.currentFileProgress += dwBuffSizeUsed;
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp index 5da2288ad1..99471e9fd4 100644 --- a/protocols/MRA/src/MraIcons.cpp +++ b/protocols/MRA/src/MraIcons.cpp @@ -56,7 +56,7 @@ HICON IconLibGetIcon(HANDLE hIcon) HICON IconLibGetIconEx(HANDLE hIcon, DWORD dwFlags)
{
- HICON hiIcon = NULL;
+ HICON hiIcon = nullptr;
if (hIcon) {
hiIcon = IcoLib_GetIconByHandle(hIcon);
if ((dwFlags & LR_SHARED) == 0)
@@ -81,7 +81,7 @@ void InitXStatusIcons() {
// load libs
wchar_t szBuff[MAX_FILEPATH];
- if (GetModuleFileName(NULL, szBuff, _countof(szBuff))) {
+ if (GetModuleFileName(nullptr, szBuff, _countof(szBuff))) {
LPWSTR lpwszFileName;
g_dwMirWorkDirPathLen = GetFullPathName(szBuff, MAX_FILEPATH, g_szMirWorkDirPath, &lpwszFileName);
if (g_dwMirWorkDirPathLen) {
@@ -92,26 +92,26 @@ void InitXStatusIcons() DWORD dwBuffLen;
DWORD dwErrorCode = FindFile(g_szMirWorkDirPath, (DWORD)g_dwMirWorkDirPathLen, L"xstatus_MRA.dll", -1, szBuff, _countof(szBuff), &dwBuffLen);
if (dwErrorCode == NO_ERROR) {
- g_hDLLXStatusIcons = LoadLibraryEx(szBuff, NULL, 0);
+ g_hDLLXStatusIcons = LoadLibraryEx(szBuff, nullptr, 0);
if (g_hDLLXStatusIcons) {
dwBuffLen = LoadString(g_hDLLXStatusIcons, IDS_IDENTIFY, szBuff, MAX_FILEPATH);
if (dwBuffLen == 0 || wcsnicmp(L"# Custom Status Icons #", szBuff, 23)) {
FreeLibrary(g_hDLLXStatusIcons);
- g_hDLLXStatusIcons = NULL;
+ g_hDLLXStatusIcons = nullptr;
}
}
}
}
}
- GetModuleFileName((g_hDLLXStatusIcons != NULL) ? g_hDLLXStatusIcons : g_hInstance, szBuff, _countof(szBuff));
+ GetModuleFileName((g_hDLLXStatusIcons != nullptr) ? g_hDLLXStatusIcons : g_hInstance, szBuff, _countof(szBuff));
- SKINICONDESC sid = { 0 };
+ SKINICONDESC sid = {};
sid.section.w = LPGENW("Protocols")L"/" LPGENW("MRA") L"/" LPGENW("Custom Status");
sid.defaultFile.w = szBuff;
sid.flags = SIDF_ALL_UNICODE;
- hXStatusAdvancedStatusIcons[0] = NULL;
+ hXStatusAdvancedStatusIcons[0] = nullptr;
for (DWORD i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
char szIconName[MAX_PATH];
mir_snprintf(szIconName, "mra_xstatus%ld", i);
diff --git a/protocols/MRA/src/MraMPop.cpp b/protocols/MRA/src/MraMPop.cpp index d29bd859ae..397cb0a51b 100644 --- a/protocols/MRA/src/MraMPop.cpp +++ b/protocols/MRA/src/MraMPop.cpp @@ -38,11 +38,11 @@ void MraMPopSessionQueueClear(HANDLE hQueue) MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)hQueue;
pmpsqMPopSessionQueue->bKeyValid = false;
mir_free(pmpsqMPopSessionQueue->lpszMPOPKey);
- pmpsqMPopSessionQueue->lpszMPOPKey = NULL;
+ pmpsqMPopSessionQueue->lpszMPOPKey = nullptr;
pmpsqMPopSessionQueue->dwMPOPKeySize = 0;
MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi;
- while ( !FifoMTItemPop(pmpsqMPopSessionQueue, NULL, (LPVOID*)&pmpsqi))
+ while ( !FifoMTItemPop(pmpsqMPopSessionQueue, nullptr, (LPVOID*)&pmpsqi))
mir_free(pmpsqi);
}
@@ -115,12 +115,12 @@ void CMraProto::MraMPopSessionQueueStart(HANDLE hQueue) while ( FifoMTGetCount(pmpsqMPopSessionQueue)) {
if (!pmpsqMPopSessionQueue->bKeyValid) { /* We have no key, try to get one. */
- if (0 == MraSendCMD(MRIM_CS_GET_MPOP_SESSION, NULL, 0)) /* Fail to send. */
+ if (0 == MraSendCMD(MRIM_CS_GET_MPOP_SESSION, nullptr, 0)) /* Fail to send. */
MraMPopSessionQueueFlush(hQueue);
return;
}
- if ( FifoMTItemPop(pmpsqMPopSessionQueue, NULL, (LPVOID*)&pmpsqi) == NO_ERROR) {
+ if ( FifoMTItemPop(pmpsqMPopSessionQueue, nullptr, (LPVOID*)&pmpsqi) == NO_ERROR) {
CMStringA szUrl, szEmail;
if (mraGetStringA(NULL, "e-mail", szEmail)) {
pmpsqMPopSessionQueue->bKeyValid = false;
@@ -142,7 +142,7 @@ void CMraProto::MraMPopSessionQueueFlush(HANDLE hQueue) MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)hQueue;
MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi;
- while (FifoMTItemPop(pmpsqMPopSessionQueue, NULL, (LPVOID*)&pmpsqi) == NO_ERROR) {
+ while (FifoMTItemPop(pmpsqMPopSessionQueue, nullptr, (LPVOID*)&pmpsqi) == NO_ERROR) {
Utils_OpenUrl(pmpsqi->lpszUrl);
mir_free(pmpsqi);
}
@@ -168,7 +168,7 @@ DWORD MraMPopSessionQueueSetNewMPopKey(HANDLE hQueue, const CMStringA &szKey) }
pmpsqMPopSessionQueue->bKeyValid = false;
- pmpsqMPopSessionQueue->lpszMPOPKey = NULL;
+ pmpsqMPopSessionQueue->lpszMPOPKey = nullptr;
pmpsqMPopSessionQueue->dwMPOPKeySize = 0;
return GetLastError();
}
diff --git a/protocols/MRA/src/MraMRIMProxy.cpp b/protocols/MRA/src/MraMRIMProxy.cpp index 1f9aa28733..d5d5af1b9e 100644 --- a/protocols/MRA/src/MraMRIMProxy.cpp +++ b/protocols/MRA/src/MraMRIMProxy.cpp @@ -89,18 +89,18 @@ DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HNETLIBCONN *phCo }
// мы инициаторы
else {
- pmmpd->hWaitHandle = CreateEvent(NULL, TRUE, FALSE, NULL);
+ pmmpd->hWaitHandle = CreateEvent(nullptr, TRUE, FALSE, nullptr);
if (pmmpd->szEmail)
if (MraProxy(pmmpd->szEmail, pmmpd->dwIDRequest, pmmpd->dwDataType, pmmpd->lpszUserData, "", pmmpd->mguidSessionID))
WaitForSingleObjectEx(pmmpd->hWaitHandle, INFINITE, FALSE);
CloseHandle(pmmpd->hWaitHandle);
- pmmpd->hWaitHandle = NULL;
+ pmmpd->hWaitHandle = nullptr;
}
dwRetErrorCode = ERROR_NO_NETWORK;
if (pmmpd->malAddrList.dwAddrCount) {
- pmmpd->hConnection = NULL;
+ pmmpd->hConnection = nullptr;
bIsHTTPSProxyUsed = IsHTTPSProxyUsed(m_hNetlibUser);
dwConnectReTryCount = getDword("ConnectReTryCountMRIMProxy", MRA_DEFAULT_CONN_RETRY_COUNT_MRIMPROXY);
nloc.cbSize = sizeof(nloc);
@@ -114,7 +114,7 @@ DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HNETLIBCONN *phCo // через https прокси только 443 порт
if ((pmmpd->malAddrList.pMailAddress[i].dwPort == MRA_SERVER_PORT_HTTPS && bIsHTTPSProxyUsed) || bIsHTTPSProxyUsed == FALSE) {
if (pmmpd->dwDataType == MRIM_PROXY_TYPE_FILES)
- ProtoBroadcastAck(MraHContactFromEmail(pmmpd->szEmail, FALSE, TRUE, NULL), ACKTYPE_FILE, ACKRESULT_CONNECTING, (HANDLE)pmmpd->dwIDRequest, 0);
+ ProtoBroadcastAck(MraHContactFromEmail(pmmpd->szEmail, FALSE, TRUE, nullptr), ACKTYPE_FILE, ACKRESULT_CONNECTING, (HANDLE)pmmpd->dwIDRequest, 0);
nloc.szHost = inet_ntoa((*((in_addr*)&pmmpd->malAddrList.pMailAddress[i].dwAddr)));
nloc.wPort = (WORD)pmmpd->malAddrList.pMailAddress[i].dwPort;
@@ -123,7 +123,7 @@ DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HNETLIBCONN *phCo do {
pmmpd->hConnection = Netlib_OpenConnection(m_hNetlibUser, &nloc);
}
- while (--dwCurConnectReTryCount && pmmpd->hConnection == NULL);
+ while (--dwCurConnectReTryCount && pmmpd->hConnection == nullptr);
if (pmmpd->hConnection) {
nls.dwTimeout = (MRA_TIMEOUT_DIRECT_CONN*1000*2);
@@ -132,7 +132,7 @@ DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HNETLIBCONN *phCo dwRcvBuffSizeUsed = 0;
if (pmmpd->dwDataType == MRIM_PROXY_TYPE_FILES)
- ProtoBroadcastAck(MraHContactFromEmail(pmmpd->szEmail, FALSE, TRUE, NULL), ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)pmmpd->dwIDRequest, 0);
+ ProtoBroadcastAck(MraHContactFromEmail(pmmpd->szEmail, FALSE, TRUE, nullptr), ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)pmmpd->dwIDRequest, 0);
MraSendPacket(nls.hReadConns[0], 0, MRIM_CS_PROXY_HELLO, &pmmpd->mguidSessionID, sizeof(MRA_GUID));
while (bContinue) {
diff --git a/protocols/MRA/src/MraOfflineMsg.cpp b/protocols/MRA/src/MraOfflineMsg.cpp index dd0d93f1c5..1e75e886e3 100644 --- a/protocols/MRA/src/MraOfflineMsg.cpp +++ b/protocols/MRA/src/MraOfflineMsg.cpp @@ -14,7 +14,7 @@ static DWORD MraOfflineMessageConvertTime(INTERNET_TIME *pitTime) tziTimeZoneMailRu.Bias = pitTime->lTimeZone/100*60;
tziTimeZoneMailRu.DaylightBias = pitTime->lTimeZone%100;
SystemTimeToTzSpecificLocalTime(&tziTimeZoneMailRu, &pitTime->stTime, &stUniversalTime);
- SystemTimeToTzSpecificLocalTime(NULL, &stUniversalTime, &stTime);
+ SystemTimeToTzSpecificLocalTime(nullptr, &stUniversalTime, &stTime);
return (DWORD)MakeTime32FromLocalSystemTime(&stTime);
}
@@ -25,8 +25,8 @@ static DWORD MraOfflineMessageGetHeaderValueLow(LPSTR lpszHeaderLow, size_t dwHe if (lpszValue) {
lpszValue += dwValueNameSize;
LPSTR lpszValueEnd = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, dwHeaderSize, CRLF, (sizeof(CRLF)-1));
- if (lpszValueEnd == NULL) lpszValueEnd = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, dwHeaderSize, LF, (sizeof(LF)-1));
- if (lpszValueEnd == NULL) lpszValueEnd = (LPSTR)(lpszHeaderLow+dwHeaderSize);
+ if (lpszValueEnd == nullptr) lpszValueEnd = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, dwHeaderSize, LF, (sizeof(LF)-1));
+ if (lpszValueEnd == nullptr) lpszValueEnd = (LPSTR)(lpszHeaderLow+dwHeaderSize);
lpszValue = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, (lpszValueEnd-lpszHeaderLow), ":", 1);
if (lpszValue) {
@@ -70,9 +70,9 @@ static DWORD MraOfflineMessageGetHeaderValue(LPSTR lpszHeader, LPSTR lpszHeaderL if (lpszValue) {
lpszValue += dwValueNameSize;
LPSTR lpszValueEnd = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, dwHeaderSize, CRLF, (sizeof(CRLF)-1));
- if (lpszValueEnd == NULL)
+ if (lpszValueEnd == nullptr)
lpszValueEnd = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, dwHeaderSize, LF, (sizeof(LF)-1));
- if (lpszValueEnd == NULL)
+ if (lpszValueEnd == nullptr)
lpszValueEnd = (LPSTR)(lpszHeaderLow+dwHeaderSize);
lpszValue = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, (lpszValueEnd-lpszHeaderLow), ":", 1);
@@ -105,11 +105,11 @@ static DWORD MraOfflineMessageGetNextMIMEPart(LPSTR lpszBody, size_t dwBodySize, else if ((*((BYTE*)lpszMIMEPart)) == (*((BYTE*)LF)))
lpszMIMEPart += (sizeof(LF)-1);
else if ((*((WORD*)lpszMIMEPart)) == '--')
- lpszMIMEPart = NULL;
+ lpszMIMEPart = nullptr;
else
_CrtDbgBreak();
- if (lpszMIMEPart == NULL)
+ if (lpszMIMEPart == nullptr)
return ERROR_NO_MORE_ITEMS;
LPSTR lpszTemp = (LPSTR)MemoryFind((lpszMIMEPart-lpszBody), lpszBody, dwBodySize, lpszBoundary, dwBoundarySize);
if (lpszTemp) {// нашли конец миме части с текстом
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp index 10d6599e9d..6b0d4fd4bd 100644 --- a/protocols/MRA/src/MraPopUp.cpp +++ b/protocols/MRA/src/MraPopUp.cpp @@ -11,7 +11,7 @@ static LPCWSTR lpcwszPopupsTypes[] = LPGENW("Warning"),
LPGENW("Error"),
LPGENW("NewMail"),
- NULL
+ nullptr
};
INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -114,7 +114,7 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR ppro->setDword(szBuff, SendDlgItemMessage(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0));
mir_snprintf(szBuff, "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
- ppro->setDword(szBuff, GetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, NULL, FALSE));
+ ppro->setDword(szBuff, GetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, nullptr, FALSE));
}
return TRUE;
}
@@ -174,7 +174,7 @@ LRESULT CALLBACK MraPopupDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM l if (HIWORD(wParam) == STN_CLICKED) { //It was a click on the Popup.
if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS) {
CallProtoService(dat->ppro->m_szModuleName, MRA_GOTO_INBOX, 0, 0);
- dat->ppro->hWndEMailPopupStatus = NULL;
+ dat->ppro->hWndEMailPopupStatus = nullptr;
}
}
PUDeletePopup(hWndDlg);
@@ -182,13 +182,13 @@ LRESULT CALLBACK MraPopupDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM l case WM_CONTEXTMENU:
if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS)
- dat->ppro->hWndEMailPopupStatus = NULL;
+ dat->ppro->hWndEMailPopupStatus = nullptr;
PUDeletePopup(hWndDlg);
break;
case UM_FREEPLUGINDATA:
if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS)
- dat->ppro->hWndEMailPopupStatus = NULL;
+ dat->ppro->hWndEMailPopupStatus = nullptr;
mir_free(dat);
break;
}
@@ -217,7 +217,7 @@ void CMraProto::MraPopupShowW(MCONTACT hContact, DWORD dwType, LPWSTR lpszTitle, // delete old email popup
if (dwType == MRA_POPUP_TYPE_EMAIL_STATUS && hWndEMailPopupStatus) {
PUDeletePopup(hWndEMailPopupStatus);
- hWndEMailPopupStatus = NULL;
+ hWndEMailPopupStatus = nullptr;
}
POPUPDATAT ppd = { 0 };
@@ -227,19 +227,19 @@ void CMraProto::MraPopupShowW(MCONTACT hContact, DWORD dwType, LPWSTR lpszTitle, ppd.lchIcon = g_hMainIcon;
break;
case MRA_POPUP_TYPE_DEBUG:// IDI_APPLICATION
- ppd.lchIcon = (HICON)LoadImage(NULL, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_SHARED);
+ ppd.lchIcon = (HICON)LoadImage(nullptr, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_SHARED);
break;
case MRA_POPUP_TYPE_INFORMATION:// IDI_INFORMATION
- ppd.lchIcon = (HICON)LoadImage(NULL, IDI_INFORMATION, IMAGE_ICON, 0, 0, LR_SHARED);
+ ppd.lchIcon = (HICON)LoadImage(nullptr, IDI_INFORMATION, IMAGE_ICON, 0, 0, LR_SHARED);
break;
case MRA_POPUP_TYPE_QUESTION:// IDI_QUESTION
- ppd.lchIcon = (HICON)LoadImage(NULL, IDI_QUESTION, IMAGE_ICON, 0, 0, LR_SHARED);
+ ppd.lchIcon = (HICON)LoadImage(nullptr, IDI_QUESTION, IMAGE_ICON, 0, 0, LR_SHARED);
break;
case MRA_POPUP_TYPE_WARNING:// IDI_WARNING
- ppd.lchIcon = (HICON)LoadImage(NULL, IDI_WARNING, IMAGE_ICON, 0, 0, LR_SHARED);
+ ppd.lchIcon = (HICON)LoadImage(nullptr, IDI_WARNING, IMAGE_ICON, 0, 0, LR_SHARED);
break;
case MRA_POPUP_TYPE_ERROR:// IDI_ERROR
- ppd.lchIcon = (HICON)LoadImage(NULL, IDI_ERROR, IMAGE_ICON, 0, 0, LR_SHARED);
+ ppd.lchIcon = (HICON)LoadImage(nullptr, IDI_ERROR, IMAGE_ICON, 0, 0, LR_SHARED);
break;
case MRA_POPUP_TYPE_EMAIL_STATUS:
ppd.lchIcon = (HICON)LoadImage(g_hInstance, MAKEINTRESOURCE(IDI_MAIL_NOTIFY), IMAGE_ICON, 0, 0, LR_SHARED);
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index ca19b6290a..91f84dca59 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -91,7 +91,7 @@ int CMraProto::OnModulesLoaded(WPARAM, LPARAM) // всех в offline // тк unsaved values сохраняются их нужно инициализировать
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact != NULL; hContact = db_find_next(hContact, m_szModuleName))
- SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, 0, 0, 0);
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, nullptr, nullptr, nullptr);
// unsaved values
db_set_resident(m_szModuleName, "LogonTS");
@@ -208,7 +208,7 @@ int CMraProto::AuthDeny(MEVENT hDBEvent, const wchar_t* szReason) if (mir_strcmp(dbei.szModule, m_szModuleName)) return 1;
DB_AUTH_BLOB blob(dbei.pBlob);
- MraMessage(FALSE, NULL, 0, 0, blob.get_email(), szReason, NULL, 0);
+ MraMessage(FALSE, NULL, 0, 0, blob.get_email(), szReason, nullptr, 0);
return 0;
}
@@ -221,11 +221,11 @@ int CMraProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre) HANDLE CMraProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t *szPath)
{
- if (szPath != NULL)
+ if (szPath != nullptr)
if (MraFilesQueueAccept(hFilesQueueHandle, (DWORD_PTR)hTransfer, szPath, mir_wstrlen(szPath)) == NO_ERROR)
return hTransfer; // Success
- return NULL;
+ return nullptr;
}
int CMraProto::FileCancel(MCONTACT hContact, HANDLE hTransfer)
@@ -301,7 +301,7 @@ HANDLE CMraProto::SearchByEmail(const wchar_t *email) return MraWPRequestByEMail(NULL, ACKTYPE_SEARCH, szEmail);
}
- return NULL;
+ return nullptr;
}
HANDLE CMraProto::SearchByName(const wchar_t *pszNick, const wchar_t *pszFirstName, const wchar_t *pszLastName)
@@ -314,7 +314,7 @@ HANDLE CMraProto::SearchByName(const wchar_t *pszNick, const wchar_t *pszFirstNa return MraWPRequestW(NULL, ACKTYPE_SEARCH, dwRequestFlags, "", "", pszNick, pszFirstName, pszLastName, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
- return NULL;
+ return nullptr;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -350,12 +350,12 @@ int CMraProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hCo }
bSlowSend = getByte("SlowSend", MRA_DEFAULT_SLOW_SEND);
- iRet = MraMessage(bSlowSend, hContact, ACKTYPE_CONTACTS, MESSAGE_FLAG_CONTACT, szEmail, wszData, NULL, 0);
+ iRet = MraMessage(bSlowSend, hContact, ACKTYPE_CONTACTS, MESSAGE_FLAG_CONTACT, szEmail, wszData, nullptr, 0);
if (bSlowSend == FALSE)
ProtoBroadcastAck(hContact, ACKTYPE_CONTACTS, ACKRESULT_SUCCESS, (HANDLE)iRet, 0);
}
}
- else ProtoBroadcastAck(hContact, ACKTYPE_CONTACTS, ACKRESULT_FAILED, NULL, (LPARAM)"You cannot send when you are offline.");
+ else ProtoBroadcastAck(hContact, ACKTYPE_CONTACTS, ACKRESULT_FAILED, nullptr, (LPARAM)"You cannot send when you are offline.");
return iRet;
}
@@ -363,7 +363,7 @@ int CMraProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hCo HANDLE CMraProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles)
{
if (!m_bLoggedIn || !hContact || !ppszFiles)
- return NULL;
+ return nullptr;
size_t dwFilesCount;
for (dwFilesCount = 0; ppszFiles[dwFilesCount]; dwFilesCount++);
@@ -376,14 +376,14 @@ HANDLE CMraProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFile int CMraProto::SendMsg(MCONTACT hContact, int, const char *lpszMessage)
{
if (!m_bLoggedIn) {
- ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)"You cannot send when you are offline.");
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, nullptr, (LPARAM)"You cannot send when you are offline.");
return 0;
}
DWORD dwFlags = 0;
CMStringW wszMessage(ptrW(mir_utf8decodeW(lpszMessage)));
if (wszMessage.IsEmpty()) {
- ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)"Cant allocate buffer for convert to unicode.");
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, nullptr, (LPARAM)"Cant allocate buffer for convert to unicode.");
return 0;
}
@@ -425,8 +425,8 @@ int CMraProto::SetApparentMode(MCONTACT hContact, int mode) break;
}
- if (MraModifyContact(hContact, 0, &dwContactFlag)) {
- SetContactBasicInfoW(hContact, 0, SCBIF_FLAG, 0, 0, dwContactFlag, 0, 0, 0, 0, 0);
+ if (MraModifyContact(hContact, nullptr, &dwContactFlag)) {
+ SetContactBasicInfoW(hContact, 0, SCBIF_FLAG, 0, 0, dwContactFlag, 0, 0, nullptr, nullptr, nullptr);
return 0; // Success
}
}
@@ -463,9 +463,9 @@ int CMraProto::SetStatus(int iNewStatus) // всех в offline, только если мы бывали подключены
if (dwOldStatusMode > ID_STATUS_OFFLINE)
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
- SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, 0, 0, 0);
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, nullptr, nullptr, nullptr);
- if (m_hConnection != NULL)
+ if (m_hConnection != nullptr)
Netlib_Shutdown(m_hConnection);
}
else {
@@ -504,7 +504,7 @@ int CMraProto::SetStatus(int iNewStatus) HANDLE CMraProto::GetAwayMsg(MCONTACT hContact)
{
if (!m_bLoggedIn || !hContact)
- return 0;
+ return nullptr;
wchar_t szStatusDesc[MICBLOG_STATUS_MAX + MICBLOG_STATUS_MAX + MAX_PATH], szTime[64];
DWORD dwTime;
@@ -551,7 +551,7 @@ int CMraProto::UserIsTyping(MCONTACT hContact, int type) CMStringA szEmail;
if (MraGetContactStatus(hContact) != ID_STATUS_OFFLINE)
if (mraGetStringA(hContact, "e-mail", szEmail))
- if (MraMessage(FALSE, hContact, 0, MESSAGE_FLAG_NOTIFY, szEmail, L" ", NULL, 0))
+ if (MraMessage(FALSE, hContact, 0, MESSAGE_FLAG_NOTIFY, szEmail, L" ", nullptr, 0))
return 0;
return 1;
diff --git a/protocols/MRA/src/MraRTFMsg.cpp b/protocols/MRA/src/MraRTFMsg.cpp index f12c479fee..373d77b19d 100644 --- a/protocols/MRA/src/MraRTFMsg.cpp +++ b/protocols/MRA/src/MraRTFMsg.cpp @@ -154,7 +154,7 @@ DWORD MraSymbolsToRTFTags(LPSTR lpszMessage, size_t dwMessageSize, LPSTR lpszMes while (dwFoundCount) {
for (i = 0;i<SYMBOLS_COUNT;i++)
- if (lpszFounded[i] && (lpszFounded[i]<lpszFounded[dwFirstFoundIndex] || lpszFounded[dwFirstFoundIndex] == NULL))
+ if (lpszFounded[i] && (lpszFounded[i]<lpszFounded[dwFirstFoundIndex] || lpszFounded[dwFirstFoundIndex] == nullptr))
dwFirstFoundIndex = i;
if (lpszFounded[dwFirstFoundIndex]) { // found
@@ -206,12 +206,12 @@ DWORD CMraProto::MraConvertToRTFW(const CMStringW &wszMessage, CMStringA &szMess LOGFONT lf = {0};
dwRTFFontColour = getDword("RTFFontColour", MRA_DEFAULT_RTF_FONT_COLOUR);
- if ( !mraGetContactSettingBlob(NULL, "RTFFont", &lf, sizeof(LOGFONT), NULL)) {
- HDC hDC = GetDC(NULL);// kegl
+ if ( !mraGetContactSettingBlob(NULL, "RTFFont", &lf, sizeof(LOGFONT), nullptr)) {
+ HDC hDC = GetDC(nullptr);// kegl
lf.lfCharSet = MRA_DEFAULT_RTF_FONT_CHARSET;
lf.lfHeight = -MulDiv(MRA_DEFAULT_RTF_FONT_SIZE, GetDeviceCaps(hDC, LOGPIXELSY), 72);
mir_wstrncpy(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
- ReleaseDC(NULL, hDC);
+ ReleaseDC(nullptr, hDC);
}
dwFontSize = ((-lf.lfHeight)+(((-lf.lfHeight)+4)/8));
diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp index 096da605d9..51d9078ff2 100644 --- a/protocols/MRA/src/MraSelectEMail.cpp +++ b/protocols/MRA/src/MraSelectEMail.cpp @@ -146,7 +146,7 @@ DWORD CMraProto::MraSelectEMailDlgShow(MCONTACT hContact, DWORD dwType) dat->ppro = this;
dat->hContact = hContact;
dat->dwType = dwType;
- DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_DIALOG_SELECT_EMAIL), NULL, MraSelectEMailDlgProc, (LPARAM)dat);
+ DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_DIALOG_SELECT_EMAIL), nullptr, MraSelectEMailDlgProc, (LPARAM)dat);
}
return 0;
}
diff --git a/protocols/MRA/src/MraSendQueue.cpp b/protocols/MRA/src/MraSendQueue.cpp index f35fea2fe6..52661d4fb1 100644 --- a/protocols/MRA/src/MraSendQueue.cpp +++ b/protocols/MRA/src/MraSendQueue.cpp @@ -42,7 +42,7 @@ void MraSendQueueDestroy(HANDLE hSendQueueHandle) MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
{
mir_cslock l(pmrasqSendQueue->cs);
- while ( !ListMTItemGetFirst(pmrasqSendQueue, NULL, (LPVOID*)&pmrasqiSendQueueItem)) {
+ while ( !ListMTItemGetFirst(pmrasqSendQueue, nullptr, (LPVOID*)&pmrasqiSendQueueItem)) {
ListMTItemDelete(pmrasqSendQueue, pmrasqiSendQueueItem);
mir_free(pmrasqiSendQueueItem);
}
@@ -89,7 +89,7 @@ DWORD MraSendQueueFree(HANDLE hSendQueueHandle, DWORD dwCMDNum) mir_cslock l(pmrasqSendQueue->cs);
ListMTIteratorMoveFirst(pmrasqSendQueue, &lmtiIterator);
do {
- if ( !ListMTIteratorGet(&lmtiIterator, NULL, (LPVOID*)&pmrasqiSendQueueItem))
+ if ( !ListMTIteratorGet(&lmtiIterator, nullptr, (LPVOID*)&pmrasqiSendQueueItem))
if (pmrasqiSendQueueItem->dwCMDNum == dwCMDNum) {
ListMTItemDelete(pmrasqSendQueue, pmrasqiSendQueueItem);
mir_free(pmrasqiSendQueueItem);
@@ -113,7 +113,7 @@ DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, mir_cslock l(pmrasqSendQueue->cs);
ListMTIteratorMoveFirst(pmrasqSendQueue, &lmtiIterator);
do {
- if ( !ListMTIteratorGet(&lmtiIterator, NULL, (LPVOID*)&pmrasqiSendQueueItem))
+ if ( !ListMTIteratorGet(&lmtiIterator, nullptr, (LPVOID*)&pmrasqiSendQueueItem))
if (pmrasqiSendQueueItem->dwCMDNum == dwCMDNum) {
if (pdwFlags) (*pdwFlags) = pmrasqiSendQueueItem->dwFlags;
if (phContact) (*phContact) = pmrasqiSendQueueItem->hContact;
@@ -144,7 +144,7 @@ DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pd ListMTIteratorMoveFirst(pmrasqSendQueue, &lmtiIterator);
do {
MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
- if ( !ListMTIteratorGet(&lmtiIterator, NULL, (LPVOID*)&pmrasqiSendQueueItem))
+ if ( !ListMTIteratorGet(&lmtiIterator, nullptr, (LPVOID*)&pmrasqiSendQueueItem))
if ((*((DWORDLONG*)&ftExpireTime))>(*((DWORDLONG*)&pmrasqiSendQueueItem->ftSendTime))) {
if (pdwCMDNum) *pdwCMDNum = pmrasqiSendQueueItem->dwCMDNum;
if (pdwFlags) *pdwFlags = pmrasqiSendQueueItem->dwFlags;
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index 957318c000..1c483c262c 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -30,7 +30,7 @@ INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM, LPARAM) if (!m_bLoggedIn)
return 0;
- if (MessageBox(NULL, TranslateT("Are you sure?"), TranslateT(MRA_UPD_ALL_USERS_INFO_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ if (MessageBox(nullptr, TranslateT("Are you sure?"), TranslateT(MRA_UPD_ALL_USERS_INFO_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
CMStringA szEmail;
if (mraGetStringA(hContact, "e-mail", szEmail))
@@ -42,7 +42,7 @@ INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM, LPARAM) INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM, LPARAM)
{
- if (MessageBox(NULL, TranslateT("Are you sure?"), TranslateT(MRA_CHK_USERS_AVATARS_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ if (MessageBox(nullptr, TranslateT("Are you sure?"), TranslateT(MRA_CHK_USERS_AVATARS_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
CMStringA szEmail;
if (mraGetStringA(hContact, "e-mail", szEmail))
@@ -58,10 +58,10 @@ INT_PTR CMraProto::MraRequestAuthForAll(WPARAM, LPARAM) if (!m_bLoggedIn)
return 0;
- if (MessageBox(NULL, TranslateT("Are you sure?"), TranslateT(MRA_REQ_AUTH_FOR_ALL_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ if (MessageBox(nullptr, TranslateT("Are you sure?"), TranslateT(MRA_REQ_AUTH_FOR_ALL_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DWORD dwContactSeverFlags;
- if (GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL) == NO_ERROR)
+ if (GetContactBasicInfoW(hContact, nullptr, nullptr, nullptr, &dwContactSeverFlags, nullptr, nullptr, nullptr, nullptr) == NO_ERROR)
if (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED && dwContactSeverFlags != -1)
MraRequestAuthorization(hContact, 0);
}
@@ -84,7 +84,7 @@ INT_PTR CMraProto::MraRequestAuthorization(WPARAM hContact, LPARAM) CMStringA szEmail;
if (mraGetStringA(hContact, "e-mail", szEmail)) {
BOOL bSlowSend = getByte("SlowSend", MRA_DEFAULT_SLOW_SEND);
- int iRet = MraMessage(bSlowSend, hContact, ACKTYPE_AUTHREQ, MESSAGE_FLAG_AUTHORIZE, szEmail, wszAuthMessage, NULL, 0);
+ int iRet = MraMessage(bSlowSend, hContact, ACKTYPE_AUTHREQ, MESSAGE_FLAG_AUTHORIZE, szEmail, wszAuthMessage, nullptr, 0);
if (bSlowSend == FALSE)
ProtoBroadcastAck(hContact, ACKTYPE_AUTHREQ, ACKRESULT_SUCCESS, (HANDLE)iRet, 0);
@@ -222,7 +222,7 @@ int CMraProto::MraRebuildContactMenu(WPARAM hContact, LPARAM) bHasEMail = true;
bHasEMailMR = true;
bChatAgent = IsContactChatAgent(hContact);
- GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL);
+ GetContactBasicInfoW(hContact, nullptr, nullptr, nullptr, &dwContactSeverFlags, nullptr, nullptr, nullptr, nullptr);
mraGetStringW(hContact, DBSETTING_BLOGSTATUS, blogStatusMsgSize);
}
// non proto contact
@@ -315,7 +315,7 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) }
else {
mi.name.w = (wchar_t*)lpcszXStatusNameDef[i];
- mi.hIcolibItem = NULL;
+ mi.hIcolibItem = nullptr;
}
hXStatusMenuItems[i] = Menu_AddStatusMenuItem(&mi, m_szModuleName);
}
@@ -327,7 +327,7 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bIsMain, const IconItem *pgdiItems, size_t dwCount, HGENMENU *hResult)
{
if (!pgdiItems || !dwCount || !hResult)
- return NULL;
+ return nullptr;
char szServiceFunction[MAX_PATH];
@@ -338,7 +338,7 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI fnAddFunc = Menu_AddProtoMenuItem;
hRootMenu = Menu_GetProtocolRoot(this);
- if (hRootMenu == NULL) {
+ if (hRootMenu == nullptr) {
mi.name.w = m_tszUserName;
mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.hIcolibItem = g_hMainIcon;
diff --git a/protocols/MRA/src/Mra_options.cpp b/protocols/MRA/src/Mra_options.cpp index 68689c4385..aad1ff9c7c 100644 --- a/protocols/MRA/src/Mra_options.cpp +++ b/protocols/MRA/src/Mra_options.cpp @@ -165,12 +165,12 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L cf.lpLogFont = &lf;
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
+ if (ppro->mraGetContactSettingBlob(NULL, "RTFFont", &lf, sizeof(LOGFONT), nullptr) == FALSE) {
+ HDC hDC = GetDC(nullptr);// kegl
lf.lfCharSet = MRA_DEFAULT_RTF_FONT_CHARSET;
lf.lfHeight = -MulDiv(MRA_DEFAULT_RTF_FONT_SIZE, GetDeviceCaps(hDC, LOGPIXELSY), 72);
mir_wstrncpy(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
- ReleaseDC(NULL, hDC);
+ ReleaseDC(nullptr, hDC);
}
if (ChooseFont(&cf)) {
@@ -189,7 +189,7 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L wchar_t szBuff[MAX_PATH];
GetDlgItemText(hWndDlg, IDC_SERVER, szBuff, _countof(szBuff));
ppro->mraSetStringW(NULL, "Server", szBuff);
- ppro->setWord("ServerPort", (WORD)GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
+ ppro->setWord("ServerPort", (WORD)GetDlgItemInt(hWndDlg, IDC_SERVERPORT, nullptr, FALSE));
ppro->setByte("AutoAddContactsToServer", IsDlgButtonChecked(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER));
ppro->setByte("AutoAuthRequestOnLogon", IsDlgButtonChecked(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON));
ppro->setByte("AutoAuthGrandUsersInCList", IsDlgButtonChecked(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST));
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index b9f669410c..effd097f75 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -23,7 +23,7 @@ DWORD CMraProto::StartConnect() MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING, TranslateT("Please, setup password in options"));
else {
InterlockedExchange((volatile LONG*)&m_dwThreadWorkerLastPingTime, GetTickCount());
- if (INVALID_HANDLE_VALUE != ForkThreadEx(&CMraProto::MraThreadProc, NULL, 0))
+ if (INVALID_HANDLE_VALUE != ForkThreadEx(&CMraProto::MraThreadProc, nullptr, nullptr))
return 0; /* OK. */
MraPopupShowFromAgentW(MRA_POPUP_TYPE_ERROR, TranslateT("Thread creation failure"));
}
@@ -61,7 +61,7 @@ void CMraProto::MraThreadProc(LPVOID) InterlockedExchange((volatile LONG*)&m_dwThreadWorkerLastPingTime, GetTickCount());
m_hConnection = Netlib_OpenConnection(m_hNetlibUser, &nloc);
}
- while (--dwCurConnectReTryCount && m_hConnection == NULL);
+ while (--dwCurConnectReTryCount && m_hConnection == nullptr);
if (m_hConnection)
bConnected = TRUE;
@@ -84,7 +84,7 @@ void CMraProto::MraThreadProc(LPVOID) InterlockedExchange((volatile LONG*)&m_dwThreadWorkerLastPingTime, GetTickCount());
m_hConnection = Netlib_OpenConnection(m_hNetlibUser, &nloc);
}
- while (--dwCurConnectReTryCount && m_hConnection == NULL);
+ while (--dwCurConnectReTryCount && m_hConnection == nullptr);
if (m_hConnection) {
bConnected = TRUE;
@@ -98,7 +98,7 @@ void CMraProto::MraThreadProc(LPVOID) else {
if (bConnected == FALSE) {
ShowFormattedErrorMessage(L"Can't connect to MRIM server, error", GetLastError());
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_NONETWORK);
}
}
@@ -145,7 +145,7 @@ DWORD CMraProto::MraGetNLBData(CMStringA &szHost, WORD *pwPort) InterlockedExchange((volatile LONG*)&m_dwThreadWorkerLastPingTime, GetTickCount());
nls.hReadConns[0] = Netlib_OpenConnection(m_hNetlibUser, &nloc);
}
- while (--dwCurConnectReTryCount && nls.hReadConns[0] == NULL);
+ while (--dwCurConnectReTryCount && nls.hReadConns[0] == nullptr);
if (nls.hReadConns[0]) {
nls.dwTimeout = 1000 * getDword("TimeOutReceiveNLB", MRA_DEFAULT_TIMEOUT_RECV_NLB);
@@ -215,7 +215,7 @@ DWORD CMraProto::MraNetworkDispatcher() m_dwNextPingSendTickTime = m_dwPingPeriod = MAXDWORD;
dwCMDNum = 0;
- MraSendCMD(MRIM_CS_HELLO, NULL, 0);
+ MraSendCMD(MRIM_CS_HELLO, nullptr, 0);
while (m_iStatus != ID_STATUS_OFFLINE && bContinue) {
int iSelectRet = Netlib_Select(&nls);
if (SOCKET_ERROR == iSelectRet) {
@@ -231,7 +231,7 @@ DWORD CMraProto::MraNetworkDispatcher() if (m_dwNextPingSendTickTime <= m_dwThreadWorkerLastPingTime) {
nls.dwTimeout = (m_dwPingPeriod * 1000);
m_dwNextPingSendTickTime = (m_dwThreadWorkerLastPingTime + nls.dwTimeout);
- MraSendCMD(MRIM_CS_PING, NULL, 0);
+ MraSendCMD(MRIM_CS_PING, nullptr, 0);
} else {
if (MAXDWORD != m_dwNextPingSendTickTime)
nls.dwTimeout = (m_dwNextPingSendTickTime - m_dwThreadWorkerLastPingTime);
@@ -383,7 +383,7 @@ bool CMraProto::CmdLoginAck() {
m_bLoggedIn = TRUE;
m_dwNextPingSendTickTime = 0; // force send ping
- MraSendCMD(MRIM_CS_PING, NULL, 0);
+ MraSendCMD(MRIM_CS_PING, nullptr, 0);
SetStatus(m_iDesiredStatus);
MraAvatarsQueueGetAvatarSimple(hAvatarsQueueHandle, GAIF_FORCE, NULL);
return true;
@@ -392,7 +392,7 @@ bool CMraProto::CmdLoginAck() // Unsuccessful authorization //LPS ## reason ## причина отказа
bool CMraProto::CmdLoginRejected(BinBuffer &buf)
{
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_WRONGPASSWORD);
CMStringA reason; buf >> reason;
MraPopupShowW(NULL, MRA_POPUP_TYPE_ERROR, TranslateT("Logon error: invalid login/password"), _A2T(reason.c_str()));
@@ -412,7 +412,7 @@ bool CMraProto::CmdMessageAck(BinBuffer &buf) buf >> szMultiChatData; // LPS multichat_data
// подтверждаем получение, только если удалось его обработать
- if (MraRecvCommand_Message((DWORD)_time32(NULL), dwFlags, szEmail, szText, szRTFText, szMultiChatData) == NO_ERROR)
+ if (MraRecvCommand_Message((DWORD)_time32(nullptr), dwFlags, szEmail, szText, szRTFText, szMultiChatData) == NO_ERROR)
if ((dwFlags & MESSAGE_FLAG_NORECV) == 0)
MraMessageRecv(szEmail, dwMsgID);
return true;
@@ -422,7 +422,7 @@ bool CMraProto::CmdMessageStatus(ULONG seq, BinBuffer &buf) {
DWORD dwAckType, dwTemp = buf.getDword();
MCONTACT hContact;
- if (!MraSendQueueFind(hSendQueueHandle, seq, NULL, &hContact, &dwAckType, NULL, NULL)) {
+ if (!MraSendQueueFind(hSendQueueHandle, seq, nullptr, &hContact, &dwAckType, nullptr, nullptr)) {
switch (dwTemp) {
case MESSAGE_DELIVERED:// Message delivered directly to user
ProtoBroadcastAckAsync(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)seq, 0);
@@ -562,7 +562,7 @@ bool CMraProto::CmdAuthAck(BinBuffer &buf) DBEVENTINFO dbei = {};
dbei.flags = DBEF_UTF;
dbei.szModule = m_szModuleName;
- dbei.timestamp = (DWORD)_time32(NULL);
+ dbei.timestamp = (DWORD)_time32(nullptr);
dbei.eventType = EVENTTYPE_ADDED;
dbei.cbBlob = szBuff.GetLength();
dbei.pBlob = (PBYTE)szBuff.GetString();
@@ -570,9 +570,9 @@ bool CMraProto::CmdAuthAck(BinBuffer &buf) }
DWORD dwTemp;
- GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwTemp, NULL, NULL, NULL, NULL);
+ GetContactBasicInfoW(hContact, nullptr, nullptr, nullptr, &dwTemp, nullptr, nullptr, nullptr, nullptr);
dwTemp &= ~CONTACT_INTFLAG_NOT_AUTHORIZED;
- SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, SCBIF_SERVER_FLAG, 0, 0, 0, dwTemp, 0, 0, 0, 0);
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, SCBIF_SERVER_FLAG, 0, 0, 0, dwTemp, 0, nullptr, nullptr, nullptr);
setDword(hContact, "HooksLocked", TRUE);
db_unset(hContact, "CList", "NotOnList");
setDword(hContact, "HooksLocked", FALSE);
@@ -714,7 +714,7 @@ bool CMraProto::CmdUserStatus(BinBuffer &buf) bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf)
{
DWORD dwAckType; MCONTACT hContact;
- if (!MraSendQueueFind(hSendQueueHandle, seq, NULL, &hContact, &dwAckType, NULL, NULL)) {
+ if (!MraSendQueueFind(hSendQueueHandle, seq, nullptr, &hContact, &dwAckType, nullptr, nullptr)) {
DWORD dwTemp = buf.getDword();
switch (dwTemp) {
case CONTACT_OPER_SUCCESS:// ## добавление произведено успешно
@@ -725,7 +725,7 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf) dwFlags |= SCBIF_GROUP_ID;
dwGroupID = MraMoveContactToGroup(hContact, -1, grpName);
}
- SetContactBasicInfoW(hContact, 0, dwFlags, buf.getDword(), dwGroupID, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, 0, 0, 0, 0);
+ SetContactBasicInfoW(hContact, 0, dwFlags, buf.getDword(), dwGroupID, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, 0, nullptr, nullptr, nullptr);
}
break;
case CONTACT_OPER_ERROR:// ## переданные данные были некорректны
@@ -735,7 +735,7 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf) ShowFormattedErrorMessage(L"Internal server error", NO_ERROR);
break;
case CONTACT_OPER_NO_SUCH_USER:// ## добавляемого пользователя не существует в системе
- SetContactBasicInfoW(hContact, 0, SCBIF_SERVER_FLAG, 0, 0, 0, -1, 0, 0, 0, 0);
+ SetContactBasicInfoW(hContact, 0, SCBIF_SERVER_FLAG, 0, 0, 0, -1, 0, nullptr, nullptr, nullptr);
ShowFormattedErrorMessage(L"No such user to add", NO_ERROR);
break;
case CONTACT_OPER_INVALID_INFO:// ## некорректное имя пользователя
@@ -762,14 +762,14 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf) bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf)
{
DWORD dwAckType, dwFlags; MCONTACT hContact;
- if (MraSendQueueFind(hSendQueueHandle, seq, &dwFlags, &hContact, &dwAckType, NULL, NULL)) {
+ if (MraSendQueueFind(hSendQueueHandle, seq, &dwFlags, &hContact, &dwAckType, nullptr, nullptr)) {
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, TranslateT("MRIM_ANKETA_INFO: not found in queue"));
return true;
}
switch (buf.getDword()) {
case MRIM_ANKETA_INFO_STATUS_NOUSER:// не найдено ни одной подходящей записи
- SetContactBasicInfoW(hContact, 0, SCBIF_SERVER_FLAG, 0, 0, 0, -1, 0, 0, 0, 0);
+ SetContactBasicInfoW(hContact, 0, SCBIF_SERVER_FLAG, 0, 0, 0, -1, 0, nullptr, nullptr, nullptr);
case MRIM_ANKETA_INFO_STATUS_DBERR:// ошибка базы данных
case MRIM_ANKETA_INFO_STATUS_RATELIMERR:// слишком много запросов, поиск временно запрещен
switch (dwAckType) {
@@ -805,7 +805,7 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf) while (!buf.eof()) {
// write to DB and exit loop
if (dwAckType == ACKTYPE_GETINFO && hContact) {
- setDword(hContact, "InfoTS", (DWORD)_time32(NULL));
+ setDword(hContact, "InfoTS", (DWORD)_time32(nullptr));
//MRA_LPS mralpsUsernameValue;
for (DWORD i = 0; i < dwFieldsNum; i++) {
CMStringA &fld = pmralpsFields[i];
@@ -927,7 +927,7 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf) }
} /* for */
// для авторизованного нам и так присылают правильный статус
- GetContactBasicInfoW(hContact, &dwID, NULL, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL);
+ GetContactBasicInfoW(hContact, &dwID, nullptr, nullptr, &dwContactSeverFlags, nullptr, nullptr, nullptr, nullptr);
if (dwID == -1 || (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED)) {
/* Convert mail.ru statuses to miranda. */
dwStatus = GetMirandaStatusFromMraStatus(dwStatus, dwXStatus, &dwXStatus);
@@ -1019,7 +1019,7 @@ bool CMraProto::CmdGame(BinBuffer &buf) case GAME_INC_VERSION:
break;
case GAME_NO_SUCH_GAME:// user invisible
- if ((hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL)))
+ if ((hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, nullptr)))
if (MraGetContactStatus(hContact) == ID_STATUS_OFFLINE)
MraSetContactStatus(hContact, ID_STATUS_INVISIBLE);
break;
@@ -1244,7 +1244,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) MCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, FALSE, &bAdded);
if (hContact) {
// already in list, remove the duplicate
- if (GetContactBasicInfoW(hContact, &dwTemp, NULL, NULL, NULL, NULL, NULL, NULL, NULL) == NO_ERROR && dwTemp != -1) {
+ if (GetContactBasicInfoW(hContact, &dwTemp, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr) == NO_ERROR && dwTemp != -1) {
_CrtDbgBreak();
}
else {
@@ -1252,7 +1252,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) if (bAdded) { // update user info
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_FLAG | SCBIF_SERVER_FLAG | SCBIF_STATUS | SCBIF_NICK | SCBIF_PHONES),
- dwID, dwGroupID, dwContactFlag, dwContactSeverFlags, dwTemp, NULL, &wszNick, &szCustomPhones);
+ dwID, dwGroupID, dwContactFlag, dwContactSeverFlags, dwTemp, nullptr, &wszNick, &szCustomPhones);
// request user info from server
MraUpdateContactInfo(hContact);
}
@@ -1264,7 +1264,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) }
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS),
- dwID, dwGroupID, dwContactFlag, dwContactSeverFlags, dwTemp, NULL, &wszNick, &szCustomPhones);
+ dwID, dwGroupID, dwContactFlag, dwContactSeverFlags, dwTemp, nullptr, &wszNick, &szCustomPhones);
if (wszNick.IsEmpty()) { // set the server-side nick
wszNick = pcli->pfnGetContactDisplayName(hContact, 0);
MraModifyContact(hContact, &dwID, &dwContactFlag, &dwGroupID, &szEmail, &wszNick, &szCustomPhones);
@@ -1309,7 +1309,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) wszAuthMessage = TranslateW(MRA_DEFAULT_AUTH_MESSAGE);
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- if (GetContactBasicInfoW(hContact, &dwID, NULL, NULL, NULL, NULL, &email, NULL, NULL) == NO_ERROR)
+ if (GetContactBasicInfoW(hContact, &dwID, nullptr, nullptr, nullptr, nullptr, &email, nullptr, nullptr) == NO_ERROR)
if (dwID == -1) {
if (IsEMailChatAgent(email)) {// чат: ещё раз запросим авторизацию, пометим как видимый в списке, постоянный
db_unset(hContact, "CList", "Hidden");
@@ -1324,7 +1324,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) if (db_get_b(hContact, "CList", "NotOnList", 0) == 0) { // set extra icons and upload contact
SetExtraIcons(hContact);
if (getByte("AutoAddContactsToServer", MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER)) { //add all contacts to server
- GetContactBasicInfoW(hContact, NULL, &dwGroupID, NULL, NULL, NULL, NULL, &nick, &phones);
+ GetContactBasicInfoW(hContact, nullptr, &dwGroupID, nullptr, nullptr, nullptr, nullptr, &nick, &phones);
MraAddContact(hContact, (CONTACT_FLAG_VISIBLE | CONTACT_FLAG_UNICODE_NAME), dwGroupID, email, nick, &phones, &wszAuthMessage);
}
}
@@ -1339,7 +1339,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) // всех в offline и id в нестандарт
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS),
- -1, -2, 0, 0, ID_STATUS_OFFLINE, 0, 0, 0);
+ -1, -2, 0, 0, ID_STATUS_OFFLINE, nullptr, nullptr, nullptr);
// request user info from server
MraUpdateContactInfo(hContact);
}
@@ -1441,7 +1441,7 @@ bool CMraProto::CmdBlogStatus(BinBuffer &buf) buf >> dwFlags >> szEmail >> dwBlogStatusID >> dwTime >> wszText >> szString;
- if (MCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL)) {
+ if (MCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, nullptr)) {
if (dwFlags & MRIM_BLOG_STATUS_MUSIC)
mraSetStringW(hContact, DBSETTING_BLOGSTATUSMUSIC, wszText);
else {
@@ -1492,7 +1492,7 @@ bool CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader) case MRIM_CS_CONNECTION_PARAMS:// Изменение параметров соединения
buf >> m_dwPingPeriod;
m_dwNextPingSendTickTime = 0; // force send ping
- MraSendCMD(MRIM_CS_PING, NULL, 0);
+ MraSendCMD(MRIM_CS_PING, nullptr, 0);
break;
case MRIM_CS_LOGOUT:// Пользователь отключен из-за параллельного входа с его логином.
@@ -1514,7 +1514,7 @@ bool CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader) case MRIM_CS_SMS_ACK:
buf >> dwTemp;
- if (MraSendQueueFind(hSendQueueHandle, pmaHeader->seq, NULL, &hContact, &dwAckType, &pByte, &dwSize) == NO_ERROR) {
+ if (MraSendQueueFind(hSendQueueHandle, pmaHeader->seq, nullptr, &hContact, &dwAckType, &pByte, &dwSize) == NO_ERROR) {
/* pByte point to phone number ansi string. */
/* dwAckType = ICQACKTYPE_SMS */
CMStringA szEmail;
@@ -1662,12 +1662,12 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA & if (dwFlags & MESSAGE_SMS_DELIVERY_REPORT) {
szText.Format("<sms_delivery_receipt><message_id>%s-1-1955988055-%s</message_id><destination>%s</destination><delivered>No</delivered><submition_time>%s</submition_time><error_code>0</error_code><error><id>15</id><params><param>%s</param></params></error></sms_delivery_receipt>",
szEmail.c_str(), szPhone.c_str(), szPhone.c_str(), szTime.c_str(), lpszMessageUTF);
- ProtoBroadcastAck(NULL, ICQACKTYPE_SMS, ACKRESULT_FAILED, 0, (LPARAM)szText.GetString());
+ ProtoBroadcastAck(NULL, ICQACKTYPE_SMS, ACKRESULT_FAILED, nullptr, (LPARAM)szText.GetString());
}
else { // new sms
szText.Format("<sms_message><source>Mail.ru</source><destination_UIN>%s</destination_UIN><sender>%s</sender><senders_network>Mail.ru</senders_network><text>%s</text><time>%s</time></sms_message>",
szEmail.c_str(), szPhone.c_str(), lpszMessageUTF, szTime.c_str());
- ProtoBroadcastAck(NULL, ICQACKTYPE_SMS, ACKRESULT_SUCCESS, 0, (LPARAM)szText.GetString());
+ ProtoBroadcastAck(NULL, ICQACKTYPE_SMS, ACKRESULT_SUCCESS, nullptr, (LPARAM)szText.GetString());
}
}
else {
@@ -1748,7 +1748,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA & if (bAutoGrantAuth) { // auto grant auth
DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
- dbei.timestamp = _time32(NULL);
+ dbei.timestamp = _time32(nullptr);
dbei.flags = DBEF_READ | DBEF_UTF;
dbei.eventType = EVENTTYPE_AUTHREQUEST;
dbei.pBlob = (PBYTE)szBlob.c_str();
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index 67f0969a99..0090d056ca 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -61,7 +61,7 @@ LPCSTR lpcszStatusUri[] = "status_52",
"status_53",
"status_dating",
- NULL
+ nullptr
};
LPCWSTR lpcszXStatusNameDef[] =
@@ -116,7 +116,7 @@ LPCWSTR lpcszXStatusNameDef[] = LPGENW("Star"),
LPGENW("Music"),
LPGENW("Dating"),
- NULL
+ nullptr
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -124,7 +124,7 @@ LPCWSTR lpcszXStatusNameDef[] = void CMraProto::SetExtraIcons(MCONTACT hContact)
{
DWORD dwID, dwGroupID, dwContactSeverFlags;
- if (GetContactBasicInfoW(hContact, &dwID, &dwGroupID, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL))
+ if (GetContactBasicInfoW(hContact, &dwID, &dwGroupID, nullptr, &dwContactSeverFlags, nullptr, nullptr, nullptr, nullptr))
return;
DWORD dwIconID = -1;
@@ -155,8 +155,8 @@ void CMraProto::SetExtraIcons(MCONTACT hContact) }
ExtraIcon_SetIcon(hExtraXstatusIcon, hContact,
- (IsXStatusValid(dwXStatus) || dwXStatus == MRA_MIR_XSTATUS_UNKNOWN) ? hXStatusAdvancedStatusIcons[dwXStatus] : NULL);
- ExtraIcon_SetIcon(hExtraInfo, hContact, (dwIconID != -1) ? gdiExtraStatusIconsItems[dwIconID].hIcolib : NULL);
+ (IsXStatusValid(dwXStatus) || dwXStatus == MRA_MIR_XSTATUS_UNKNOWN) ? hXStatusAdvancedStatusIcons[dwXStatus] : nullptr);
+ ExtraIcon_SetIcon(hExtraInfo, hContact, (dwIconID != -1) ? gdiExtraStatusIconsItems[dwIconID].hIcolib : nullptr);
}
INT_PTR CMraProto::MraXStatusMenu(WPARAM, LPARAM, LPARAM param)
@@ -175,7 +175,7 @@ int CMraProto::MraContactDeleted(WPARAM hContact, LPARAM) if (IsContactMra(hContact)) {
DWORD dwID, dwGroupID;
- GetContactBasicInfoW(hContact, &dwID, &dwGroupID, NULL, NULL, NULL, NULL, NULL, NULL);
+ GetContactBasicInfoW(hContact, &dwID, &dwGroupID, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
MraSetContactStatus(hContact, ID_STATUS_OFFLINE);
if (!db_get_b(hContact, "CList", "NotOnList", 0) || dwID != -1) {
@@ -218,7 +218,7 @@ int CMraProto::MraDbSettingChanged(WPARAM hContact, LPARAM lParam) break;
}
if (wszNick.GetLength())
- MraModifyContact(hContact, 0, 0, 0, 0, &wszNick);
+ MraModifyContact(hContact, nullptr, nullptr, nullptr, nullptr, &wszNick);
}
}
// Group setting
@@ -254,7 +254,7 @@ int CMraProto::MraDbSettingChanged(WPARAM hContact, LPARAM lParam) CMStringA szEmail, szPhones;
CMStringW wszNick;
DWORD dwGroupID, dwContactFlag;
- GetContactBasicInfoW(hContact, NULL, &dwGroupID, &dwContactFlag, NULL, NULL, &szEmail, &wszNick, &szPhones);
+ GetContactBasicInfoW(hContact, nullptr, &dwGroupID, &dwContactFlag, nullptr, nullptr, &szEmail, &wszNick, &szPhones);
MraAddContact(hContact, dwContactFlag, dwGroupID, szEmail, wszNick, &szPhones, &wszAuthMessage);
}
}
@@ -266,7 +266,7 @@ int CMraProto::MraDbSettingChanged(WPARAM hContact, LPARAM lParam) else
dwContactFlag |= CONTACT_FLAG_SHADOW;
- MraModifyContact(hContact, 0, &dwContactFlag);
+ MraModifyContact(hContact, nullptr, &dwContactFlag);
}
}
// Ignore section
@@ -278,7 +278,7 @@ int CMraProto::MraDbSettingChanged(WPARAM hContact, LPARAM lParam) else
dwContactFlag |= CONTACT_FLAG_IGNORE;
- MraModifyContact(hContact, 0, &dwContactFlag);
+ MraModifyContact(hContact, nullptr, &dwContactFlag);
}
}
// User info section
@@ -303,7 +303,7 @@ INT_PTR CMraProto::MraSetListeningTo(WPARAM, LPARAM lParam) {
LISTENINGTOINFO *pliInfo = (LISTENINGTOINFO*)lParam;
- if (pliInfo == NULL || pliInfo->cbSize != sizeof(LISTENINGTOINFO)) {
+ if (pliInfo == nullptr || pliInfo->cbSize != sizeof(LISTENINGTOINFO)) {
MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, L"", 0);
delSetting(DBSETTING_BLOGSTATUSMUSIC);
}
@@ -461,7 +461,7 @@ INT_PTR CMraProto::MraGetXStatusEx(WPARAM hContact, LPARAM lParam) // fill status name member
if (pData->flags & CSSF_MASK_NAME) {
if (pData->flags & CSSF_DEFAULT_NAME) {
- DWORD dwXStatus = (pData->wParam == NULL) ? m_iXStatus : *pData->wParam;
+ DWORD dwXStatus = (pData->wParam == nullptr) ? m_iXStatus : *pData->wParam;
if (!IsXStatusValid(dwXStatus))
return 1;
@@ -472,15 +472,15 @@ INT_PTR CMraProto::MraGetXStatusEx(WPARAM hContact, LPARAM lParam) if (dwStatusTitleSize > STATUS_TITLE_MAX)
dwStatusTitleSize = STATUS_TITLE_MAX;
- WideCharToMultiByte(MRA_CODE_PAGE, 0, lpcszXStatusNameDef[dwXStatus], (DWORD)dwStatusTitleSize, pData->pszName, MAX_PATH, NULL, NULL);
+ WideCharToMultiByte(MRA_CODE_PAGE, 0, lpcszXStatusNameDef[dwXStatus], (DWORD)dwStatusTitleSize, pData->pszName, MAX_PATH, nullptr, nullptr);
(*((CHAR*)(pData->pszName + dwStatusTitleSize))) = 0;
}
}
else {
if (pData->flags & CSSF_UNICODE)
- mraGetStaticStringW(hContact, DBSETTING_XSTATUSNAME, pData->pwszName, (STATUS_TITLE_MAX + 1), NULL);
+ mraGetStaticStringW(hContact, DBSETTING_XSTATUSNAME, pData->pwszName, (STATUS_TITLE_MAX + 1), nullptr);
else
- mraGetStaticStringA(hContact, DBSETTING_XSTATUSNAME, pData->pszName, (STATUS_TITLE_MAX + 1), NULL);
+ mraGetStaticStringA(hContact, DBSETTING_XSTATUSNAME, pData->pszName, (STATUS_TITLE_MAX + 1), nullptr);
}
}
@@ -489,9 +489,9 @@ INT_PTR CMraProto::MraGetXStatusEx(WPARAM hContact, LPARAM lParam) char szSetting[100];
mir_snprintf(szSetting, "XStatus%dMsg", m_iXStatus);
if (pData->flags & CSSF_UNICODE)
- mraGetStaticStringW(hContact, szSetting, pData->pwszMessage, (STATUS_DESC_MAX + 1), NULL);
+ mraGetStaticStringW(hContact, szSetting, pData->pwszMessage, (STATUS_DESC_MAX + 1), nullptr);
else
- mraGetStaticStringA(hContact, szSetting, pData->pszMessage, (STATUS_DESC_MAX + 1), NULL);
+ mraGetStaticStringA(hContact, szSetting, pData->pszMessage, (STATUS_DESC_MAX + 1), nullptr);
}
if ((pData->flags & CSSF_DISABLE_UI) && pData->wParam)
@@ -502,8 +502,8 @@ INT_PTR CMraProto::MraGetXStatusEx(WPARAM hContact, LPARAM lParam) //**deb можно оптимизировать, данный параметр возможно уже был вычислен при получении самих текстов
if (pData->flags & CSSF_STR_SIZES) {
- if (pData->wParam) mraGetStaticStringW(hContact, DBSETTING_XSTATUSNAME, NULL, 0, (size_t*)pData->wParam);
- if (pData->lParam) mraGetStaticStringW(hContact, DBSETTING_XSTATUSMSG, NULL, 0, (size_t*)pData->lParam);
+ if (pData->wParam) mraGetStaticStringW(hContact, DBSETTING_XSTATUSNAME, nullptr, 0, (size_t*)pData->wParam);
+ if (pData->lParam) mraGetStaticStringW(hContact, DBSETTING_XSTATUSMSG, nullptr, 0, (size_t*)pData->lParam);
}
return 0;
}
@@ -571,7 +571,7 @@ INT_PTR CMraProto::MraSendNudge(WPARAM hContact, LPARAM) CMStringA szEmail;
if (mraGetStringA(hContact, "e-mail", szEmail))
- if (MraMessage(FALSE, hContact, 0, (MESSAGE_FLAG_RTF | MESSAGE_FLAG_ALARM), szEmail, lpwszAlarmMessage, NULL, 0))
+ if (MraMessage(FALSE, hContact, 0, (MESSAGE_FLAG_RTF | MESSAGE_FLAG_ALARM), szEmail, lpwszAlarmMessage, nullptr, 0))
return 0;
}
return 1;
@@ -615,7 +615,7 @@ INT_PTR CMraProto::MraGetAvatarInfo(WPARAM wParam, LPARAM lParam) {
if (lParam) {
PROTO_AVATAR_INFORMATION *pai = (PROTO_AVATAR_INFORMATION*)lParam;
- return (INT_PTR)MraAvatarsQueueGetAvatar(hAvatarsQueueHandle, (DWORD)wParam, pai->hContact, NULL, (DWORD*)&pai->format, pai->filename);
+ return (INT_PTR)MraAvatarsQueueGetAvatar(hAvatarsQueueHandle, (DWORD)wParam, pai->hContact, nullptr, (DWORD*)&pai->format, pai->filename);
}
return GAIR_NOAVATAR;
}
@@ -638,10 +638,10 @@ int CMraProto::OnGroupChanged(WPARAM hContact, LPARAM lParam) {
if (hContact == NULL) {
CLISTGROUPCHANGE *cgc = (CLISTGROUPCHANGE*)lParam;
- if (cgc->pszOldName == NULL)
+ if (cgc->pszOldName == nullptr)
return 0;
- MraGroupItem *pGrp = NULL;
+ MraGroupItem *pGrp = nullptr;
for (int i = 0; i < m_groups.getCount(); i++) {
MraGroupItem &p = m_groups[i];
if (!mir_wstrcmp(p.m_name, cgc->pszOldName)) {
@@ -649,18 +649,18 @@ int CMraProto::OnGroupChanged(WPARAM hContact, LPARAM lParam) break;
}
}
- if (pGrp == NULL) // no MRA contacts in it
+ if (pGrp == nullptr) // no MRA contacts in it
return 0;
DWORD dwFlags = CONTACT_FLAG_GROUP;
CMStringW wszGroup;
- if (cgc->pszNewName != NULL) // renaming group
+ if (cgc->pszNewName != nullptr) // renaming group
wszGroup = cgc->pszNewName;
else { // removing group
dwFlags |= CONTACT_FLAG_REMOVED;
wszGroup = cgc->pszOldName;
}
- MraModifyContact(NULL, &pGrp->m_id, &dwFlags, 0, 0, &wszGroup);
+ MraModifyContact(NULL, &pGrp->m_id, &dwFlags, nullptr, nullptr, &wszGroup);
}
return 0;
}
|