From 5161fd3fe53b85f579cfece81e25b562f1fa56ae Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 16 Sep 2012 11:50:15 +0000 Subject: - event code standardization for protocols - fix for EVENTTYPE_AUTHREQUEST processing - protocols' custom CallService core removed git-svn-id: http://svn.miranda-ng.org/main/trunk@1576 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Msg_Export/src/utils.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'plugins/Msg_Export/src') diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 0c5186a021..68bf7cd7a5 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -1271,11 +1271,6 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei ) LPGENT("e-mail :"), LPGENT("Reason :")}; - /*// test code - dbei.pBlob = (BYTE*)("\xED\xA8\x29\x09nick\0first\0last\0email"); - dbei.cbBlob = 26; - */ - if( dbei.cbBlob < 8 || dbei.cbBlob > 5000 ) { int n = _sntprintf( szTemp , sizeof( szTemp ) , LPGENT("Invalid Database event received. Type %d, size %d"),dbei.eventType, dbei.cbBlob ); @@ -1287,16 +1282,19 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei ) bool bWriteOk = false; int nStringCount; - const _TCHAR * pszTitle; + const _TCHAR *pszTitle; + char *pszCurBlobPos; if( dbei.eventType == EVENTTYPE_AUTHREQUEST ) { // request - //blob is: uin(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ) + //blob is: uin(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ) nStringCount = 5; + pszCurBlobPos = (char *)dbei.pBlob + sizeof( DWORD )*2; pszTitle = LPGENT("The following user made an authorization request:"); } else { // Added //blob is: uin(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ) + pszCurBlobPos = (char *)dbei.pBlob + sizeof(DWORD); nStringCount = 4; pszTitle = LPGENT("The following user added you to their contact list:"); } @@ -1309,8 +1307,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei ) int n = _sntprintf( szTemp , sizeof( szTemp ) ,_T("%d"), uin ); if( bWriteTextToFile( hFile , szTemp , bWriteUTF8Format , n ) ) { - char * pszCurBlobPos = (char *) (dbei.pBlob + sizeof( DWORD )); - char * pszEnd = (char *) (dbei.pBlob + dbei.cbSize); + char *pszEnd = (char *) (dbei.pBlob + dbei.cbSize); for( int n = 0 ; n < nStringCount && pszCurBlobPos < pszEnd ; n++ ) { if( *pszCurBlobPos ) -- cgit v1.2.3