From 3e4284bb32b1515cdcac6741d2c2e94f64f08063 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Sat, 11 Jun 2016 23:45:23 +0000 Subject: MRA: change avatars load threads count default value from 4 to 1 add threads names git-svn-id: http://svn.miranda-ng.org/main/trunk@16948 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/src/MraAvatars.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'protocols/MRA/src/MraAvatars.cpp') diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index 62b329e576..3813da9741 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -159,6 +159,8 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) nls.cbSize = sizeof(nls); + Thread_SetName("MRA: AvatarsThreadProc"); + HANDLE hThreadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); { mir_cslock lck(pmraaqAvatarsQueue->cs); @@ -432,16 +434,18 @@ DWORD MraAvatarsHttpTransaction(HANDLE hConnection, DWORD dwRequestType, LPCSTR bool CMraProto::MraAvatarsGetContactTime(MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime) { - if (lpszValueName && pstTime) { - INTERNET_TIME itAvatarLastModifiedTimeLocal; - CMStringA szBuff; - if (mraGetStringA(hContact, lpszValueName, szBuff)) - if (InternetTimeGetTime(szBuff, itAvatarLastModifiedTimeLocal) == NO_ERROR) { - memcpy(pstTime, &itAvatarLastModifiedTimeLocal.stTime, sizeof(SYSTEMTIME)); - return true; - } - } - return false; + INTERNET_TIME itAvatarLastModifiedTimeLocal; + CMStringA szBuff; + + if (NULL == lpszValueName || + NULL == pstTime) + return false; + if (false == mraGetStringA(hContact, lpszValueName, szBuff)) + return false; + if (InternetTimeGetTime(szBuff, itAvatarLastModifiedTimeLocal) != NO_ERROR) + return false; + memcpy(pstTime, &itAvatarLastModifiedTimeLocal.stTime, sizeof(SYSTEMTIME)); + return true; } void CMraProto::MraAvatarsSetContactTime(MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime) -- cgit v1.2.3