From 30ab6ceb71842f003f649b3d62b89af010cf40d1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Jun 2012 17:00:14 +0000 Subject: - direct call of MS_SKIN_ADDNEWSOUND replaced with Skin_AddSound() call; - obsolete structure SKINSOUNDDESC removed - dynamically translated hot keys; - checked correct LPGEN'ing of the sounds creation; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@500 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/MString.h | 150 +++++++++++++------------- protocols/JabberG/jabber.cpp | 2 +- protocols/JabberG/jabber_adhoc.cpp | 30 +++--- protocols/JabberG/jabber_agent.cpp | 14 +-- protocols/JabberG/jabber_bookmarks.cpp | 6 +- protocols/JabberG/jabber_caps.cpp | 52 ++++----- protocols/JabberG/jabber_captcha.cpp | 4 +- protocols/JabberG/jabber_chat.cpp | 20 ++-- protocols/JabberG/jabber_console.cpp | 6 +- protocols/JabberG/jabber_disco.cpp | 70 ++++++------ protocols/JabberG/jabber_disco.h | 10 +- protocols/JabberG/jabber_events.cpp | 2 +- protocols/JabberG/jabber_form.cpp | 32 +++--- protocols/JabberG/jabber_ft.cpp | 4 +- protocols/JabberG/jabber_groupchat.cpp | 12 +-- protocols/JabberG/jabber_icolib.cpp | 6 +- protocols/JabberG/jabber_iq.cpp | 4 +- protocols/JabberG/jabber_iq_handlers.cpp | 40 +++---- protocols/JabberG/jabber_iqid.cpp | 98 ++++++++--------- protocols/JabberG/jabber_list.cpp | 6 +- protocols/JabberG/jabber_menu.cpp | 12 +-- protocols/JabberG/jabber_message_handlers.cpp | 12 +-- protocols/JabberG/jabber_message_manager.cpp | 6 +- protocols/JabberG/jabber_misc.cpp | 8 +- protocols/JabberG/jabber_notes.cpp | 2 +- protocols/JabberG/jabber_opt.cpp | 16 +-- protocols/JabberG/jabber_privacy.cpp | 94 ++++++++-------- protocols/JabberG/jabber_privacy.h | 12 +-- protocols/JabberG/jabber_proto.cpp | 16 +-- protocols/JabberG/jabber_rc.cpp | 74 ++++++------- protocols/JabberG/jabber_rc.h | 10 +- protocols/JabberG/jabber_search.cpp | 2 +- protocols/JabberG/jabber_svc.cpp | 6 +- protocols/JabberG/jabber_thread.cpp | 88 +++++++-------- protocols/JabberG/jabber_userinfo.cpp | 28 ++--- protocols/JabberG/jabber_util.cpp | 24 ++--- protocols/JabberG/jabber_vcard.cpp | 6 +- protocols/JabberG/jabber_xml.cpp | 8 +- protocols/JabberG/jabber_xstatus.cpp | 16 +-- protocols/JabberG/ui_utils.cpp | 2 +- 40 files changed, 505 insertions(+), 505 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/MString.h b/protocols/JabberG/MString.h index 6f90b7741b..7cc16ff4a3 100644 --- a/protocols/JabberG/MString.h +++ b/protocols/JabberG/MString.h @@ -115,7 +115,7 @@ public: CMSimpleStringT(PCXSTR pszSrc) { int nLength = StringLength( pszSrc ); - CMStringData* pData = Allocate( nLength, sizeof( XCHAR ) ); + CMStringData* pData = Allocate( nLength, sizeof( XCHAR )); if (pData != NULL) { Attach( pData ); @@ -125,7 +125,7 @@ public: } CMSimpleStringT(const XCHAR* pchSrc, int nLength) { - CMStringData* pData = Allocate( nLength, sizeof( XCHAR ) ); + CMStringData* pData = Allocate( nLength, sizeof( XCHAR )); if ( pData != NULL ) { Attach( pData ); @@ -150,8 +150,8 @@ public: CMStringData* pOldData = GetData(); if ( pSrcData != pOldData) { - if ( pOldData->IsLocked() ) - SetString( strSrc.GetString(), strSrc.GetLength() ); + if ( pOldData->IsLocked()) + SetString( strSrc.GetString(), strSrc.GetLength()); else { CMStringData* pNewData = CloneData( pSrcData ); @@ -218,7 +218,7 @@ public: void Append( PCXSTR pszSrc ) { - Append( pszSrc, StringLength( pszSrc ) ); + Append( pszSrc, StringLength( pszSrc )); } void Append( PCXSTR pszSrc, int nLength ) { @@ -257,7 +257,7 @@ public: } void Append( const CMSimpleStringT& strSrc ) { - Append( strSrc.GetString(), strSrc.GetLength() ); + Append( strSrc.GetString(), strSrc.GetLength()); } void Empty() { @@ -265,7 +265,7 @@ public: if ( pOldData->nDataLength == 0 ) return; - if ( pOldData->IsLocked() ) + if ( pOldData->IsLocked()) { // Don't reallocate a locked buffer that's shrinking SetLength( 0 ); @@ -284,15 +284,15 @@ public: if ( pOldData->nAllocLength == nLength ) return; - if ( !pOldData->IsLocked() ) // Don't reallocate a locked buffer that's shrinking + if ( !pOldData->IsLocked()) // Don't reallocate a locked buffer that's shrinking { - CMStringData* pNewData = Allocate( nLength, sizeof( XCHAR ) ); + CMStringData* pNewData = Allocate( nLength, sizeof( XCHAR )); if ( pNewData == NULL ) { SetLength( nLength ); return; } - CopyChars( PXSTR( pNewData->data() ), nLength, PCXSTR( pOldData->data() ), nLength ); + CopyChars( PXSTR( pNewData->data()), nLength, PCXSTR( pOldData->data()), nLength ); pOldData->Release(); Attach( pNewData ); @@ -311,7 +311,7 @@ public: PXSTR GetBuffer() { CMStringData* pData = GetData(); - if ( pData->IsShared() ) + if ( pData->IsShared()) Fork( pData->nDataLength ); return m_pszData; @@ -343,7 +343,7 @@ public: PXSTR LockBuffer() { CMStringData* pData = GetData(); - if ( pData->IsShared() ) + if ( pData->IsShared()) { Fork( pData->nDataLength ); pData = GetData(); // Do it again, because the fork might have changed it @@ -389,7 +389,7 @@ public: } void SetString( PCXSTR pszSrc ) { - SetString( pszSrc, StringLength( pszSrc ) ); + SetString( pszSrc, StringLength( pszSrc )); } void SetString( PCXSTR pszSrc, int nLength ) { @@ -421,7 +421,7 @@ public: { CMSimpleStringT s; - Concatenate( s, str1, str1.GetLength(), str2, str2.GetLength() ); + Concatenate( s, str1, str1.GetLength(), str2, str2.GetLength()); return s; } @@ -430,7 +430,7 @@ public: { CMSimpleStringT s; - Concatenate( s, str1, str1.GetLength(), psz2, StringLength( psz2 ) ); + Concatenate( s, str1, str1.GetLength(), psz2, StringLength( psz2 )); return s; } @@ -439,7 +439,7 @@ public: { CMSimpleStringT s; - Concatenate( s, psz1, StringLength( psz1 ), str2, str2.GetLength() ); + Concatenate( s, psz1, StringLength( psz1 ), str2, str2.GetLength()); return s; } @@ -527,7 +527,7 @@ private: if (pNewData != NULL) { int nCharsToCopy = ((nOldLength < nLength) ? nOldLength : nLength)+1; // Copy '\0' - CopyChars( PXSTR( pNewData->data() ), nCharsToCopy, PCXSTR( pOldData->data() ), nCharsToCopy ); + CopyChars( PXSTR( pNewData->data()), nCharsToCopy, PCXSTR( pOldData->data()), nCharsToCopy ); pNewData->nDataLength = nOldLength; pOldData->Release(); Attach(pNewData); @@ -578,7 +578,7 @@ private: if ( pOldData->nAllocLength >= nLength || nLength <= 0) return; - CMStringData* pNewData = Realloc( pOldData, nLength, sizeof( XCHAR ) ); + CMStringData* pNewData = Realloc( pOldData, nLength, sizeof( XCHAR )); if ( pNewData != NULL ) Attach( pNewData ); } @@ -676,19 +676,19 @@ public: static int __stdcall StringSpanIncluding( LPCSTR pszBlock, LPCSTR pszSet ) { - return (int)_mbsspn( reinterpret_cast< const unsigned char* >( pszBlock ), reinterpret_cast< const unsigned char* >( pszSet ) ); + return (int)_mbsspn( reinterpret_cast< const unsigned char* >( pszBlock ), reinterpret_cast< const unsigned char* >( pszSet )); } static int __stdcall StringSpanExcluding( LPCSTR pszBlock, LPCSTR pszSet ) { - return (int)_mbscspn( reinterpret_cast< const unsigned char* >( pszBlock ), reinterpret_cast< const unsigned char* >( pszSet ) ); + return (int)_mbscspn( reinterpret_cast< const unsigned char* >( pszBlock ), reinterpret_cast< const unsigned char* >( pszSet )); } static LPSTR __stdcall StringUppercase( LPSTR psz ) { #pragma warning (push) #pragma warning(disable : 4996) - return reinterpret_cast< LPSTR >( _mbsupr( reinterpret_cast< unsigned char* >( psz ) ) ); + return reinterpret_cast< LPSTR >( _mbsupr( reinterpret_cast< unsigned char* >( psz )) ); #pragma warning (pop) } @@ -696,7 +696,7 @@ public: { #pragma warning (push) #pragma warning(disable : 4996) - return reinterpret_cast< LPSTR >( _mbslwr( reinterpret_cast< unsigned char* >( psz ) ) ); + return reinterpret_cast< LPSTR >( _mbslwr( reinterpret_cast< unsigned char* >( psz )) ); #pragma warning (pop) } @@ -722,7 +722,7 @@ public: static LPSTR __stdcall StringReverse( LPSTR psz ) { - return reinterpret_cast< LPSTR >( _mbsrev( reinterpret_cast< unsigned char* >( psz ) ) ); + return reinterpret_cast< LPSTR >( _mbsrev( reinterpret_cast< unsigned char* >( psz )) ); } static int __stdcall GetFormattedLength( LPCSTR pszFormat, va_list args ); @@ -741,7 +741,7 @@ public: static int __stdcall GetBaseTypeLength( LPCSTR pszSrc ) { // Returns required buffer length in XCHARs - return int( strlen( pszSrc ) ); + return int( strlen( pszSrc )); } static int __stdcall GetBaseTypeLength( LPCSTR pszSrc, int nLength ) @@ -768,7 +768,7 @@ public: if (nSrcLength == -1) { nSrcLength=1 + GetBaseTypeLength(pszSrc); } // nLen is in XCHARs memcpy_s( pszDest, nDestLength*sizeof( char ), - pszSrc, nSrcLength*sizeof( char ) ); + pszSrc, nSrcLength*sizeof( char )); } static void __stdcall ConvertToBaseType( LPSTR pszDest, int nDestLength, LPCWSTR pszSrc, int nSrcLength = -1) @@ -835,13 +835,13 @@ public: static int __stdcall SafeStringLen( LPCSTR psz ) { // returns length in bytes - return (psz != NULL) ? int( strlen( psz ) ) : 0; + return (psz != NULL) ? int( strlen( psz )) : 0; } static int __stdcall SafeStringLen( LPCWSTR psz ) { // returns length in wchar_ts - return (psz != NULL) ? int( wcslen( psz ) ) : 0; + return (psz != NULL) ? int( wcslen( psz )) : 0; } static int __stdcall GetCharLen( const wchar_t* pch ) @@ -853,7 +853,7 @@ public: static int __stdcall GetCharLen( const char* pch ) { // returns char length - return int( _mbclen( reinterpret_cast< const unsigned char* >( pch ) ) ); + return int( _mbclen( reinterpret_cast< const unsigned char* >( pch )) ); } static DWORD __stdcall GetEnvironmentVariable( LPCSTR pszVar, LPSTR pszBuffer, DWORD dwSize ) @@ -879,12 +879,12 @@ public: static int __stdcall IsDigit( wchar_t ch ) { - return iswdigit( static_cast(ch) ); + return iswdigit( static_cast(ch)); } static int __stdcall IsSpace( wchar_t ch ) { - return iswspace( static_cast(ch) ); + return iswspace( static_cast(ch)); } static int __stdcall StringCompare( LPCWSTR pszA, LPCWSTR pszB ) @@ -1068,7 +1068,7 @@ public: static int __stdcall GetCharLen( const char* pch ) { // returns char length - return (int)( _mbclen( reinterpret_cast< const unsigned char* >( pch ) ) ); + return (int)( _mbclen( reinterpret_cast< const unsigned char* >( pch )) ); } static DWORD __stdcall GetEnvironmentVariable( LPCWSTR pszVar, LPWSTR pszBuffer, DWORD dwSize ) @@ -1362,7 +1362,7 @@ public: int nXCHARsToCopy = nLength-(iIndex+nCount)+1; PXSTR pszBuffer = this->GetBuffer(); #if _MSC_VER >= 1400 - memmove_s( pszBuffer+iIndex, nXCHARsToCopy*sizeof( XCHAR ), pszBuffer+iIndex+nCount, nXCHARsToCopy*sizeof( XCHAR ) ); + memmove_s( pszBuffer+iIndex, nXCHARsToCopy*sizeof( XCHAR ), pszBuffer+iIndex+nCount, nXCHARsToCopy*sizeof( XCHAR )); #else memmove( pszBuffer+iIndex, pszBuffer+iIndex+nCount, nXCHARsToCopy*sizeof( XCHAR )); #endif @@ -1378,7 +1378,7 @@ public: if ( iIndex < 0 ) iIndex = 0; - if ( iIndex > this->GetLength() ) + if ( iIndex > this->GetLength()) iIndex = this->GetLength(); int nNewLength = this->GetLength()+1; @@ -1387,9 +1387,9 @@ public: // move existing bytes down #if _MSC_VER >= 1400 - memmove_s( pszBuffer+iIndex+1, (nNewLength-iIndex)*sizeof( XCHAR ), pszBuffer+iIndex, (nNewLength-iIndex)*sizeof( XCHAR ) ); + memmove_s( pszBuffer+iIndex+1, (nNewLength-iIndex)*sizeof( XCHAR ), pszBuffer+iIndex, (nNewLength-iIndex)*sizeof( XCHAR )); #else - memmove( pszBuffer+iIndex+1, pszBuffer+iIndex, (nNewLength-iIndex)*sizeof( XCHAR ) ); + memmove( pszBuffer+iIndex+1, pszBuffer+iIndex, (nNewLength-iIndex)*sizeof( XCHAR )); #endif pszBuffer[iIndex] = ch; @@ -1403,7 +1403,7 @@ public: if ( iIndex < 0 ) iIndex = 0; - if ( iIndex > this->GetLength() ) + if ( iIndex > this->GetLength()) { iIndex = this->GetLength(); } @@ -1418,10 +1418,10 @@ public: PXSTR pszBuffer = this->GetBuffer( nNewLength ); // move existing bytes down #if _MSC_VER >= 1400 - memmove_s( pszBuffer+iIndex+nInsertLength, (nNewLength-iIndex-nInsertLength+1)*sizeof( XCHAR ), pszBuffer+iIndex, (nNewLength-iIndex-nInsertLength+1)*sizeof( XCHAR ) ); + memmove_s( pszBuffer+iIndex+nInsertLength, (nNewLength-iIndex-nInsertLength+1)*sizeof( XCHAR ), pszBuffer+iIndex, (nNewLength-iIndex-nInsertLength+1)*sizeof( XCHAR )); memcpy_s( pszBuffer+iIndex, nInsertLength*sizeof( XCHAR ), psz, nInsertLength*sizeof( XCHAR )); #else - memmove( pszBuffer+iIndex+nInsertLength, pszBuffer+iIndex, (nNewLength-iIndex-nInsertLength+1)*sizeof( XCHAR ) ); + memmove( pszBuffer+iIndex+nInsertLength, pszBuffer+iIndex, (nNewLength-iIndex-nInsertLength+1)*sizeof( XCHAR )); memcpy( pszBuffer+iIndex, psz, nInsertLength*sizeof( XCHAR )); #endif this->ReleaseBufferSetLength( nNewLength ); @@ -1440,7 +1440,7 @@ public: { // otherwise modify each character that matches in the string bool bCopied = false; - PXSTR pszBuffer = const_cast< PXSTR >( this->GetString() ); // We don't actually write to pszBuffer until we've called GetBuffer(). + PXSTR pszBuffer = const_cast< PXSTR >( this->GetString()); // We don't actually write to pszBuffer until we've called GetBuffer(). int nLength = this->GetLength(); int iChar = 0; @@ -1488,7 +1488,7 @@ public: while( pszStart < pszEnd ) { PCXSTR pszTarget; - while( (pszTarget = StringTraits::StringFindString( pszStart, pszOld ) ) != NULL) + while( (pszTarget = StringTraits::StringFindString( pszStart, pszOld )) != NULL) { nCount++; pszStart = pszTarget+nSourceLen; @@ -1505,7 +1505,7 @@ public: int nOldLength = this->GetLength(); int nNewLength = nOldLength+(nReplacementLen-nSourceLen)*nCount; - PXSTR pszBuffer = this->GetBuffer( __max( nNewLength, nOldLength ) ); + PXSTR pszBuffer = this->GetBuffer( __max( nNewLength, nOldLength )); PXSTR pszStart = pszBuffer; PXSTR pszEnd = pszStart+nOldLength; @@ -1514,13 +1514,13 @@ public: while( pszStart < pszEnd ) { PXSTR pszTarget; - while( (pszTarget = StringTraits::StringFindString( pszStart, pszOld ) ) != NULL ) + while( (pszTarget = StringTraits::StringFindString( pszStart, pszOld )) != NULL ) { int nBalance = nOldLength-int(pszTarget-pszBuffer+nSourceLen); memmove_s( pszTarget+nReplacementLen, nBalance*sizeof( XCHAR ), - pszTarget+nSourceLen, nBalance*sizeof( XCHAR ) ); + pszTarget+nSourceLen, nBalance*sizeof( XCHAR )); memcpy_s( pszTarget, nReplacementLen*sizeof( XCHAR ), - pszNew, nReplacementLen*sizeof( XCHAR ) ); + pszNew, nReplacementLen*sizeof( XCHAR )); pszStart = pszTarget+nReplacementLen; pszTarget[nReplacementLen+nBalance] = 0; nOldLength += (nReplacementLen-nSourceLen); @@ -1571,7 +1571,7 @@ public: CMStringT Tokenize( PCXSTR pszTokens, int& iStart ) const { - if ( (pszTokens == NULL) || (*pszTokens == (XCHAR)0) ) + if ( (pszTokens == NULL) || (*pszTokens == (XCHAR)0)) { if (iStart < this->GetLength()) return CMStringT( this->GetString()+iStart ); @@ -1707,7 +1707,7 @@ public: while( *psz != 0 ) { - if ( StringTraits::IsSpace( *psz ) ) + if ( StringTraits::IsSpace( *psz )) { if ( pszLast == NULL ) pszLast = psz; @@ -1722,7 +1722,7 @@ public: if ( pszLast != NULL ) { // truncate at trailing space start - int iLast = int( pszLast-this->GetString() ); + int iLast = int( pszLast-this->GetString()); this->Truncate( iLast ); } @@ -1737,20 +1737,20 @@ public: PCXSTR psz = this->GetString(); - while( StringTraits::IsSpace( *psz ) ) + while( StringTraits::IsSpace( *psz )) { psz = StringTraits::CharNext( psz ); } - if ( psz != this->GetString() ) + if ( psz != this->GetString()) { // fix up data and length - int iFirst = int( psz-this->GetString() ); - PXSTR pszBuffer = this->GetBuffer( this->GetLength() ); + int iFirst = int( psz-this->GetString()); + PXSTR pszBuffer = this->GetBuffer( this->GetLength()); psz = pszBuffer+iFirst; int nDataLength = this->GetLength()-iFirst; memmove_s( pszBuffer, (this->GetLength()+1)*sizeof( XCHAR ), - psz, (nDataLength+1)*sizeof( XCHAR ) ); + psz, (nDataLength+1)*sizeof( XCHAR )); this->ReleaseBufferSetLength( nDataLength ); } @@ -1805,7 +1805,7 @@ public: if ( pszLast != NULL ) { // truncate at left-most matching character - int iLast = int( pszLast-this->GetString() ); + int iLast = int( pszLast-this->GetString()); this->Truncate( iLast ); } @@ -1816,7 +1816,7 @@ public: CMStringT& TrimRight( PCXSTR pszTargets ) { // if we're not trimming anything, we're not doing any work - if ( (pszTargets == NULL) || (*pszTargets == 0) ) + if ( (pszTargets == NULL) || (*pszTargets == 0)) { return *this; } @@ -1846,7 +1846,7 @@ public: if ( pszLast != NULL ) { // truncate at left-most matching character - int iLast = int( pszLast-this->GetString() ); + int iLast = int( pszLast-this->GetString()); this->Truncate( iLast ); } @@ -1864,15 +1864,15 @@ public: psz = StringTraits::CharNext( psz ); } - if ( psz != this->GetString() ) + if ( psz != this->GetString()) { // fix up data and length - int iFirst = int( psz-this->GetString() ); - PXSTR pszBuffer = this->GetBuffer( this->GetLength() ); + int iFirst = int( psz-this->GetString()); + PXSTR pszBuffer = this->GetBuffer( this->GetLength()); psz = pszBuffer+iFirst; int nDataLength = this->GetLength()-iFirst; memmove_s( pszBuffer, (this->GetLength()+1)*sizeof( XCHAR ), - psz, (nDataLength+1)*sizeof( XCHAR ) ); + psz, (nDataLength+1)*sizeof( XCHAR )); this->ReleaseBufferSetLength( nDataLength ); } @@ -1883,26 +1883,26 @@ public: CMStringT& TrimLeft( PCXSTR pszTargets ) { // if we're not trimming anything, we're not doing any work - if ( (pszTargets == NULL) || (*pszTargets == 0) ) + if ( (pszTargets == NULL) || (*pszTargets == 0)) { return *this; } PCXSTR psz = this->GetString(); - while( (*psz != 0) && (StringTraits::StringFindChar( pszTargets, *psz ) != NULL) ) + while( (*psz != 0) && (StringTraits::StringFindChar( pszTargets, *psz ) != NULL)) { psz = StringTraits::CharNext( psz ); } - if ( psz != this->GetString() ) + if ( psz != this->GetString()) { // fix up data and length - int iFirst = int( psz-this->GetString() ); - PXSTR pszBuffer = this->GetBuffer( this->GetLength() ); + int iFirst = int( psz-this->GetString()); + PXSTR pszBuffer = this->GetBuffer( this->GetLength()); psz = pszBuffer+iFirst; int nDataLength = this->GetLength()-iFirst; memmove_s( pszBuffer, (this->GetLength()+1)*sizeof( XCHAR ), - psz, (nDataLength+1)*sizeof( XCHAR ) ); + psz, (nDataLength+1)*sizeof( XCHAR )); this->ReleaseBufferSetLength( nDataLength ); } @@ -1946,14 +1946,14 @@ public: if (nCount < 0) nCount = 0; - if ( (iFirst + nCount) > this->GetLength() ) + if ( (iFirst + nCount) > this->GetLength()) nCount = this->GetLength()-iFirst; - if ( iFirst > this->GetLength() ) + if ( iFirst > this->GetLength()) nCount = 0; // optimize case of returning entire string - if ( (iFirst == 0) && ((iFirst+nCount) == this->GetLength()) ) + if ( (iFirst == 0) && ((iFirst+nCount) == this->GetLength())) return *this; return CMStringT( this->GetString()+iFirst, nCount ); @@ -2030,13 +2030,13 @@ public: // Allocate a BSTR containing a copy of the string BSTR AllocSysString() const { - BSTR bstrResult = StringTraits::AllocSysString( this->GetString(), this->GetLength() ); + BSTR bstrResult = StringTraits::AllocSysString( this->GetString(), this->GetLength()); return bstrResult; } BSTR SetSysString( BSTR* pbstr ) const { - StringTraits::ReAllocSysString( this->GetString(), pbstr, this->GetLength() ); + StringTraits::ReAllocSysString( this->GetString(), pbstr, this->GetLength()); return *pbstr; } @@ -2075,7 +2075,7 @@ public: { CMStringT strResult; - Concatenate( strResult, str1, str1.GetLength(), str2, str2.GetLength() ); + Concatenate( strResult, str1, str1.GetLength(), str2, str2.GetLength()); return strResult; } @@ -2084,7 +2084,7 @@ public: { CMStringT strResult; - Concatenate( strResult, str1, str1.GetLength(), psz2, StringLength( psz2 ) ); + Concatenate( strResult, str1, str1.GetLength(), psz2, StringLength( psz2 )); return strResult; } @@ -2093,7 +2093,7 @@ public: { CMStringT strResult; - Concatenate( strResult, psz1, StringLength( psz1 ), str2, str2.GetLength() ); + Concatenate( strResult, psz1, StringLength( psz1 ), str2, str2.GetLength()); return strResult; } @@ -2123,7 +2123,7 @@ public: CMStringT strResult; XCHAR chTemp = XCHAR( ch1 ); - Concatenate( strResult, &chTemp, 1, str2, str2.GetLength() ); + Concatenate( strResult, &chTemp, 1, str2, str2.GetLength()); return strResult; } @@ -2133,7 +2133,7 @@ public: CMStringT strResult; XCHAR chTemp = XCHAR( ch1 ); - Concatenate( strResult, &chTemp, 1, str2, str2.GetLength() ); + Concatenate( strResult, &chTemp, 1, str2, str2.GetLength()); return strResult; } diff --git a/protocols/JabberG/jabber.cpp b/protocols/JabberG/jabber.cpp index 983ad4daea..e750288a01 100644 --- a/protocols/JabberG/jabber.cpp +++ b/protocols/JabberG/jabber.cpp @@ -268,7 +268,7 @@ extern "C" int __declspec( dllexport ) Load( PLUGINLINK *link ) if ( JabberAlphaBlend == NULL && ( hDll = LoadLibraryA("msimg32.dll" ))) JabberAlphaBlend = (BOOL (WINAPI *)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION)) GetProcAddress(hDll, "AlphaBlend"); - if ( IsWinVerXPPlus() ) { + if ( IsWinVerXPPlus()) { if ( hDll = GetModuleHandleA("uxtheme")) { JabberDrawThemeParentBackground = (HRESULT (WINAPI *)(HWND,HDC,RECT *))GetProcAddress(hDll, "DrawThemeParentBackground"); JabberIsThemeActive = (BOOL (WINAPI *)())GetProcAddress(hDll, "IsThemeActive"); diff --git a/protocols/JabberG/jabber_adhoc.cpp b/protocols/JabberG/jabber_adhoc.cpp index 0221e95d11..cb398fa5f7 100644 --- a/protocols/JabberG/jabber_adhoc.cpp +++ b/protocols/JabberG/jabber_adhoc.cpp @@ -143,7 +143,7 @@ int CJabberProto::AdHoc_ExecuteCommand( HWND hwndDlg, TCHAR*, JabberAdHocData* d << XCHILDNS( _T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR( _T("node"), node ) << XATTR( _T("action"), _T("execute"))); EnableDlgItem( hwndDlg, IDC_SUBMIT, FALSE ); - SetDlgItemText( hwndDlg, IDC_SUBMIT, TranslateT( "OK" ) ); + SetDlgItemText( hwndDlg, IDC_SUBMIT, TranslateT( "OK" )); } } xi.destroyNode( dat->CommandsNode ); dat->CommandsNode = NULL; @@ -155,7 +155,7 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult( HWND hwndDlg, HXML iqNode, Jabb { int nodeIdx = 0; const TCHAR * type = xmlGetAttrValue( iqNode, _T("type")); - if ( !type || !_tcscmp( type, _T( "error" ) ) ) { + if ( !type || !_tcscmp( type, _T( "error" )) ) { // error occurred here TCHAR buff[255]; const TCHAR* code = NULL; @@ -166,10 +166,10 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult( HWND hwndDlg, HXML iqNode, Jabb code = xmlGetAttrValue( errorNode, _T("code")); description = xmlGetText( errorNode ); } - _sntprintf( buff, SIZEOF(buff), TranslateT( "Error %s %s" ), (code) ? code : _T(""), (description) ? description : _T("") ); + _sntprintf( buff, SIZEOF(buff), TranslateT( "Error %s %s" ), (code) ? code : _T(""), (description) ? description : _T("")); JabberFormSetInstruction( hwndDlg, buff ); } - else if ( !_tcscmp( type, _T("result") ) ) { + else if ( !_tcscmp( type, _T("result")) ) { BOOL validResponse = FALSE; EnumChildWindows( GetDlgItem( hwndDlg, IDC_FRAME ), sttDeleteChildWindowsProc, 0 ); dat->CurrentHeight = 0; @@ -180,8 +180,8 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult( HWND hwndDlg, HXML iqNode, Jabb const TCHAR* xmlns = xmlGetAttrValue( queryNode, _T( "xmlns" )); const TCHAR* node = xmlGetAttrValue( queryNode, _T( "node" )); if ( xmlns && node - && !_tcscmp( xmlns, _T( JABBER_FEAT_DISCO_ITEMS ) ) - && !_tcscmp( node, _T( JABBER_FEAT_COMMANDS ) ) ) + && !_tcscmp( xmlns, _T( JABBER_FEAT_DISCO_ITEMS )) + && !_tcscmp( node, _T( JABBER_FEAT_COMMANDS )) ) validResponse = TRUE; } if ( queryNode && xmlGetChild( queryNode ,0) && validResponse ) { @@ -201,12 +201,12 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult( HWND hwndDlg, HXML iqNode, Jabb } } if (nodeIdx>1) { - JabberFormSetInstruction( hwndDlg, TranslateT("Select Command") ); + JabberFormSetInstruction( hwndDlg, TranslateT("Select Command")); ShowDlgItem( hwndDlg, IDC_FRAME, SW_SHOW); ShowDlgItem( hwndDlg, IDC_VSCROLL, SW_SHOW); EnableDlgItem( hwndDlg, IDC_SUBMIT, TRUE); } else { - JabberFormSetInstruction(hwndDlg, TranslateT("Not supported") ); + JabberFormSetInstruction(hwndDlg, TranslateT("Not supported")); } } JabberAdHoc_RefreshFrameScroll( hwndDlg, dat ); @@ -227,7 +227,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA const TCHAR *type; if (( type = xmlGetAttrValue( workNode, _T("type"))) == NULL ) return TRUE; - if ( !lstrcmp( type, _T("result") ) ) { + if ( !lstrcmp( type, _T("result")) ) { // wParam = node from responder as a result of command execution HXML commandNode, xNode, n; if (( commandNode = xmlGetChild( dat->AdHocNode, _T("command"))) == NULL ) @@ -241,11 +241,11 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA HWND hFrame = GetDlgItem( hwndDlg, IDC_FRAME ); ShowWindow( GetDlgItem( hwndDlg, IDC_FRAME_TEXT ), SW_HIDE ); if (( n = xmlGetChild( xNode , "instructions" )) != NULL && xmlGetText( n )!=NULL ) - JabberFormSetInstruction( hwndDlg, xmlGetText( n ) ); + JabberFormSetInstruction( hwndDlg, xmlGetText( n )); else if (( n = xmlGetChild( xNode , "title" )) != NULL && xmlGetText( n )!=NULL ) - JabberFormSetInstruction( hwndDlg, xmlGetText( n ) ); + JabberFormSetInstruction( hwndDlg, xmlGetText( n )); else - JabberFormSetInstruction(hwndDlg, TranslateTS(status) ); + JabberFormSetInstruction(hwndDlg, TranslateTS(status)); JabberFormCreateUI( hFrame, xNode, &dat->CurrentHeight ); ShowDlgItem( hwndDlg, IDC_FRAME , SW_SHOW); } @@ -259,7 +259,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA if (noteNode) noteText = xmlGetText( noteNode ); - JabberFormSetInstruction(hwndDlg, noteText ? noteText : TranslateTS(status) ); + JabberFormSetInstruction(hwndDlg, noteText ? noteText : TranslateTS(status)); } //check actions @@ -425,7 +425,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc( HWND hwndDlg, UINT msg, WPAR << XATTR( _T("node"), pStartupParams->m_szNode ) << XATTR( _T("action"), _T("execute"))); EnableDlgItem( hwndDlg, IDC_SUBMIT, FALSE ); - SetDlgItemText( hwndDlg, IDC_SUBMIT, TranslateT( "OK" ) ); + SetDlgItemText( hwndDlg, IDC_SUBMIT, TranslateT( "OK" )); TCHAR Caption[ 512 ]; _sntprintf(Caption, SIZEOF(Caption), _T("%s %s"), TranslateT("Sending Ad-Hoc command to"), dat->ResponderJID ); @@ -595,7 +595,7 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM wParam, LPARAM lParam ) if (!item || selected) { CJabberAdhocStartupParams* pStartupParams = new CJabberAdhocStartupParams( this, jid, NULL ); - CreateDialogParam( hInst, MAKEINTRESOURCE( IDD_FORM ), NULL, JabberAdHoc_CommandDlgProc, ( LPARAM )(pStartupParams) ); + CreateDialogParam( hInst, MAKEINTRESOURCE( IDD_FORM ), NULL, JabberAdHoc_CommandDlgProc, ( LPARAM )(pStartupParams)); } JFreeVariant( &dbv ); diff --git a/protocols/JabberG/jabber_agent.cpp b/protocols/JabberG/jabber_agent.cpp index 35337568b9..144527430f 100644 --- a/protocols/JabberG/jabber_agent.cpp +++ b/protocols/JabberG/jabber_agent.cpp @@ -157,7 +157,7 @@ public: // use new jabber:x:data form HXML n = xmlGetChild( xNode , "instructions" ); if ( n != NULL && xmlGetText( n )!=NULL ) - JabberFormSetInstruction( m_hwnd, xmlGetText( n ) ); + JabberFormSetInstruction( m_hwnd, xmlGetText( n )); JabberFormCreateUI( hFrame, xNode, &m_formHeight /*dummy*/ ); } @@ -169,9 +169,9 @@ public: if ( !n ) break; - if ( xmlGetName( n ) ) { + if ( xmlGetName( n )) { if ( !lstrcmp( xmlGetName( n ), _T("instructions"))) { - JabberFormSetInstruction( m_hwnd, xmlGetText( n ) ); + JabberFormSetInstruction( m_hwnd, xmlGetText( n )); } else if ( !lstrcmp( xmlGetName( n ), _T("key")) || !lstrcmp( xmlGetName( n ), _T("registered"))) { // do nothing @@ -256,13 +256,13 @@ public: if ( !n ) break; - if ( xmlGetName( n ) ) { + if ( xmlGetName( n )) { if ( !lstrcmp( xmlGetName( n ), _T("key"))) { // field that must be passed along with the registration - if ( xmlGetText( n ) ) - xmlAddChild( query, xmlGetName( n ), xmlGetText( n ) ); + if ( xmlGetText( n )) + xmlAddChild( query, xmlGetName( n ), xmlGetText( n )); else - xmlAddChild( query, xmlGetName( n ) ); + xmlAddChild( query, xmlGetName( n )); } else if ( !lstrcmp( xmlGetName( n ), _T("registered")) || !lstrcmp( xmlGetName( n ), _T("instructions"))) { // do nothing, we will skip these diff --git a/protocols/JabberG/jabber_bookmarks.cpp b/protocols/JabberG/jabber_bookmarks.cpp index 1dbc42868b..096b8bf55f 100644 --- a/protocols/JabberG/jabber_bookmarks.cpp +++ b/protocols/JabberG/jabber_bookmarks.cpp @@ -49,7 +49,7 @@ static INT_PTR CALLBACK JabberAddBookmarkDlgProc( HWND hwndDlg, UINT msg, WPARAM param->ppro->m_hwndJabberAddBookmark = hwndDlg; TranslateDialogDefault( hwndDlg ); if ( item = param->m_item ) { - if ( !lstrcmp( item->type, _T("conference") )) { + if ( !lstrcmp( item->type, _T("conference"))) { if (!_tcschr( item->jid, _T( '@' ))) { //no room name - consider it is transport SendDlgItemMessage(hwndDlg, IDC_AGENT_RADIO, BM_SETCHECK, BST_CHECKED, 0); EnableWindow( GetDlgItem( hwndDlg, IDC_NICK ), FALSE ); @@ -85,9 +85,9 @@ static INT_PTR CALLBACK JabberAddBookmarkDlgProc( HWND hwndDlg, UINT msg, WPARAM return TRUE; case WM_COMMAND: - switch ( HIWORD(wParam) ) { + switch ( HIWORD(wParam)) { case BN_CLICKED: - switch (LOWORD (wParam) ) { + switch (LOWORD (wParam)) { case IDC_ROOM_RADIO: EnableWindow( GetDlgItem( hwndDlg, IDC_NICK ), TRUE ); EnableWindow( GetDlgItem( hwndDlg, IDC_PASSWORD ), TRUE ); diff --git a/protocols/JabberG/jabber_caps.cpp b/protocols/JabberG/jabber_caps.cpp index 9c3f69b31f..00f2a2bc68 100644 --- a/protocols/JabberG/jabber_caps.cpp +++ b/protocols/JabberG/jabber_caps.cpp @@ -91,7 +91,7 @@ const JabberFeatCapPair g_JabberFeatCapPairsExt[] = { void CJabberProto::OnIqResultCapsDiscoInfoSI( HXML, CJabberIqInfo* pInfo ) { - JABBER_RESOURCE_STATUS *r = ResourceInfoFromJID( pInfo->GetFrom() ); + JABBER_RESOURCE_STATUS *r = ResourceInfoFromJID( pInfo->GetFrom()); if ( !r ) return; @@ -103,42 +103,42 @@ void CJabberProto::OnIqResultCapsDiscoInfoSI( HXML, CJabberIqInfo* pInfo ) // XEP-0232 support HXML xform; for ( int i = 1; ( xform = xmlGetNthChild( query, _T("x"), i)) != NULL; i++ ) { - TCHAR *szFormTypeValue = XPath( xform, _T("field[@var='FORM_TYPE']/value") ); - if ( szFormTypeValue && !_tcscmp( szFormTypeValue, _T("urn:xmpp:dataforms:softwareinfo") )) { + TCHAR *szFormTypeValue = XPath( xform, _T("field[@var='FORM_TYPE']/value")); + if ( szFormTypeValue && !_tcscmp( szFormTypeValue, _T("urn:xmpp:dataforms:softwareinfo"))) { if ( r->pSoftwareInfo ) delete r->pSoftwareInfo; r->pSoftwareInfo = new JABBER_XEP0232_SOFTWARE_INFO; if ( r->pSoftwareInfo ) { - TCHAR *szTmp = XPath( xform, _T("field[@var='os']/value") ); + TCHAR *szTmp = XPath( xform, _T("field[@var='os']/value")); if ( szTmp ) r->pSoftwareInfo->szOs = mir_tstrdup( szTmp ); - szTmp = XPath( xform, _T("field[@var='os_version']/value") ); + szTmp = XPath( xform, _T("field[@var='os_version']/value")); if ( szTmp ) r->pSoftwareInfo->szOsVersion = mir_tstrdup( szTmp ); - szTmp = XPath( xform, _T("field[@var='software']/value") ); + szTmp = XPath( xform, _T("field[@var='software']/value")); if ( szTmp ) r->pSoftwareInfo->szSoftware = mir_tstrdup( szTmp ); - szTmp = XPath( xform, _T("field[@var='software_version']/value") ); + szTmp = XPath( xform, _T("field[@var='software_version']/value")); if ( szTmp ) r->pSoftwareInfo->szSoftwareVersion = mir_tstrdup( szTmp ); - szTmp = XPath( xform, _T("field[@var='x-miranda-core-version']/value") ); + szTmp = XPath( xform, _T("field[@var='x-miranda-core-version']/value")); if ( szTmp ) r->pSoftwareInfo->szXMirandaCoreVersion = mir_tstrdup( szTmp ); - szTmp = XPath( xform, _T("field[@var='x-miranda-core-is-unicode']/value") ); + szTmp = XPath( xform, _T("field[@var='x-miranda-core-is-unicode']/value")); if ( !szTmp ) // old deprecated format - szTmp = XPath( xform, _T("field[@var='x-miranda-is-unicode']/value") ); + szTmp = XPath( xform, _T("field[@var='x-miranda-is-unicode']/value")); if ( szTmp && _ttoi( szTmp )) r->pSoftwareInfo->bXMirandaIsUnicode = TRUE; - szTmp = XPath( xform, _T("field[@var='x-miranda-core-is-alpha']/value") ); + szTmp = XPath( xform, _T("field[@var='x-miranda-core-is-alpha']/value")); if ( !szTmp ) // old deprecated format - szTmp = XPath( xform, _T("field[@var='x-miranda-is-alpha']/value") ); + szTmp = XPath( xform, _T("field[@var='x-miranda-is-alpha']/value")); if ( szTmp && _ttoi( szTmp )) r->pSoftwareInfo->bXMirandaIsAlpha = TRUE; - szTmp = XPath( xform, _T("field[@var='x-miranda-jabber-is-debug']/value") ); + szTmp = XPath( xform, _T("field[@var='x-miranda-jabber-is-debug']/value")); if ( szTmp && _ttoi( szTmp )) r->pSoftwareInfo->bXMirandaIsDebug = TRUE; } - JabberUserInfoUpdate( pInfo->GetHContact() ); + JabberUserInfoUpdate( pInfo->GetHContact()); } } } @@ -146,7 +146,7 @@ void CJabberProto::OnIqResultCapsDiscoInfoSI( HXML, CJabberIqInfo* pInfo ) void CJabberProto::OnIqResultCapsDiscoInfo( HXML, CJabberIqInfo* pInfo ) { - JABBER_RESOURCE_STATUS *r = ResourceInfoFromJID( pInfo->GetFrom() ); + JABBER_RESOURCE_STATUS *r = ResourceInfoFromJID( pInfo->GetFrom()); HXML query = pInfo->GetChildNode(); if ( pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && query ) { @@ -171,7 +171,7 @@ void CJabberProto::OnIqResultCapsDiscoInfo( HXML, CJabberIqInfo* pInfo ) if (!m_clientCapsManager.SetClientCaps( pInfo->GetIqId(), jcbCaps )) if ( r ) r->jcbCachedCaps = jcbCaps; - JabberUserInfoUpdate( pInfo->GetHContact() ); + JabberUserInfoUpdate( pInfo->GetHContact()); } else { // no version info support and no XEP-0115 support? @@ -243,7 +243,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites( const TCHAR *jid, BOOL appe CJabberIqInfo *pInfo = m_iqManager.AddHandler( &CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, fullJid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE ); pInfo->SetTimeout( JABBER_RESOURCE_CAPS_QUERY_TIMEOUT ); - m_clientCapsManager.SetClientCaps( r->szCapsNode, r->szCapsVer, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId() ); + m_clientCapsManager.SetClientCaps( r->szCapsNode, r->szCapsVer, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId()); r->dwDiscoInfoRequestTime = pInfo->GetRequestTime(); TCHAR queryNode[512]; @@ -260,7 +260,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites( const TCHAR *jid, BOOL appe if ( jcbMainCaps != JABBER_RESOURCE_CAPS_TIMEOUT && r->szCapsExt ) { TCHAR *caps = mir_tstrdup( r->szCapsExt ); - TCHAR *token = _tcstok( caps, _T(" ") ); + TCHAR *token = _tcstok( caps, _T(" ")); while ( token ) { switch ( jcbExtCaps = m_clientCapsManager.GetClientCaps( r->szCapsNode, token )) { case JABBER_RESOURCE_CAPS_ERROR: @@ -272,7 +272,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites( const TCHAR *jid, BOOL appe CJabberIqInfo* pInfo = m_iqManager.AddHandler( &CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, fullJid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE ); pInfo->SetTimeout( JABBER_RESOURCE_CAPS_QUERY_TIMEOUT ); - m_clientCapsManager.SetClientCaps( r->szCapsNode, token, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId() ); + m_clientCapsManager.SetClientCaps( r->szCapsNode, token, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId()); TCHAR queryNode[512]; mir_sntprintf( queryNode, SIZEOF(queryNode), _T("%s#%s"), r->szCapsNode, token ); @@ -290,7 +290,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites( const TCHAR *jid, BOOL appe jcbCaps |= jcbExtCaps; } - token = _tcstok( NULL, _T(" ") ); + token = _tcstok( NULL, _T(" ")); } mir_free(caps); @@ -357,7 +357,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites( const TCHAR *jid, BOOL appe JabberCapsBits jcbMainCaps = m_clientCapsManager.GetClientCaps( r->software, r->version ); if ( jcbMainCaps == JABBER_RESOURCE_CAPS_ERROR ) { // Bombus hack: - if ( !_tcscmp( r->software, _T( "Bombus" )) || !_tcscmp( r->software, _T( "BombusMod" )) ) { + if ( !_tcscmp( r->software, _T( "Bombus" )) || !_tcscmp( r->software, _T( "BombusMod" ))) { jcbMainCaps = JABBER_CAPS_SI|JABBER_CAPS_SI_FT|JABBER_CAPS_IBB|JABBER_CAPS_MESSAGE_EVENTS|JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY|JABBER_CAPS_DATA_FORMS|JABBER_CAPS_LAST_ACTIVITY|JABBER_CAPS_VERSION|JABBER_CAPS_COMMANDS|JABBER_CAPS_VCARD_TEMP; m_clientCapsManager.SetClientCaps( r->software, r->version, jcbMainCaps ); } @@ -377,7 +377,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites( const TCHAR *jid, BOOL appe CJabberIqInfo *pInfo = m_iqManager.AddHandler( &CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, fullJid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE ); pInfo->SetTimeout( JABBER_RESOURCE_CAPS_QUERY_TIMEOUT ); - m_clientCapsManager.SetClientCaps( r->software, r->version, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId() ); + m_clientCapsManager.SetClientCaps( r->software, r->version, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId()); r->dwDiscoInfoRequestTime = pInfo->GetRequestTime(); XmlNodeIq iq( pInfo ); @@ -515,7 +515,7 @@ BOOL CJabberClientCaps::SetPartialCaps( int nIqId, JabberCapsBits jcbCaps ) { CJabberClientPartialCaps *pCaps = FindById( nIqId ); if ( !pCaps ) return FALSE; - if ( !(jcbCaps & JABBER_RESOURCE_CAPS_ERROR) && m_szNode && pCaps->GetVersion() ) { + if ( !(jcbCaps & JABBER_RESOURCE_CAPS_ERROR) && m_szNode && pCaps->GetVersion()) { if ( !_tcscmp( m_szNode, _T( "http://miranda-im.org/caps" )) && !_tcscmp( pCaps->GetVersion(), _T( "0.7.0.13" ))) jcbCaps = jcbCaps & ( ~JABBER_CAPS_MESSAGE_RECEIPTS ); } @@ -702,14 +702,14 @@ BOOL CJabberClientCapsManager::HandleInfoRequest( HXML, CJabberIqInfo* pInfo, co form << XCHILD( _T("field")) << XATTR( _T("var"), _T("x-miranda-core-version")) << XCHILD( _T("value"), szCoreVersion ); #ifdef _DEBUG - form << XCHILD( _T("field")) << XATTR( _T("var"), _T("x-miranda-jabber-is-debug")) << XCHILD( _T("value"), _T("1") ); + form << XCHILD( _T("field")) << XATTR( _T("var"), _T("x-miranda-jabber-is-debug")) << XCHILD( _T("value"), _T("1")); #endif char szMirandaVersion[100]; if (!JCallService( MS_SYSTEM_GETVERSIONTEXT, sizeof( szMirandaVersion ), ( LPARAM )szMirandaVersion )) { _strlwr( szMirandaVersion ); - form << XCHILD( _T("field")) << XATTR( _T("var"), _T("x-miranda-core-is-unicode")) << XCHILD( _T("value"), strstr( szMirandaVersion, "unicode" ) ? _T("1") : _T("0") ); - form << XCHILD( _T("field")) << XATTR( _T("var"), _T("x-miranda-core-is-alpha")) << XCHILD( _T("value"), strstr( szMirandaVersion, "alpha" ) ? _T("1") : _T("0") ); + form << XCHILD( _T("field")) << XATTR( _T("var"), _T("x-miranda-core-is-unicode")) << XCHILD( _T("value"), strstr( szMirandaVersion, "unicode" ) ? _T("1") : _T("0")); + form << XCHILD( _T("field")) << XATTR( _T("var"), _T("x-miranda-core-is-alpha")) << XCHILD( _T("value"), strstr( szMirandaVersion, "alpha" ) ? _T("1") : _T("0")); } } diff --git a/protocols/JabberG/jabber_captcha.cpp b/protocols/JabberG/jabber_captcha.cpp index c090499cd2..5808cd285c 100644 --- a/protocols/JabberG/jabber_captcha.cpp +++ b/protocols/JabberG/jabber_captcha.cpp @@ -53,7 +53,7 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam LPCTSTR hint = params->hint; if ( hint == NULL ) hint = TranslateT("Enter the text you see"); - SetDlgItemText( hwndDlg, IDC_INSTRUCTION, TranslateTS( hint ) ); + SetDlgItemText( hwndDlg, IDC_INSTRUCTION, TranslateTS( hint )); SetWindowLongPtr( hwndDlg, GWLP_USERDATA, ( LONG )params ); return TRUE; @@ -95,7 +95,7 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam return TRUE; case IDC_SUBMIT: - GetDlgItemText( hwndDlg, IDC_VALUE, params->Result, SIZEOF(params->Result) ); + GetDlgItemText( hwndDlg, IDC_VALUE, params->Result, SIZEOF(params->Result)); EndDialog( hwndDlg, 1 ); return TRUE; } diff --git a/protocols/JabberG/jabber_chat.cpp b/protocols/JabberG/jabber_chat.cpp index b90ce80d6a..fc2662f94c 100644 --- a/protocols/JabberG/jabber_chat.cpp +++ b/protocols/JabberG/jabber_chat.cpp @@ -775,7 +775,7 @@ public: CSuper::OnInitDialog(); TCHAR buf[256]; - mir_sntprintf(buf, SIZEOF(buf), _T("%s\n%s"), m_room, TranslateT("Send groupchat invitation.") ); + mir_sntprintf(buf, SIZEOF(buf), _T("%s\n%s"), m_room, TranslateT("Send groupchat invitation.")); SetDlgItemText(m_hwnd, IDC_HEADERBAR, buf); WindowSetIcon(m_hwnd, m_proto, "group"); @@ -984,7 +984,7 @@ static LRESULT CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam switch (value) { TCHAR szBareJid[ JABBER_MAX_JID_LEN ]; - JabberStripJid( dat->him->szRealJid, szBareJid, SIZEOF(szBareJid) ); + JabberStripJid( dat->him->szRealJid, szBareJid, SIZEOF(szBareJid)); case AFFILIATION_NONE: if (dat->him->szRealJid) dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("none")); @@ -1181,7 +1181,7 @@ static void sttNickListHook( CJabberProto* ppro, JABBER_LIST_ITEM* item, GCHOOK* if (him->szRealJid) { TCHAR szBareJid[ JABBER_MAX_JID_LEN ]; - JabberStripJid( him->szRealJid, szBareJid, SIZEOF(szBareJid) ); + JabberStripJid( him->szRealJid, szBareJid, SIZEOF(szBareJid)); ppro->AdminSet(item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("none")); } else @@ -1194,7 +1194,7 @@ static void sttNickListHook( CJabberProto* ppro, JABBER_LIST_ITEM* item, GCHOOK* if (him->szRealJid) { TCHAR szBareJid[ JABBER_MAX_JID_LEN ]; - JabberStripJid( him->szRealJid, szBareJid, SIZEOF(szBareJid) ); + JabberStripJid( him->szRealJid, szBareJid, SIZEOF(szBareJid)); ppro->AdminSet(item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("member")); } else @@ -1207,7 +1207,7 @@ static void sttNickListHook( CJabberProto* ppro, JABBER_LIST_ITEM* item, GCHOOK* if (him->szRealJid) { TCHAR szBareJid[ JABBER_MAX_JID_LEN ]; - JabberStripJid( him->szRealJid, szBareJid, SIZEOF(szBareJid) ); + JabberStripJid( him->szRealJid, szBareJid, SIZEOF(szBareJid)); ppro->AdminSet(item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("admin")); } else @@ -1220,7 +1220,7 @@ static void sttNickListHook( CJabberProto* ppro, JABBER_LIST_ITEM* item, GCHOOK* if (him->szRealJid) { TCHAR szBareJid[ JABBER_MAX_JID_LEN ]; - JabberStripJid( him->szRealJid, szBareJid, SIZEOF(szBareJid) ); + JabberStripJid( him->szRealJid, szBareJid, SIZEOF(szBareJid)); ppro->AdminSet(item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("owner")); } else @@ -1232,7 +1232,7 @@ static void sttNickListHook( CJabberProto* ppro, JABBER_LIST_ITEM* item, GCHOOK* if ((GetTickCount() - dwLastBanKickTime) > BAN_KICK_INTERVAL) { if ( him->szRealJid && *him->szRealJid ) { TCHAR szVictimBareJid[ JABBER_MAX_JID_LEN ]; - JabberStripJid( him->szRealJid, szVictimBareJid, SIZEOF(szVictimBareJid) ); + JabberStripJid( him->szRealJid, szVictimBareJid, SIZEOF(szVictimBareJid)); mir_sntprintf( szBuffer, SIZEOF(szBuffer), _T("%s: "), me->resourceName ); mir_sntprintf( szTitle, SIZEOF(szTitle), _T("%s %s"), TranslateT( "Reason to ban" ), him->resourceName ); @@ -1455,7 +1455,7 @@ static void sttLogListHook( CJabberProto* ppro, JABBER_LIST_ITEM* item, GCHOOK* case IDM_PRESENCE_DND: case IDM_PRESENCE_FREE4CHAT: { - if ( HANDLE h = ppro->HContactFromJID( item->jid ) ) + if ( HANDLE h = ppro->HContactFromJID( item->jid )) ppro->OnMenuHandleDirectPresence( (WPARAM)h, 0, gch->dwData ); break; } @@ -1568,7 +1568,7 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////////////// void CJabberProto::AddMucListItem( JABBER_MUC_JIDLIST_INFO* jidListInfo, TCHAR* str , TCHAR* rsn) { - const TCHAR* field = ( jidListInfo->type == MUC_BANLIST || _tcschr(str,'@') ) ? _T("jid") : _T("nick"); + const TCHAR* field = ( jidListInfo->type == MUC_BANLIST || _tcschr(str,'@')) ? _T("jid") : _T("nick"); TCHAR* roomJid = jidListInfo->roomJid; if ( jidListInfo->type == MUC_BANLIST ) { AdminSetReason( roomJid, xmlnsAdmin, field, str, _T("affiliation"), _T("outcast"), rsn); @@ -1577,7 +1577,7 @@ void CJabberProto::AddMucListItem( JABBER_MUC_JIDLIST_INFO* jidListInfo, TCHAR* void CJabberProto::AddMucListItem( JABBER_MUC_JIDLIST_INFO* jidListInfo, TCHAR* str ) { - const TCHAR* field = ( jidListInfo->type == MUC_BANLIST || _tcschr(str,'@') ) ? _T("jid") : _T("nick"); + const TCHAR* field = ( jidListInfo->type == MUC_BANLIST || _tcschr(str,'@')) ? _T("jid") : _T("nick"); TCHAR* roomJid = jidListInfo->roomJid; switch (jidListInfo->type) { diff --git a/protocols/JabberG/jabber_console.cpp b/protocols/JabberG/jabber_console.cpp index 9772446e4d..4214e67563 100644 --- a/protocols/JabberG/jabber_console.cpp +++ b/protocols/JabberG/jabber_console.cpp @@ -88,7 +88,7 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent); void CJabberProto::OnConsoleProcessXml(HXML node, DWORD flags) { if ( node && m_pDlgConsole ) { - if ( xmlGetName( node ) ) { + if ( xmlGetName( node )) { if ( FilterXml( node, flags )) { StringBuf buf = {0}; sttAppendBufRaw(&buf, RTF_HEADER); @@ -243,7 +243,7 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent) sttAppendBufRaw(buf, RTF_ENDATTRNAME); sttAppendBufRaw(buf, "=\""); sttAppendBufRaw(buf, RTF_BEGINATTRVAL); - sttAppendBufT(buf, ( TCHAR* )xmlGetAttr( node, i) ); + sttAppendBufT(buf, ( TCHAR* )xmlGetAttr( node, i)); sttAppendBufRaw(buf, "\""); sttAppendBufRaw(buf, RTF_ENDATTRVAL); } @@ -712,7 +712,7 @@ void CJabberProto::ConsoleUninit() INT_PTR __cdecl CJabberProto::OnMenuHandleConsole(WPARAM, LPARAM) { if ( m_pDlgConsole ) - SetForegroundWindow( m_pDlgConsole->GetHwnd() ); + SetForegroundWindow( m_pDlgConsole->GetHwnd()); else if ( m_hThreadConsole ) PostThreadMessage( m_dwConsoleThreadId, WM_CREATECONSOLE, 0, 0 ); diff --git a/protocols/JabberG/jabber_disco.cpp b/protocols/JabberG/jabber_disco.cpp index 236ce274c6..e44f3613f9 100644 --- a/protocols/JabberG/jabber_disco.cpp +++ b/protocols/JabberG/jabber_disco.cpp @@ -201,7 +201,7 @@ void CJabberProto::OnIqResultServiceDiscoveryInfo( HXML iqNode, CJabberIqInfo* p pNode->SetInfoRequestErrorText( str ); mir_free( str ); } - else pNode->SetInfoRequestErrorText( TranslateT("request timeout.") ); + else pNode->SetInfoRequestErrorText( TranslateT("request timeout.")); pNode->SetInfoRequestId( JABBER_DISCO_RESULT_ERROR ); } @@ -245,7 +245,7 @@ void CJabberProto::OnIqResultServiceDiscoveryItems( HXML iqNode, CJabberIqInfo* mir_free( str ); } else { - pNode->SetItemsRequestErrorText( _T("request timeout.") ); + pNode->SetItemsRequestErrorText( _T("request timeout.")); } pNode->SetItemsRequestId( JABBER_DISCO_RESULT_ERROR ); } @@ -312,15 +312,15 @@ BOOL CJabberProto::SendInfoRequest(CJabberSDNode* pNode, HXML parent) return FALSE; // disco#info - if ( !pNode->GetInfoRequestId() ) { - CJabberIqInfo* pInfo = m_iqManager.AddHandler( &CJabberProto::OnIqResultServiceDiscoveryInfo, JABBER_IQ_TYPE_GET, pNode->GetJid() ); + if ( !pNode->GetInfoRequestId()) { + CJabberIqInfo* pInfo = m_iqManager.AddHandler( &CJabberProto::OnIqResultServiceDiscoveryInfo, JABBER_IQ_TYPE_GET, pNode->GetJid()); pInfo->SetTimeout( 30000 ); - pNode->SetInfoRequestId( pInfo->GetIqId() ); + pNode->SetInfoRequestId( pInfo->GetIqId()); XmlNodeIq iq( pInfo ); HXML query = iq << XQUERY( _T(JABBER_FEAT_DISCO_INFO)); - if ( pNode->GetNode() ) - xmlAddAttr( query, _T("node"), pNode->GetNode() ); + if ( pNode->GetNode()) + xmlAddAttr( query, _T("node"), pNode->GetNode()); if ( parent ) xmlAddChild( parent, iq ); @@ -342,15 +342,15 @@ BOOL CJabberProto::SendBothRequests(CJabberSDNode* pNode, HXML parent) return FALSE; // disco#info - if ( !pNode->GetInfoRequestId() ) { - CJabberIqInfo* pInfo = m_iqManager.AddHandler( &CJabberProto::OnIqResultServiceDiscoveryInfo, JABBER_IQ_TYPE_GET, pNode->GetJid() ); + if ( !pNode->GetInfoRequestId()) { + CJabberIqInfo* pInfo = m_iqManager.AddHandler( &CJabberProto::OnIqResultServiceDiscoveryInfo, JABBER_IQ_TYPE_GET, pNode->GetJid()); pInfo->SetTimeout( 30000 ); - pNode->SetInfoRequestId( pInfo->GetIqId() ); + pNode->SetInfoRequestId( pInfo->GetIqId()); XmlNodeIq iq( pInfo ); HXML query = iq << XQUERY( _T(JABBER_FEAT_DISCO_INFO)); - if ( pNode->GetNode() ) - xmlAddAttr( query, _T("node"), pNode->GetNode() ); + if ( pNode->GetNode()) + xmlAddAttr( query, _T("node"), pNode->GetNode()); if ( parent ) xmlAddChild( parent, iq ); @@ -359,15 +359,15 @@ BOOL CJabberProto::SendBothRequests(CJabberSDNode* pNode, HXML parent) } // disco#items - if ( !pNode->GetItemsRequestId() ) { - CJabberIqInfo* pInfo = m_iqManager.AddHandler( &CJabberProto::OnIqResultServiceDiscoveryItems, JABBER_IQ_TYPE_GET, pNode->GetJid() ); + if ( !pNode->GetItemsRequestId()) { + CJabberIqInfo* pInfo = m_iqManager.AddHandler( &CJabberProto::OnIqResultServiceDiscoveryItems, JABBER_IQ_TYPE_GET, pNode->GetJid()); pInfo->SetTimeout( 30000 ); - pNode->SetItemsRequestId( pInfo->GetIqId() ); + pNode->SetItemsRequestId( pInfo->GetIqId()); XmlNodeIq iq( pInfo ); HXML query = iq << XQUERY( _T(JABBER_FEAT_DISCO_ITEMS)); - if ( pNode->GetNode() ) - xmlAddAttr( query, _T("node"), pNode->GetNode() ); + if ( pNode->GetNode()) + xmlAddAttr( query, _T("node"), pNode->GetNode()); if ( parent ) xmlAddChild( parent, iq ); @@ -550,7 +550,7 @@ BOOL CJabberProto::SyncTree(HTREELISTITEM hIndex, CJabberSDNode* pNode) CJabberSDNode* pTmp = pNode; while (pTmp) { - if ( !pTmp->GetTreeItemHandle() ) { + if ( !pTmp->GetTreeItemHandle()) { HTREELISTITEM hNewItem = TreeList_AddItem( GetDlgItem(m_pDlgServiceDiscovery->GetHwnd(), IDC_TREE_DISCO), hIndex, pTmp->GetName() ? pTmp->GetName() : pTmp->GetJid(), @@ -566,8 +566,8 @@ BOOL CJabberProto::SyncTree(HTREELISTITEM hIndex, CJabberSDNode* pNode) ApplyNodeIcon(pNode->GetTreeItemHandle(), pNode); - if ( pTmp->GetFirstChildNode() ) - SyncTree( pTmp->GetTreeItemHandle(), pTmp->GetFirstChildNode() ); + if ( pTmp->GetFirstChildNode()) + SyncTree( pTmp->GetTreeItemHandle(), pTmp->GetFirstChildNode()); pTmp = pTmp->GetNext(); } @@ -642,11 +642,11 @@ void CJabberDlgDiscovery::OnInitDialog() if ( m_jid ) { SetDlgItemText( m_hwnd, IDC_COMBO_JID, m_jid ); - SetDlgItemText( m_hwnd, IDC_COMBO_NODE, _T("") ); + SetDlgItemText( m_hwnd, IDC_COMBO_NODE, _T("")); m_focusEditAfterBrowse = false; } else { SetDlgItemTextA( m_hwnd, IDC_COMBO_JID, m_proto->m_ThreadInfo->server ); - SetDlgItemText( m_hwnd, IDC_COMBO_NODE, _T("") ); + SetDlgItemText( m_hwnd, IDC_COMBO_NODE, _T("")); m_focusEditAfterBrowse = true; } @@ -804,7 +804,7 @@ void CJabberDlgDiscovery::btnViewAsList_OnClick(CCtrlButton *) void CJabberDlgDiscovery::btnGoHome_OnClick(CCtrlButton *) { SetDlgItemTextA( m_hwnd, IDC_COMBO_JID, m_proto->m_ThreadInfo->server ); - SetDlgItemText( m_hwnd, IDC_COMBO_NODE, _T("") ); + SetDlgItemText( m_hwnd, IDC_COMBO_NODE, _T("")); PostMessage( m_hwnd, WM_COMMAND, MAKEWPARAM( IDC_BUTTON_BROWSE, 0 ), 0 ); } @@ -989,8 +989,8 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) CJabberSDNode* pNode = m_proto->m_SDManager.GetPrimaryNode(); while (pNode) { - if ( pNode->GetJid() ) { - if ( !pNode->GetTreeItemHandle() ) { + if ( pNode->GetJid()) { + if ( !pNode->GetTreeItemHandle()) { HTREELISTITEM hNewItem = TreeList_AddItem( GetDlgItem( m_hwnd, IDC_TREE_DISCO), NULL, pNode->GetName() ? pNode->GetName() : pNode->GetJid(), @@ -1413,12 +1413,12 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_BOOKMARK: { - JABBER_LIST_ITEM* item = ListGetItemPtr( LIST_BOOKMARK, pNode->GetJid() ); + JABBER_LIST_ITEM* item = ListGetItemPtr( LIST_BOOKMARK, pNode->GetJid()); if ( item == NULL ) { - item = ListGetItemPtr( LIST_BOOKMARK, pNode->GetJid() ); + item = ListGetItemPtr( LIST_BOOKMARK, pNode->GetJid()); if ( item == NULL ) { - item = ListAdd( LIST_ROOM, pNode->GetJid() ); - item->name = mir_tstrdup( pNode->GetName() ); + item = ListAdd( LIST_ROOM, pNode->GetJid()); + item->name = mir_tstrdup( pNode->GetName()); } if ( item != NULL ) { item->type = _T("conference"); @@ -1429,10 +1429,10 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_USERMENU: { - HANDLE hContact = HContactFromJID( pNode->GetJid() ); + HANDLE hContact = HContactFromJID( pNode->GetJid()); if ( !hContact ) { hContact = DBCreateContact( pNode->GetJid(), pNode->GetName(), TRUE, FALSE ); - JABBER_LIST_ITEM* item = ListAdd( LIST_VCARD_TEMP, pNode->GetJid() ); + JABBER_LIST_ITEM* item = ListAdd( LIST_VCARD_TEMP, pNode->GetJid()); item->bUseResource = TRUE; } HMENU hContactMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0); @@ -1453,7 +1453,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM hContact = ( HANDLE )CallProtoService( m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, ( LPARAM )&jsr ); } if ( ListGetItemPtr( LIST_VCARD_TEMP, pNode->GetJid()) == NULL ) { - JABBER_LIST_ITEM* item = ListAdd( LIST_VCARD_TEMP, pNode->GetJid() ); + JABBER_LIST_ITEM* item = ListAdd( LIST_VCARD_TEMP, pNode->GetJid()); item->bUseResource = TRUE; if ( item->resource == NULL ) ListAddResource( LIST_VCARD_TEMP, jid, ID_STATUS_OFFLINE, NULL, 0); @@ -1466,7 +1466,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM { HANDLE hContact = DBCreateContact(pNode->GetJid(), pNode->GetName(), FALSE, FALSE); DBDeleteContactSetting( hContact, "CList", "NotOnList" ); - JABBER_LIST_ITEM* item = ListAdd( LIST_VCARD_TEMP, pNode->GetJid() ); + JABBER_LIST_ITEM* item = ListAdd( LIST_VCARD_TEMP, pNode->GetJid()); item->bUseResource = TRUE; break; } @@ -1477,7 +1477,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM break; case SD_ACT_UNREGISTER: - m_ThreadInfo->send( XmlNodeIq( _T("set"), SerialNext(), pNode->GetJid() ) << XQUERY( _T(JABBER_FEAT_REGISTER)) << XCHILD( _T("remove"))); + m_ThreadInfo->send( XmlNodeIq( _T("set"), SerialNext(), pNode->GetJid()) << XQUERY( _T(JABBER_FEAT_REGISTER)) << XCHILD( _T("remove"))); m_ThreadInfo->send( XmlNodeIq( _T("set"), SerialNext()) << XQUERY( _T(JABBER_FEAT_IQ_ROSTER)) << XCHILD( _T("item")) << XATTR( _T("jid"), pNode->GetJid()) << XATTR( _T("subscription"), _T("remove"))); @@ -1496,7 +1496,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM void CJabberProto::LaunchServiceDiscovery(TCHAR *jid) { if ( m_pDlgServiceDiscovery ) { - SetForegroundWindow( m_pDlgServiceDiscovery->GetHwnd() ); + SetForegroundWindow( m_pDlgServiceDiscovery->GetHwnd()); if (jid) { SetDlgItemText( m_pDlgServiceDiscovery->GetHwnd(), IDC_COMBO_JID, jid); SetDlgItemTextA( m_pDlgServiceDiscovery->GetHwnd(), IDC_COMBO_NODE, ""); diff --git a/protocols/JabberG/jabber_disco.h b/protocols/JabberG/jabber_disco.h index 372a9b1379..3c34dfab5f 100644 --- a/protocols/JabberG/jabber_disco.h +++ b/protocols/JabberG/jabber_disco.h @@ -379,16 +379,16 @@ public: CJabberSDIdentity *pIdentity = m_pIdentities; while ( pIdentity ) { - if ( pIdentity->GetName() ) + if ( pIdentity->GetName()) mir_sntprintf( szTmp, SIZEOF( szTmp ), _T(" %c %s (%s: %s, %s: %s)\r\n"), CHR_BULLET, pIdentity->GetName(), TranslateT("category"), pIdentity->GetCategory(), - TranslateT("type"), pIdentity->GetType() ); + TranslateT("type"), pIdentity->GetType()); else mir_sntprintf( szTmp, SIZEOF( szTmp ), _T(" %c %s: %s, %s: %s\r\n"), CHR_BULLET, TranslateT("Category"), pIdentity->GetCategory(), - TranslateT("Type"), pIdentity->GetType() ); + TranslateT("Type"), pIdentity->GetType()); AppendString( &szBuffer, szTmp ); @@ -402,7 +402,7 @@ public: CJabberSDFeature *pFeature = m_pFeatures; while ( pFeature ) { - mir_sntprintf( szTmp, SIZEOF( szTmp ), _T(" %c %s\r\n"), CHR_BULLET, pFeature->GetVar() ); + mir_sntprintf( szTmp, SIZEOF( szTmp ), _T(" %c %s\r\n"), CHR_BULLET, pFeature->GetVar()); AppendString( &szBuffer, szTmp ); @@ -484,7 +484,7 @@ public: CJabberSDNode *pTmpNode = NULL; pNode = m_pPrimaryNodes; while ( pNode ) { - if ( pTmpNode = pNode->FindByIqId( nIqId, bInfoId ) ) + if ( pTmpNode = pNode->FindByIqId( nIqId, bInfoId )) return pTmpNode; pNode = pNode->GetNext(); } diff --git a/protocols/JabberG/jabber_events.cpp b/protocols/JabberG/jabber_events.cpp index 722f55f6b4..591bff3c96 100644 --- a/protocols/JabberG/jabber_events.cpp +++ b/protocols/JabberG/jabber_events.cpp @@ -53,7 +53,7 @@ int CJabberProto::OnContactDeleted( WPARAM wParam, LPARAM ) if ( ListExist( LIST_ROSTER, dbv.ptszVal )) { if ( !_tcschr( dbv.ptszVal, _T( '@' ))) { TCHAR szStrippedJid[JABBER_MAX_JID_LEN]; - JabberStripJid( m_ThreadInfo->fullJID, szStrippedJid, SIZEOF(szStrippedJid) ); + JabberStripJid( m_ThreadInfo->fullJID, szStrippedJid, SIZEOF(szStrippedJid)); TCHAR *szDog = _tcschr( szStrippedJid, _T('@')); if ( szDog && _tcsicmp( szDog + 1, dbv.ptszVal )) m_ThreadInfo->send( XmlNodeIq( _T("set"), SerialNext(), dbv.ptszVal ) << XQUERY( _T(JABBER_FEAT_REGISTER)) << XCHILD( _T("remove"))); diff --git a/protocols/JabberG/jabber_form.cpp b/protocols/JabberG/jabber_form.cpp index 64fe2ea5cd..797001e630 100644 --- a/protocols/JabberG/jabber_form.cpp +++ b/protocols/JabberG/jabber_form.cpp @@ -471,7 +471,7 @@ void JabberFormCreateUI( HWND hwndStatic, HXML xNode, int *formHeight, BOOL bCom TCHAR *labelStr, *valueStr, *p; RECT frameRect; - if ( xNode==NULL || xmlGetName( xNode )==NULL || lstrcmp( xmlGetName( xNode ), _T("x") ) || hwndStatic==NULL ) return; + if ( xNode==NULL || xmlGetName( xNode )==NULL || lstrcmp( xmlGetName( xNode ), _T("x")) || hwndStatic==NULL ) return; GetClientRect( hwndStatic, &frameRect ); @@ -490,7 +490,7 @@ void JabberFormCreateUI( HWND hwndStatic, HXML xNode, int *formHeight, BOOL bCom if ( !n ) break; - if ( xmlGetName( n ) ) { + if ( xmlGetName( n )) { if ( !lstrcmp( xmlGetName( n ), _T("field"))) { varStr = xmlGetAttrValue( n, _T("var")); if (( typeName = xmlGetAttrValue( n, _T("type"))) != NULL ) { @@ -514,8 +514,8 @@ void JabberFormCreateUI( HWND hwndStatic, HXML xNode, int *formHeight, BOOL bCom v = xmlGetChild( n ,j); if ( !v ) break; - if ( xmlGetName( v ) && !lstrcmp( xmlGetName( v ), _T("value")) && xmlGetText( v ) ) - size += _tcslen( xmlGetText( v ) ) + 2; + if ( xmlGetName( v ) && !lstrcmp( xmlGetName( v ), _T("value")) && xmlGetText( v )) + size += _tcslen( xmlGetText( v )) + 2; } valueStr = ( TCHAR* )mir_alloc( sizeof(TCHAR)*size ); valueStr[0] = '\0'; @@ -523,10 +523,10 @@ void JabberFormCreateUI( HWND hwndStatic, HXML xNode, int *formHeight, BOOL bCom v = xmlGetChild( n ,j); if ( !v ) break; - if ( xmlGetName( v ) && !lstrcmp( xmlGetName( v ), _T("value")) && xmlGetText( v ) ) { + if ( xmlGetName( v ) && !lstrcmp( xmlGetName( v ), _T("value")) && xmlGetText( v )) { if ( valueStr[0] ) _tcscat( valueStr, _T("\r\n")); - _tcscat( valueStr, xmlGetText( v ) ); + _tcscat( valueStr, xmlGetText( v )); } } } } else @@ -546,12 +546,12 @@ void JabberFormCreateUI( HWND hwndStatic, HXML xNode, int *formHeight, BOOL bCom if ( !o ) break; if ( xmlGetName( o ) && !lstrcmp( xmlGetName( o ), _T("option"))) { - if (( v = xmlGetChild( o , "value" )) != NULL && xmlGetText( v ) ) { + if (( v = xmlGetChild( o , "value" )) != NULL && xmlGetText( v )) { if (( str = xmlGetAttrValue( o, _T("label"))) == NULL ) str = xmlGetText( v ); if (( p = mir_tstrdup( str )) != NULL ) { bool selected = false; - if ( valueText != NULL && !_tcscmp( valueText, xmlGetText( v ) )) + if ( valueText != NULL && !_tcscmp( valueText, xmlGetText( v ))) selected = true; JabberFormAddListItem(item, p, selected); mir_free( p ); @@ -564,7 +564,7 @@ void JabberFormCreateUI( HWND hwndStatic, HXML xNode, int *formHeight, BOOL bCom if ( !o ) break; if ( xmlGetName( o ) && !lstrcmp( xmlGetName( o ), _T("option"))) { - if (( v = xmlGetChild( o , "value" )) != NULL && xmlGetText( v ) ) { + if (( v = xmlGetChild( o , "value" )) != NULL && xmlGetText( v )) { if (( str = xmlGetAttrValue( o, _T("label"))) == NULL ) str = xmlGetText( v ); if (( p = mir_tstrdup( str )) != NULL ) { @@ -573,7 +573,7 @@ void JabberFormCreateUI( HWND hwndStatic, HXML xNode, int *formHeight, BOOL bCom vs = xmlGetChild( n ,k); if ( !vs ) break; - if ( !lstrcmp( xmlGetName( vs ), _T("value")) && xmlGetText( vs ) && !_tcscmp( xmlGetText( vs ), xmlGetText( v ) )) + if ( !lstrcmp( xmlGetName( vs ), _T("value")) && xmlGetText( vs ) && !_tcscmp( xmlGetText( vs ), xmlGetText( v ))) { selected = true; break; @@ -661,7 +661,7 @@ HXML JabberFormGetData( HWND hwndStatic, HXML xNode ) break; if ( !lstrcmp( xmlGetName( o ), _T("option"))) { - if (( v = xmlGetChild( o , "value" )) != NULL && xmlGetText( v ) ) { + if (( v = xmlGetChild( o , "value" )) != NULL && xmlGetText( v )) { if (( str2 = xmlGetAttrValue( o, _T("label"))) == NULL ) str2 = xmlGetText( v ); if ( !lstrcmp( str2, str )) @@ -688,12 +688,12 @@ HXML JabberFormGetData( HWND hwndStatic, HXML xNode ) break; if ( xmlGetName( o ) && !lstrcmp( xmlGetName( o ), _T("option"))) { - if (( v = xmlGetChild( o , "value" )) != NULL && xmlGetText( v ) ) { + if (( v = xmlGetChild( o , "value" )) != NULL && xmlGetText( v )) { if (( labelText = xmlGetAttrValue( o, _T("label"))) == NULL ) labelText = xmlGetText( v ); if ( !lstrcmp( labelText, str )) - field << XCHILD( _T("value"), xmlGetText( v ) ); + field << XCHILD( _T("value"), xmlGetText( v )); } } } mir_free( str ); } } } @@ -748,16 +748,16 @@ static INT_PTR CALLBACK JabberFormDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam if ( jfi != NULL ) { // Set dialog title if ( jfi->xNode!=NULL && ( n = xmlGetChild( jfi->xNode , "title" )) != NULL && xmlGetText( n ) != NULL ) - SetWindowText( hwndDlg, xmlGetText( n ) ); + SetWindowText( hwndDlg, xmlGetText( n )); else if ( jfi->defTitle != NULL ) SetWindowText( hwndDlg, TranslateTS( jfi->defTitle )); // Set instruction field if ( jfi->xNode!=NULL && ( n = xmlGetChild( jfi->xNode , "instructions" )) != NULL && xmlGetText( n ) != NULL ) - JabberFormSetInstruction( hwndDlg, xmlGetText( n ) ); + JabberFormSetInstruction( hwndDlg, xmlGetText( n )); else { if ( jfi->xNode != NULL && ( n = xmlGetChild( jfi->xNode , "title" )) != NULL && xmlGetText( n ) != NULL ) - JabberFormSetInstruction( hwndDlg, xmlGetText( n ) ); + JabberFormSetInstruction( hwndDlg, xmlGetText( n )); else if ( jfi->defTitle != NULL ) JabberFormSetInstruction( hwndDlg, TranslateTS( jfi->defTitle )); } diff --git a/protocols/JabberG/jabber_ft.cpp b/protocols/JabberG/jabber_ft.cpp index 4f1450cf17..dda0a69455 100644 --- a/protocols/JabberG/jabber_ft.cpp +++ b/protocols/JabberG/jabber_ft.cpp @@ -333,7 +333,7 @@ void CJabberProto::FtHandleSiRequest( HXML iqNode ) break; if ( !lstrcmp( xmlGetName( optionNode ), _T("option"))) { - if (( n = xmlGetChild( optionNode , "value" )) != NULL && xmlGetText( n ) ) { + if (( n = xmlGetChild( optionNode , "value" )) != NULL && xmlGetText( n )) { if ( !_tcscmp( xmlGetText( n ), _T(JABBER_FEAT_BYTESTREAMS))) { ftType = FT_BYTESTREAM; break; @@ -347,7 +347,7 @@ void CJabberProto::FtHandleSiRequest( HXML iqNode ) break; if ( !lstrcmp( xmlGetName( optionNode ), _T("option"))) { - if (( n = xmlGetChild( optionNode , "value" )) != NULL && xmlGetText( n ) ) { + if (( n = xmlGetChild( optionNode , "value" )) != NULL && xmlGetText( n )) { if ( !_tcscmp( xmlGetText( n ), _T(JABBER_FEAT_IBB))) { ftType = FT_IBB; break; diff --git a/protocols/JabberG/jabber_groupchat.cpp b/protocols/JabberG/jabber_groupchat.cpp index de458a46e9..8fef909be5 100644 --- a/protocols/JabberG/jabber_groupchat.cpp +++ b/protocols/JabberG/jabber_groupchat.cpp @@ -331,7 +331,7 @@ void CJabberProto::GroupchatJoinRoom( const TCHAR* server, const TCHAR* room, co TCHAR lasteventdate[40]; mir_sntprintf(lasteventdate, SIZEOF(lasteventdate), _T("%04d-%02d-%02dT%02d:%02d:%02dZ"), time->tm_year+1900, time->tm_mon+1, time->tm_mday, time->tm_hour, time->tm_min, time->tm_sec); - x << XCHILD( _T("history") ) << XATTR( _T("since"), lasteventdate); + x << XCHILD( _T("history")) << XATTR( _T("since"), lasteventdate); } } @@ -562,7 +562,7 @@ void CJabberDlgGcJoin::OnInitDialog() { mir_sntprintf(jid, SIZEOF(jid), _T("%s@%s (%s)"), info.room, info.server, - info.nick ? info.nick : TranslateT("") ); + info.nick ? info.nick : TranslateT("")); SetDlgItemText(m_hwnd, IDC_RECENT1+i, jid); } else { @@ -1002,7 +1002,7 @@ void CJabberProto::GroupchatProcessPresence( HXML node ) char priority = 0; if (( priorityNode = xmlGetChild( node , "priority" )) != NULL && xmlGetText( priorityNode ) != NULL ) - priority = (char)_ttoi( xmlGetText( priorityNode ) ); + priority = (char)_ttoi( xmlGetText( priorityNode )); if (JABBER_RESOURCE_STATUS *oldRes = ListFindResource(LIST_CHATROOM, from)) if ((oldRes->status != status) || lstrcmp_null(oldRes->statusMessage, str)) @@ -1037,7 +1037,7 @@ void CJabberProto::GroupchatProcessPresence( HXML node ) else role = ROLE_NONE; } - if ( (role != ROLE_NONE) && (JabberGcGetStatus(r) != JabberGcGetStatus(affiliation, role)) ) { + if ( (role != ROLE_NONE) && (JabberGcGetStatus(r) != JabberGcGetStatus(affiliation, role))) { GcLogUpdateMemberStatus( item, resource, nick, NULL, GC_EVENT_REMOVESTATUS, NULL ); if (!newRes) newRes = GC_EVENT_ADDSTATUS; } @@ -1087,7 +1087,7 @@ void CJabberProto::GroupchatProcessPresence( HXML node ) if ( roomCreated || (( n = xmlGetChild( node , "created" ))!=NULL && ( str = xmlGetAttrValue( n, _T("xmlns")))!=NULL && - !_tcscmp( str, _T("http://jabber.org/protocol/muc#owner"))) ) { + !_tcscmp( str, _T("http://jabber.org/protocol/muc#owner")))) { // A new room just created by me // Request room config int iqId = SerialNext(); @@ -1309,7 +1309,7 @@ public: CSuper::OnInitDialog(); TCHAR buf[256]; - mir_sntprintf(buf, SIZEOF(buf), _T("%s\n%s"), m_info->roomJid, TranslateT("Incoming groupchat invitation.") ); + mir_sntprintf(buf, SIZEOF(buf), _T("%s\n%s"), m_info->roomJid, TranslateT("Incoming groupchat invitation.")); SetDlgItemText( m_hwnd, IDC_HEADERBAR, buf ); SetDlgItemText( m_hwnd, IDC_FROM, m_info->from ); diff --git a/protocols/JabberG/jabber_icolib.cpp b/protocols/JabberG/jabber_icolib.cpp index 9fab1d07e9..c85198a59c 100644 --- a/protocols/JabberG/jabber_icolib.cpp +++ b/protocols/JabberG/jabber_icolib.cpp @@ -267,7 +267,7 @@ void CJabberProto::IconsInit( void ) m_phIconLibItems = ( HANDLE* )mir_alloc( sizeof( HANDLE )*SIZEOF(iconList)); - mir_sntprintf( szRootSection, SIZEOF(szRootSection), _T("%s/%s/%s"), LPGENT("Protocols"), LPGENT("Jabber"), LPGENT("Accounts") ); + mir_sntprintf( szRootSection, SIZEOF(szRootSection), _T("%s/%s/%s"), LPGENT("Protocols"), LPGENT("Jabber"), LPGENT("Accounts")); for (i = 0; i < SIZEOF(iconList); i++ ) { TCHAR tmp[100]; @@ -578,7 +578,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR* jid, HANDLE hContact if ( m_lstTransports.getIndex( domain ) == -1 ) { if ( isAgent ) { - m_lstTransports.insert( mir_tstrdup(domain) ); + m_lstTransports.insert( mir_tstrdup(domain)); JSetByte( hContact, "IsTransport", 1 ); } } @@ -673,7 +673,7 @@ static void sttProcessIcons( int iAmount ) sid.pszDefaultFile = szFile; char szRootSection[100]; - mir_snprintf( szRootSection, SIZEOF(szRootSection), "%s/%s", LPGEN("Protocols"), LPGEN("Jabber") ); + mir_snprintf( szRootSection, SIZEOF(szRootSection), "%s/%s", LPGEN("Protocols"), LPGEN("Jabber")); for ( int i = 0; i < iAmount; i++ ) { char szSettingName[100], szSectionName[100]; diff --git a/protocols/JabberG/jabber_iq.cpp b/protocols/JabberG/jabber_iq.cpp index db2a014b50..4f5a0cd049 100644 --- a/protocols/JabberG/jabber_iq.cpp +++ b/protocols/JabberG/jabber_iq.cpp @@ -235,7 +235,7 @@ void CJabberIqManager::ExpireInfo( CJabberIqInfo* pInfo, void*) if (( pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT ) && ( pInfo->m_szFrom )) pInfo->m_hContact = ppro->HContactFromJID( pInfo->m_szFrom , 3); - ppro->Log( "Expiring iq id %d, sent to " TCHAR_STR_PARAM, pInfo->m_nIqId, pInfo->m_szReceiver ? pInfo->m_szReceiver : _T("server") ); + ppro->Log( "Expiring iq id %d, sent to " TCHAR_STR_PARAM, pInfo->m_nIqId, pInfo->m_szReceiver ? pInfo->m_szReceiver : _T("server")); pInfo->m_nIqType = JABBER_IQ_TYPE_FAIL; (ppro->*(pInfo->m_pHandler))( NULL, pInfo ); @@ -339,7 +339,7 @@ BOOL CJabberIqManager::HandleIqPermanent( HXML pNode ) if ( pInfo->m_nIqTypes & iqInfo.m_nIqType ) { HXML pFirstChild = xmlGetChild( pNode , 0 ); - if ( !pFirstChild || !xmlGetName( pFirstChild ) ) + if ( !pFirstChild || !xmlGetName( pFirstChild )) break; const TCHAR *szTagName = xmlGetName( pFirstChild ); diff --git a/protocols/JabberG/jabber_iq_handlers.cpp b/protocols/JabberG/jabber_iq_handlers.cpp index ca1a69ad44..eb54b8fc6d 100644 --- a/protocols/JabberG/jabber_iq_handlers.cpp +++ b/protocols/JabberG/jabber_iq_handlers.cpp @@ -90,7 +90,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE) osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - if ( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) ) + if ( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi))) return FALSE; // Call GetNativeSystemInfo if supported or GetSystemInfo otherwise. @@ -190,7 +190,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE) if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 ) { - if ( GetSystemMetrics(SM_SERVERR2) ) + if ( GetSystemMetrics(SM_SERVERR2)) StringCchCat(pszOS, BUFSIZE, TEXT( "Windows Server 2003 R2, ")); else if ( osvi.wSuiteMask==VER_SUITE_STORAGE_SERVER ) StringCchCat(pszOS, BUFSIZE, TEXT( "Windows Storage Server 2003")); @@ -268,7 +268,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE) if ( _tcslen(osvi.szCSDVersion) > 0 ) { - StringCchCat(pszOS, BUFSIZE, TEXT(" ") ); + StringCchCat(pszOS, BUFSIZE, TEXT(" ")); StringCchCat(pszOS, BUFSIZE, osvi.szCSDVersion); } @@ -288,7 +288,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE) BOOL CJabberProto::OnIqRequestVersion( HXML, CJabberIqInfo* pInfo ) { - if ( !pInfo->GetFrom() ) + if ( !pInfo->GetFrom()) return TRUE; if ( !m_options.AllowVersionRequests ) @@ -296,8 +296,8 @@ BOOL CJabberProto::OnIqRequestVersion( HXML, CJabberIqInfo* pInfo ) XmlNodeIq iq( _T("result"), pInfo ); HXML query = iq << XQUERY( _T(JABBER_FEAT_VERSION)); - query << XCHILD( _T("name"), _T("Miranda IM Jabber (Unicode)") ); - query << XCHILD( _T("version"), _T(__VERSION_STRING) ); + query << XCHILD( _T("name"), _T("Miranda IM Jabber (Unicode)")); + query << XCHILD( _T("version"), _T(__VERSION_STRING)); if ( m_options.ShowOSVersion ) { @@ -391,7 +391,7 @@ BOOL CJabberProto::OnIqProcessIqOldTime( HXML, CJabberIqInfo *pInfo ) dtime[ 24 ] = 0; XmlNodeIq iq( _T("result"), pInfo ); - HXML queryNode = iq << XQUERY( _T(JABBER_FEAT_ENTITY_TIME_OLD) ); + HXML queryNode = iq << XQUERY( _T(JABBER_FEAT_ENTITY_TIME_OLD)); queryNode << XCHILD( _T("utc"), stime ); LPCTSTR szTZName = tmi.getTzName( NULL ); if ( szTZName ) @@ -464,8 +464,8 @@ BOOL CJabberProto::OnRosterPushRequest( HXML, CJabberIqInfo *pInfo ) HXML queryNode = pInfo->GetChildNode(); // RFC 3921 #7.2 Business Rules - if ( pInfo->GetFrom() ) { - TCHAR* szFrom = JabberPrepareJid( pInfo->GetFrom() ); + if ( pInfo->GetFrom()) { + TCHAR* szFrom = JabberPrepareJid( pInfo->GetFrom()); if ( !szFrom ) return TRUE; @@ -475,10 +475,10 @@ BOOL CJabberProto::OnRosterPushRequest( HXML, CJabberIqInfo *pInfo ) return TRUE; } - TCHAR* pDelimiter = _tcschr( szFrom, _T('/') ); + TCHAR* pDelimiter = _tcschr( szFrom, _T('/')); if ( pDelimiter ) *pDelimiter = _T('\0'); - pDelimiter = _tcschr( szTo, _T('/') ); + pDelimiter = _tcschr( szTo, _T('/')); if ( pDelimiter ) *pDelimiter = _T('\0'); BOOL bRetVal = _tcscmp( szFrom, szTo ) == 0; @@ -488,7 +488,7 @@ BOOL CJabberProto::OnRosterPushRequest( HXML, CJabberIqInfo *pInfo ) // invalid JID if ( !bRetVal ) { - Log( " attempt to hack via roster push from " TCHAR_STR_PARAM, pInfo->GetFrom() ); + Log( " attempt to hack via roster push from " TCHAR_STR_PARAM, pInfo->GetFrom()); return TRUE; } } @@ -586,7 +586,7 @@ BOOL CJabberProto::OnRosterPushRequest( HXML, CJabberIqInfo *pInfo ) BOOL CJabberProto::OnIqRequestOOB( HXML, CJabberIqInfo *pInfo ) { - if ( !pInfo->GetFrom() || !pInfo->GetHContact() ) + if ( !pInfo->GetFrom() || !pInfo->GetHContact()) return TRUE; HXML n = xmlGetChild( pInfo->GetChildNode(), "url" ); @@ -607,7 +607,7 @@ BOOL CJabberProto::OnIqRequestOOB( HXML, CJabberIqInfo *pInfo ) str = ( TCHAR* )xmlGetText( n ); // URL of the file to get filetransfer* ft = new filetransfer( this ); ft->std.totalFiles = 1; - ft->jid = mir_tstrdup( pInfo->GetFrom() ); + ft->jid = mir_tstrdup( pInfo->GetFrom()); ft->std.hContact = pInfo->GetHContact(); ft->type = FT_OOB; ft->httpHostName = NULL; @@ -628,8 +628,8 @@ BOOL CJabberProto::OnIqRequestOOB( HXML, CJabberIqInfo *pInfo ) ft->httpHostName = mir_t2a( text ); } } } - if ( pInfo->GetIdStr() ) - ft->iqId = mir_tstrdup( pInfo->GetIdStr() ); + if ( pInfo->GetIdStr()) + ft->iqId = mir_tstrdup( pInfo->GetIdStr()); if ( ft->httpHostName && ft->httpPath ) { TCHAR* desc = NULL; @@ -671,7 +671,7 @@ BOOL CJabberProto::OnIqRequestOOB( HXML, CJabberIqInfo *pInfo ) BOOL CJabberProto::OnHandleDiscoInfoRequest( HXML iqNode, CJabberIqInfo* pInfo ) { - if ( !pInfo->GetChildNode() ) + if ( !pInfo->GetChildNode()) return TRUE; const TCHAR* szNode = xmlGetAttrValue( pInfo->GetChildNode(), _T("node")); @@ -693,7 +693,7 @@ BOOL CJabberProto::OnHandleDiscoInfoRequest( HXML iqNode, CJabberIqInfo* pInfo ) BOOL CJabberProto::OnHandleDiscoItemsRequest( HXML iqNode, CJabberIqInfo* pInfo ) { - if ( !pInfo->GetChildNode() ) + if ( !pInfo->GetChildNode()) return TRUE; // ad-hoc commands check: @@ -737,7 +737,7 @@ BOOL CJabberProto::OnIqHttpAuth( HXML node, CJabberIqInfo* pInfo ) if ( !m_options.AcceptHttpAuth ) return TRUE; - if ( !node || !pInfo->GetChildNode() || !pInfo->GetFrom() || !pInfo->GetIdStr() ) + if ( !node || !pInfo->GetChildNode() || !pInfo->GetFrom() || !pInfo->GetIdStr()) return TRUE; HXML pConfirm = xmlGetChild( node , "confirm" ); @@ -756,7 +756,7 @@ BOOL CJabberProto::OnIqHttpAuth( HXML node, CJabberIqInfo* pInfo ) return TRUE; ZeroMemory( pParams, sizeof( CJabberHttpAuthParams )); pParams->m_nType = CJabberHttpAuthParams::IQ; - pParams->m_szFrom = mir_tstrdup( pInfo->GetFrom() ); + pParams->m_szFrom = mir_tstrdup( pInfo->GetFrom()); pParams->m_szId = mir_tstrdup( szId ); pParams->m_szMethod = mir_tstrdup( szMethod ); pParams->m_szUrl = mir_tstrdup( szUrl ); diff --git a/protocols/JabberG/jabber_iqid.cpp b/protocols/JabberG/jabber_iqid.cpp index 72ddcf6d4c..06939c21bf 100644 --- a/protocols/JabberG/jabber_iqid.cpp +++ b/protocols/JabberG/jabber_iqid.cpp @@ -43,7 +43,7 @@ void CJabberProto::OnIqResultServerDiscoInfo( HXML iqNode ) int i; if ( !_tcscmp( type, _T("result"))) { - HXML query = xmlGetChildByTag( iqNode, "query", "xmlns", _T(JABBER_FEAT_DISCO_INFO) ); + HXML query = xmlGetChildByTag( iqNode, "query", "xmlns", _T(JABBER_FEAT_DISCO_INFO)); if ( !query ) return; @@ -52,7 +52,7 @@ void CJabberProto::OnIqResultServerDiscoInfo( HXML iqNode ) const TCHAR *identityCategory = xmlGetAttrValue( identity, _T("category")); const TCHAR *identityType = xmlGetAttrValue( identity, _T("type")); const TCHAR *identityName = xmlGetAttrValue( identity, _T("name")); - if ( identityCategory && identityType && !_tcscmp( identityCategory, _T("pubsub") ) && !_tcscmp( identityType, _T("pep")) ) { + if ( identityCategory && identityType && !_tcscmp( identityCategory, _T("pubsub")) && !_tcscmp( identityType, _T("pep"))) { m_bPepSupported = TRUE; EnableMenuItems( TRUE ); @@ -92,7 +92,7 @@ void CJabberProto::OnIqResultNestedRosterGroups( HXML iqNode, CJabberIqInfo* pIn if ( iqNode && pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT ) { bPrivateStorageSupport = TRUE; - szGroupDelimeter = XPathFmt( iqNode, _T("query[@xmlns='%s']/roster[@xmlns='%s']"), _T(JABBER_FEAT_PRIVATE_STORAGE), _T( JABBER_FEAT_NESTED_ROSTER_GROUPS ) ); + szGroupDelimeter = XPathFmt( iqNode, _T("query[@xmlns='%s']/roster[@xmlns='%s']"), _T(JABBER_FEAT_PRIVATE_STORAGE), _T( JABBER_FEAT_NESTED_ROSTER_GROUPS )); if ( szGroupDelimeter && !szGroupDelimeter[0] ) szGroupDelimeter = NULL; // "" as roster delimeter is not supported :) } @@ -102,13 +102,13 @@ void CJabberProto::OnIqResultNestedRosterGroups( HXML iqNode, CJabberIqInfo* pIn return; // is our default delimiter? - if (( !szGroupDelimeter && bPrivateStorageSupport ) || ( szGroupDelimeter && _tcscmp( szGroupDelimeter, _T("\\") ))) + if (( !szGroupDelimeter && bPrivateStorageSupport ) || ( szGroupDelimeter && _tcscmp( szGroupDelimeter, _T("\\")))) m_ThreadInfo->send( XmlNodeIq( _T("set"), SerialNext()) << XQUERY( _T(JABBER_FEAT_PRIVATE_STORAGE)) << XCHILD( _T("roster"), _T("\\")) << XATTR( _T("xmlns"), _T(JABBER_FEAT_NESTED_ROSTER_GROUPS))); // roster request - TCHAR *szUserData = mir_tstrdup( szGroupDelimeter ? szGroupDelimeter : _T("\\") ); + TCHAR *szUserData = mir_tstrdup( szGroupDelimeter ? szGroupDelimeter : _T("\\")); m_ThreadInfo->send( XmlNodeIq( m_iqManager.AddHandler( &CJabberProto::OnIqResultGetRoster, JABBER_IQ_TYPE_GET, NULL, 0, -1, (void *)szUserData )) << XCHILDNS( _T("query"), _T(JABBER_FEAT_IQ_ROSTER))); @@ -418,7 +418,7 @@ void CJabberProto::OnIqResultGetRoster( HXML iqNode, CJabberIqInfo* pInfo ) if ( _tcschr( jid, '@' ) == NULL ) bIsTransport = TRUE; - if (( name = xmlGetAttrValue( itemNode, _T("name") )) != NULL ) + if (( name = xmlGetAttrValue( itemNode, _T("name"))) != NULL ) nick = mir_tstrdup( name ); else nick = JabberNickFromJID( jid ); @@ -815,13 +815,13 @@ void CJabberProto::OnIqResultGetVcard( HXML iqNode ) if ( !_tcscmp( xmlGetName( n ), _T("FN"))) { if ( xmlGetText( n ) != NULL ) { hasFn = TRUE; - JSetStringT( hContact, "FullName", xmlGetText( n ) ); + JSetStringT( hContact, "FullName", xmlGetText( n )); } } else if ( !lstrcmp( xmlGetName( n ), _T("NICKNAME"))) { if ( xmlGetText( n ) != NULL ) { hasNick = TRUE; - JSetStringT( hContact, "Nick", xmlGetText( n ) ); + JSetStringT( hContact, "Nick", xmlGetText( n )); } } else if ( !lstrcmp( xmlGetName( n ), _T("N"))) { @@ -829,15 +829,15 @@ void CJabberProto::OnIqResultGetVcard( HXML iqNode ) if ( !hasGiven && !hasFamily && !hasMiddle ) { if (( m=xmlGetChild( n , "GIVEN" )) != NULL && xmlGetText( m )!=NULL ) { hasGiven = TRUE; - JSetStringT( hContact, "FirstName", xmlGetText( m ) ); + JSetStringT( hContact, "FirstName", xmlGetText( m )); } if (( m=xmlGetChild( n , "FAMILY" )) != NULL && xmlGetText( m )!=NULL ) { hasFamily = TRUE; - JSetStringT( hContact, "LastName", xmlGetText( m ) ); + JSetStringT( hContact, "LastName", xmlGetText( m )); } if (( m=xmlGetChild( n , "MIDDLE" )) != NULL && xmlGetText( m ) != NULL ) { hasMiddle = TRUE; - JSetStringT( hContact, "MiddleName", xmlGetText( m ) ); + JSetStringT( hContact, "MiddleName", xmlGetText( m )); } } } else if ( !lstrcmp( xmlGetName( n ), _T("EMAIL"))) { @@ -853,7 +853,7 @@ void CJabberProto::OnIqResultGetVcard( HXML iqNode ) sprintf( text, "e-mail%d", nEmail-1 ); } else sprintf( text, "e-mail%d", nEmail ); - JSetStringT( hContact, text, xmlGetText( m ) ); + JSetStringT( hContact, text, xmlGetText( m )); if ( hContact == NULL ) { sprintf( text, "e-mailFlag%d", nEmail ); @@ -888,7 +888,7 @@ void CJabberProto::OnIqResultGetVcard( HXML iqNode ) } else { hasBday = TRUE; - JSetStringT( NULL, "BirthDate", xmlGetText( n ) ); + JSetStringT( NULL, "BirthDate", xmlGetText( n )); } } } else if ( !lstrcmp( xmlGetName( n ), _T("GENDER"))) { @@ -902,7 +902,7 @@ void CJabberProto::OnIqResultGetVcard( HXML iqNode ) } else { hasGender = TRUE; - JSetStringT( NULL, "GenderString", xmlGetText( n ) ); + JSetStringT( NULL, "GenderString", xmlGetText( n )); } } } else if ( !lstrcmp( xmlGetName( n ), _T("ADR"))) { @@ -913,40 +913,40 @@ void CJabberProto::OnIqResultGetVcard( HXML iqNode ) hasHomeStreet = TRUE; if ( hContact != NULL ) { if (( o=xmlGetChild( n , "EXTADR" )) != NULL && xmlGetText( o ) != NULL ) - mir_sntprintf( text, SIZEOF( text ), _T("%s\r\n%s"), xmlGetText( m ), xmlGetText( o ) ); + mir_sntprintf( text, SIZEOF( text ), _T("%s\r\n%s"), xmlGetText( m ), xmlGetText( o )); else if (( o=xmlGetChild( n , "EXTADD" ))!=NULL && xmlGetText( o )!=NULL ) - mir_sntprintf( text, SIZEOF( text ), _T("%s\r\n%s"), xmlGetText( m ), xmlGetText( o ) ); + mir_sntprintf( text, SIZEOF( text ), _T("%s\r\n%s"), xmlGetText( m ), xmlGetText( o )); else _tcsncpy( text, xmlGetText( m ), SIZEOF( text )); text[SIZEOF(text)-1] = '\0'; JSetStringT( hContact, "Street", text ); } else { - JSetStringT( hContact, "Street", xmlGetText( m ) ); + JSetStringT( hContact, "Street", xmlGetText( m )); if (( m=xmlGetChild( n , "EXTADR" )) == NULL ) m = xmlGetChild( n , "EXTADD" ); if ( m!=NULL && xmlGetText( m )!=NULL ) { hasHomeStreet2 = TRUE; - JSetStringT( hContact, "Street2", xmlGetText( m ) ); + JSetStringT( hContact, "Street2", xmlGetText( m )); } } } if (( m=xmlGetChild( n , "LOCALITY" ))!=NULL && xmlGetText( m )!=NULL ) { hasHomeLocality = TRUE; - JSetStringT( hContact, "City", xmlGetText( m ) ); + JSetStringT( hContact, "City", xmlGetText( m )); } if (( m=xmlGetChild( n , "REGION" ))!=NULL && xmlGetText( m )!=NULL ) { hasHomeRegion = TRUE; - JSetStringT( hContact, "State", xmlGetText( m ) ); + JSetStringT( hContact, "State", xmlGetText( m )); } if (( m=xmlGetChild( n , "PCODE" ))!=NULL && xmlGetText( m )!=NULL ) { hasHomePcode = TRUE; - JSetStringT( hContact, "ZIP", xmlGetText( m ) ); + JSetStringT( hContact, "ZIP", xmlGetText( m )); } if (( m=xmlGetChild( n , "CTRY" ))==NULL || xmlGetText( m )==NULL ) // Some bad client use instead of m = xmlGetChild( n , "COUNTRY" ); if ( m!=NULL && xmlGetText( m )!=NULL ) { hasHomeCtry = TRUE; - JSetStringT( hContact, "Country", xmlGetText( m ) ); + JSetStringT( hContact, "Country", xmlGetText( m )); } } if ( !hasWork && xmlGetChild( n , "WORK" )!=NULL ) { @@ -956,40 +956,40 @@ void CJabberProto::OnIqResultGetVcard( HXML iqNode ) hasWorkStreet = TRUE; if ( hContact != NULL ) { if (( o=xmlGetChild( n , "EXTADR" ))!=NULL && xmlGetText( o )!=NULL ) - mir_sntprintf( text, SIZEOF( text ), _T("%s\r\n%s"), xmlGetText( m ), xmlGetText( o ) ); + mir_sntprintf( text, SIZEOF( text ), _T("%s\r\n%s"), xmlGetText( m ), xmlGetText( o )); else if (( o=xmlGetChild( n , "EXTADD" ))!=NULL && xmlGetText( o )!=NULL ) - mir_sntprintf( text, SIZEOF( text ), _T("%s\r\n%s"), xmlGetText( m ), xmlGetText( o ) ); + mir_sntprintf( text, SIZEOF( text ), _T("%s\r\n%s"), xmlGetText( m ), xmlGetText( o )); else _tcsncpy( text, xmlGetText( m ), SIZEOF( text )); text[SIZEOF( text )-1] = '\0'; JSetStringT( hContact, "CompanyStreet", text ); } else { - JSetStringT( hContact, "CompanyStreet", xmlGetText( m ) ); + JSetStringT( hContact, "CompanyStreet", xmlGetText( m )); if (( m=xmlGetChild( n , "EXTADR" )) == NULL ) m = xmlGetChild( n , "EXTADD" ); if ( m!=NULL && xmlGetText( m )!=NULL ) { hasWorkStreet2 = TRUE; - JSetStringT( hContact, "CompanyStreet2", xmlGetText( m ) ); + JSetStringT( hContact, "CompanyStreet2", xmlGetText( m )); } } } if (( m=xmlGetChild( n , "LOCALITY" ))!=NULL && xmlGetText( m )!=NULL ) { hasWorkLocality = TRUE; - JSetStringT( hContact, "CompanyCity", xmlGetText( m ) ); + JSetStringT( hContact, "CompanyCity", xmlGetText( m )); } if (( m=xmlGetChild( n , "REGION" ))!=NULL && xmlGetText( m )!=NULL ) { hasWorkRegion = TRUE; - JSetStringT( hContact, "CompanyState", xmlGetText( m ) ); + JSetStringT( hContact, "CompanyState", xmlGetText( m )); } if (( m=xmlGetChild( n , "PCODE" ))!=NULL && xmlGetText( m )!=NULL ) { hasWorkPcode = TRUE; - JSetStringT( hContact, "CompanyZIP", xmlGetText( m ) ); + JSetStringT( hContact, "CompanyZIP", xmlGetText( m )); } if (( m=xmlGetChild( n , "CTRY" ))==NULL || xmlGetText( m )==NULL ) // Some bad client use instead of m = xmlGetChild( n , "COUNTRY" ); if ( m!=NULL && xmlGetText( m )!=NULL ) { hasWorkCtry = TRUE; - JSetStringT( hContact, "CompanyCountry", xmlGetText( m ) ); + JSetStringT( hContact, "CompanyCountry", xmlGetText( m )); } } } else if ( !lstrcmp( xmlGetName( n ), _T("TEL"))) { @@ -998,11 +998,11 @@ void CJabberProto::OnIqResultGetVcard( HXML iqNode ) if ( hContact != NULL ) { if ( !hasFax && xmlGetChild( n , "FAX" )!=NULL ) { hasFax = TRUE; - JSetStringT( hContact, "Fax", xmlGetText( m ) ); + JSetStringT( hContact, "Fax", xmlGetText( m )); } if ( !hasCell && xmlGetChild( n , "CELL" )!=NULL ) { hasCell = TRUE; - JSetStringT( hContact, "Cellular", xmlGetText( m ) ); + JSetStringT( hContact, "Cellular", xmlGetText( m )); } if ( !hasPhone && ( xmlGetChild( n , "HOME" )!=NULL || @@ -1016,15 +1016,15 @@ void CJabberProto::OnIqResultGetVcard( HXML iqNode ) xmlGetChild( n , "BBS" )==NULL && xmlGetChild( n , "MODEM" )==NULL && xmlGetChild( n , "ISDN" )==NULL && - xmlGetChild( n , "PCS" )==NULL )) ) { + xmlGetChild( n , "PCS" )==NULL ))) { hasPhone = TRUE; - JSetStringT( hContact, "Phone", xmlGetText( m ) ); + JSetStringT( hContact, "Phone", xmlGetText( m )); } } else { char text[ 100 ]; sprintf( text, "Phone%d", nPhone ); - JSetStringT( NULL, text, xmlGetText( m ) ); + JSetStringT( NULL, text, xmlGetText( m )); sprintf( text, "PhoneFlag%d", nPhone ); int nFlag = 0; @@ -1048,36 +1048,36 @@ void CJabberProto::OnIqResultGetVcard( HXML iqNode ) // Homepage if ( !hasUrl && xmlGetText( n )!=NULL ) { hasUrl = TRUE; - JSetStringT( hContact, "Homepage", xmlGetText( n ) ); + JSetStringT( hContact, "Homepage", xmlGetText( n )); } } else if ( !lstrcmp( xmlGetName( n ), _T("ORG"))) { if ( !hasOrgname && !hasOrgunit ) { if (( m=xmlGetChild( n ,"ORGNAME" ))!=NULL && xmlGetText( m )!=NULL ) { hasOrgname = TRUE; - JSetStringT( hContact, "Company", xmlGetText( m ) ); + JSetStringT( hContact, "Company", xmlGetText( m )); } if (( m=xmlGetChild( n ,"ORGUNIT" ))!=NULL && xmlGetText( m )!=NULL ) { // The real vCard can have multiple but we will only display the first one hasOrgunit = TRUE; - JSetStringT( hContact, "CompanyDepartment", xmlGetText( m ) ); + JSetStringT( hContact, "CompanyDepartment", xmlGetText( m )); } } } else if ( !lstrcmp( xmlGetName( n ), _T("ROLE"))) { if ( !hasRole && xmlGetText( n )!=NULL ) { hasRole = TRUE; - JSetStringT( hContact, "Role", xmlGetText( n ) ); + JSetStringT( hContact, "Role", xmlGetText( n )); } } else if ( !lstrcmp( xmlGetName( n ), _T("TITLE"))) { if ( !hasTitle && xmlGetText( n )!=NULL ) { hasTitle = TRUE; - JSetStringT( hContact, "CompanyPosition", xmlGetText( n ) ); + JSetStringT( hContact, "CompanyPosition", xmlGetText( n )); } } else if ( !lstrcmp( xmlGetName( n ), _T("DESC"))) { if ( !hasDesc && xmlGetText( n )!=NULL ) { hasDesc = TRUE; - TCHAR* szMemo = JabberUnixToDosT( xmlGetText( n ) ); + TCHAR* szMemo = JabberUnixToDosT( xmlGetText( n )); JSetStringT( hContact, "About", szMemo ); mir_free( szMemo ); } @@ -1223,7 +1223,7 @@ void CJabberProto::OnIqResultGetVcard( HXML iqNode ) void CJabberProto::OnIqResultSetVcard( HXML iqNode ) { Log( " iqIdSetVcard" ); - if ( !xmlGetAttrValue( iqNode, _T("type") )) + if ( !xmlGetAttrValue( iqNode, _T("type"))) return; WindowNotify(WM_JABBER_REFRESH_VCARD); @@ -1393,7 +1393,7 @@ void CJabberProto::OnIqResultGetVCardAvatar( HXML iqNode ) if ( xmlGetChildCount( vCard ) == 0 ) { JDeleteSetting( hContact, "AvatarHash" ); DBVARIANT dbv = {0}; - if ( !JGetStringT( hContact, "AvatarSaved", &dbv ) ) { + if ( !JGetStringT( hContact, "AvatarSaved", &dbv )) { JFreeVariant( &dbv ); JDeleteSetting( hContact, "AvatarSaved" ); JSendBroadcast( hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL ); @@ -1427,7 +1427,7 @@ void CJabberProto::OnIqResultGetClientAvatar( HXML iqNode ) return; HXML n = NULL; - if (( type = xmlGetAttrValue( iqNode, _T("type"))) != NULL && !_tcscmp( type, _T("result")) ) { + if (( type = xmlGetAttrValue( iqNode, _T("type"))) != NULL && !_tcscmp( type, _T("result"))) { HXML queryNode = xmlGetChild( iqNode , "query" ); if ( queryNode != NULL ) { const TCHAR* xmlns = xmlGetAttrValue( queryNode, _T("xmlns")); @@ -1475,11 +1475,11 @@ void CJabberProto::OnIqResultGetServerAvatar( HXML iqNode ) return; HXML n = NULL; - if (( type = xmlGetAttrValue( iqNode, _T("type"))) != NULL && !_tcscmp( type, _T("result")) ) { + if (( type = xmlGetAttrValue( iqNode, _T("type"))) != NULL && !_tcscmp( type, _T("result"))) { HXML queryNode = xmlGetChild( iqNode , "query" ); if ( queryNode != NULL ) { const TCHAR* xmlns = xmlGetAttrValue( queryNode, _T("xmlns")); - if ( !lstrcmp( xmlns, _T(JABBER_FEAT_SERVER_AVATAR)) ) { + if ( !lstrcmp( xmlns, _T(JABBER_FEAT_SERVER_AVATAR))) { n = xmlGetChild( queryNode , "data" ); } } @@ -1553,7 +1553,7 @@ LBL_ErrFormat: sprintf( buffer+( i<<1 ), "%02x", digest[i] ); GetAvatarFileName( hContact, tszFileName, SIZEOF(tszFileName)); - _tcsncpy( AI.filename, tszFileName, SIZEOF(AI.filename) ); + _tcsncpy( AI.filename, tszFileName, SIZEOF(AI.filename)); FILE* out = _tfopen( tszFileName, _T("wb")); if ( out != NULL ) { @@ -1593,7 +1593,7 @@ void CJabberProto::OnIqResultDiscoBookmarks( HXML iqNode ) HXML itemNode; for ( int i = 0; itemNode = xmlGetChild( storageNode, i ); i++ ) { if ( name = xmlGetName( itemNode)) { - if ( !_tcscmp( name, _T("conference") ) && (jid = xmlGetAttrValue( itemNode, _T("jid") ))) { + if ( !_tcscmp( name, _T("conference")) && (jid = xmlGetAttrValue( itemNode, _T("jid")))) { JABBER_LIST_ITEM* item = ListAdd( LIST_BOOKMARK, jid ); item->name = mir_tstrdup( xmlGetAttrValue( itemNode, _T("name"))); item->type = mir_tstrdup( _T( "conference" )); @@ -1609,7 +1609,7 @@ void CJabberProto::OnIqResultDiscoBookmarks( HXML iqNode ) JABBER_LIST_ITEM* item = ListAdd( LIST_BOOKMARK, jid ); item->bUseResource = TRUE; item->name = mir_tstrdup( xmlGetAttrValue( itemNode, _T("name"))); - item->type = mir_tstrdup( _T("url") ); + item->type = mir_tstrdup( _T("url")); } } } diff --git a/protocols/JabberG/jabber_list.cpp b/protocols/JabberG/jabber_list.cpp index 2397e0bd73..155f9e2b60 100644 --- a/protocols/JabberG/jabber_list.cpp +++ b/protocols/JabberG/jabber_list.cpp @@ -147,7 +147,7 @@ JABBER_LIST_ITEM *CJabberProto::ListAdd( JABBER_LIST list, const TCHAR* jid ) if ( !bUseResource && list== LIST_ROSTER ) { //if it is a chat room keep resource and made it resource sensitive - if ( ChatRoomHContactFromJID( s ) ) + if ( ChatRoomHContactFromJID( s )) { if (q != NULL) *q='/'; bUseResource=TRUE; @@ -192,7 +192,7 @@ void CJabberProto::ListRemoveList( JABBER_LIST list ) void CJabberProto::ListRemoveByIndex( int index ) { EnterCriticalSection( &m_csLists ); - if ( index >= 0 && index < m_lstRoster.getCount() ) { + if ( index >= 0 && index < m_lstRoster.getCount()) { JabberListFreeItemInternal( m_lstRoster[index] ); m_lstRoster.remove( index ); } @@ -457,7 +457,7 @@ JABBER_LIST_ITEM *CJabberProto::ListGetItemPtr( JABBER_LIST list, const TCHAR* j JABBER_LIST_ITEM *CJabberProto::ListGetItemPtrFromIndex( int index ) { EnterCriticalSection( &m_csLists ); - if ( index >= 0 && index < m_lstRoster.getCount() ) { + if ( index >= 0 && index < m_lstRoster.getCount()) { LeaveCriticalSection( &m_csLists ); return m_lstRoster[index]; } diff --git a/protocols/JabberG/jabber_menu.cpp b/protocols/JabberG/jabber_menu.cpp index e544102dec..b489a793d8 100644 --- a/protocols/JabberG/jabber_menu.cpp +++ b/protocols/JabberG/jabber_menu.cpp @@ -459,7 +459,7 @@ int CJabberProto::OnPrebuildContactMenu( WPARAM wParam, LPARAM ) int nMenuResourceItemsNew = m_nMenuResourceItems; if ( m_nMenuResourceItems < item->resourceCount ) { - m_phMenuResourceItems = (HANDLE *)mir_realloc( m_phMenuResourceItems, item->resourceCount * sizeof(HANDLE) ); + m_phMenuResourceItems = (HANDLE *)mir_realloc( m_phMenuResourceItems, item->resourceCount * sizeof(HANDLE)); nMenuResourceItemsNew = item->resourceCount; } @@ -553,11 +553,11 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd( WPARAM wParam, LPARAM ) if ( ListGetItemPtr( LIST_ROSTER, roomID ) == NULL ) { TCHAR *nick = 0; TCHAR *group = 0; - if ( !DBGetContactSettingTString( ( HANDLE ) wParam, "CList", "Group", &dbv ) ) { + if ( !DBGetContactSettingTString( ( HANDLE ) wParam, "CList", "Group", &dbv )) { group = mir_tstrdup(dbv.ptszVal); JFreeVariant( &dbv ); } - if ( !JGetStringT( ( HANDLE ) wParam, "Nick", &dbv ) ) { + if ( !JGetStringT( ( HANDLE ) wParam, "Nick", &dbv )) { nick = mir_tstrdup(dbv.ptszVal); JFreeVariant( &dbv ); } @@ -572,7 +572,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd( WPARAM wParam, LPARAM ) ZeroMemory( item, sizeof( JABBER_LIST_ITEM )); item->jid = mir_tstrdup(roomID); item->name = mir_tstrdup(nick); - if ( !JGetStringT( ( HANDLE ) wParam, "MyNick", &dbv ) ) { + if ( !JGetStringT( ( HANDLE ) wParam, "MyNick", &dbv )) { item->nick = mir_tstrdup(dbv.ptszVal); JFreeVariant( &dbv ); } @@ -675,7 +675,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd( WPARAM wParam, LPARAM ) JFreeVariant( &dbv ); if ( ListGetItemPtr( LIST_BOOKMARK, roomID ) == NULL ) { TCHAR *nick = 0; - if ( !JGetStringT( ( HANDLE ) wParam, "Nick", &dbv ) ) { + if ( !JGetStringT( ( HANDLE ) wParam, "Nick", &dbv )) { nick = mir_tstrdup(dbv.ptszVal); JFreeVariant( &dbv ); } @@ -686,7 +686,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd( WPARAM wParam, LPARAM ) item->jid = mir_tstrdup(roomID); item->name = ( TCHAR* )JCallService( MS_CLIST_GETCONTACTDISPLAYNAME, wParam, GCDNF_TCHAR ); item->type = _T("conference"); - if ( !JGetStringT(( HANDLE ) wParam, "MyNick", &dbv ) ) { + if ( !JGetStringT(( HANDLE ) wParam, "MyNick", &dbv )) { item->nick = mir_tstrdup(dbv.ptszVal); JFreeVariant( &dbv ); } diff --git a/protocols/JabberG/jabber_message_handlers.cpp b/protocols/JabberG/jabber_message_handlers.cpp index 2339a8157c..d17e2b131d 100644 --- a/protocols/JabberG/jabber_message_handlers.cpp +++ b/protocols/JabberG/jabber_message_handlers.cpp @@ -33,11 +33,11 @@ BOOL CJabberProto::OnMessageError( HXML node, ThreadData *pThreadData, CJabberMe { // we check if is message delivery failure int id = JabberGetPacketID( node ); - JABBER_LIST_ITEM* item = ListGetItemPtr( LIST_ROSTER, pInfo->GetFrom() ); + JABBER_LIST_ITEM* item = ListGetItemPtr( LIST_ROSTER, pInfo->GetFrom()); if ( item == NULL ) - item = ListGetItemPtr( LIST_CHATROOM, pInfo->GetFrom() ); + item = ListGetItemPtr( LIST_CHATROOM, pInfo->GetFrom()); if ( item != NULL ) { // yes, it is - TCHAR *szErrText = JabberErrorMsg( pInfo->GetChildNode() ); + TCHAR *szErrText = JabberErrorMsg( pInfo->GetChildNode()); if ( id != -1 ) { char *errText = mir_t2a(szErrText); JSendBroadcast( pInfo->GetHContact(), ACKTYPE_MESSAGE, ACKRESULT_FAILED, ( HANDLE ) id, (LPARAM)errText ); @@ -62,8 +62,8 @@ BOOL CJabberProto::OnMessageIbb( HXML node, ThreadData *pThreadData, CJabberMess BOOL bOk = FALSE; const TCHAR *sid = xmlGetAttrValue( pInfo->GetChildNode(), _T("sid")); const TCHAR *seq = xmlGetAttrValue( pInfo->GetChildNode(), _T("seq")); - if ( sid && seq && xmlGetText( pInfo->GetChildNode() ) ) { - bOk = OnIbbRecvdData( xmlGetText( pInfo->GetChildNode() ), sid, seq ); + if ( sid && seq && xmlGetText( pInfo->GetChildNode()) ) { + bOk = OnIbbRecvdData( xmlGetText( pInfo->GetChildNode()), sid, seq ); } return TRUE; } @@ -76,7 +76,7 @@ BOOL CJabberProto::OnMessagePubsubEvent( HXML node, ThreadData *pThreadData, CJa BOOL CJabberProto::OnMessageGroupchat( HXML node, ThreadData *pThreadData, CJabberMessageInfo* pInfo ) { - JABBER_LIST_ITEM *chatItem = ListGetItemPtr( LIST_CHATROOM, pInfo->GetFrom() ); + JABBER_LIST_ITEM *chatItem = ListGetItemPtr( LIST_CHATROOM, pInfo->GetFrom()); if ( chatItem ) { // process GC message GroupchatProcessMessage( node ); diff --git a/protocols/JabberG/jabber_message_manager.cpp b/protocols/JabberG/jabber_message_manager.cpp index 6a12f42086..b27c59e171 100644 --- a/protocols/JabberG/jabber_message_manager.cpp +++ b/protocols/JabberG/jabber_message_manager.cpp @@ -31,9 +31,9 @@ Last change by : $Author: dchervov $ BOOL CJabberMessageManager::FillPermanentHandlers() { - AddPermanentHandler( &CJabberProto::OnMessageError, JABBER_MESSAGE_TYPE_ERROR, JABBER_MESSAGE_PARSE_FROM | JABBER_MESSAGE_PARSE_HCONTACT, NULL, FALSE, _T("error") ); - AddPermanentHandler( &CJabberProto::OnMessageIbb, 0, 0, _T(JABBER_FEAT_IBB), FALSE, _T("data") ); - AddPermanentHandler( &CJabberProto::OnMessagePubsubEvent, 0, 0, _T(JABBER_FEAT_PUBSUB_EVENT), FALSE, _T("event") ); + AddPermanentHandler( &CJabberProto::OnMessageError, JABBER_MESSAGE_TYPE_ERROR, JABBER_MESSAGE_PARSE_FROM | JABBER_MESSAGE_PARSE_HCONTACT, NULL, FALSE, _T("error")); + AddPermanentHandler( &CJabberProto::OnMessageIbb, 0, 0, _T(JABBER_FEAT_IBB), FALSE, _T("data")); + AddPermanentHandler( &CJabberProto::OnMessagePubsubEvent, 0, 0, _T(JABBER_FEAT_PUBSUB_EVENT), FALSE, _T("event")); AddPermanentHandler( &CJabberProto::OnMessageGroupchat, JABBER_MESSAGE_TYPE_GROUPCHAT, JABBER_MESSAGE_PARSE_FROM, NULL, FALSE, NULL ); return TRUE; } diff --git a/protocols/JabberG/jabber_misc.cpp b/protocols/JabberG/jabber_misc.cpp index 972542ea71..09e5d8f0ee 100644 --- a/protocols/JabberG/jabber_misc.cpp +++ b/protocols/JabberG/jabber_misc.cpp @@ -66,8 +66,8 @@ int JabberCompareJids( const TCHAR* jid1, const TCHAR* jid2 ) // match only node@domain part TCHAR szTempJid1[ JABBER_MAX_JID_LEN ], szTempJid2[ JABBER_MAX_JID_LEN ]; return lstrcmpi( - JabberStripJid( jid1, szTempJid1, SIZEOF(szTempJid1) ), - JabberStripJid( jid2, szTempJid2, SIZEOF(szTempJid2)) ); + JabberStripJid( jid1, szTempJid1, SIZEOF(szTempJid1)), + JabberStripJid( jid2, szTempJid2, SIZEOF(szTempJid2))); } /////////////////////////////////////////////////////////////////////////////// @@ -510,7 +510,7 @@ void CJabberProto::FormatMirVer(JABBER_RESOURCE_STATUS *resource, TCHAR *buf, in // search through known software list for (i = 0; i < SIZEOF(sttCapsNodeToName_Map); ++i) - if ( _tcsstr( resource->szCapsNode, sttCapsNodeToName_Map[i].node ) ) + if ( _tcsstr( resource->szCapsNode, sttCapsNodeToName_Map[i].node )) { mir_sntprintf( buf, bufSize, _T("%s %s"), sttCapsNodeToName_Map[i].name, resource->szCapsVer ); break; @@ -554,7 +554,7 @@ void CJabberProto::UpdateMirVer(HANDLE hContact, JABBER_RESOURCE_STATUS *resourc if ( resource->resourceName ) mir_sntprintf( szFullJid, SIZEOF( szFullJid ), _T("%s/%s"), dbv.ptszVal, resource->resourceName ); else - lstrcpyn( szFullJid, dbv.ptszVal, SIZEOF(szFullJid) ); + lstrcpyn( szFullJid, dbv.ptszVal, SIZEOF(szFullJid)); JSetStringT( hContact, DBSETTING_DISPLAY_UID, szFullJid ); JFreeVariant( &dbv ); } diff --git a/protocols/JabberG/jabber_notes.cpp b/protocols/JabberG/jabber_notes.cpp index 03a274f0fb..4e40f25c7c 100644 --- a/protocols/JabberG/jabber_notes.cpp +++ b/protocols/JabberG/jabber_notes.cpp @@ -777,7 +777,7 @@ void CJabberProto::ProcessOutgoingNote(CNoteItem *pNote, bool ok) int nMsgId = SerialNext(); XmlNode m(_T("message")); - m << XATTR(_T("type"), _T("chat")) << XATTR( _T("to"), pNote->GetFrom() ) << XATTRID( nMsgId ); + m << XATTR(_T("type"), _T("chat")) << XATTR( _T("to"), pNote->GetFrom()) << XATTRID( nMsgId ); m << XCHILD(_T("body"), buf); HXML hXmlItem = m << XCHILDNS(_T("x"), _T(JABBER_FEAT_MIRANDA_NOTES)) << XCHILD(_T("note")); hXmlItem << XATTR(_T("tags"), pNote->GetTagsStr()); diff --git a/protocols/JabberG/jabber_opt.cpp b/protocols/JabberG/jabber_opt.cpp index f4e070271a..53feb71763 100644 --- a/protocols/JabberG/jabber_opt.cpp +++ b/protocols/JabberG/jabber_opt.cpp @@ -783,7 +783,7 @@ private: TCHAR* buf = mir_a2t( result->pData ); XmlNode node( buf, NULL, NULL ); if ( node ) { - HXML queryNode = xmlGetChild( node, _T("query") ); + HXML queryNode = xmlGetChild( node, _T("query")); SendMessage(hwnd, WM_JABBER_REFRESH, 0, (LPARAM)queryNode); bIsError = false; } @@ -1011,7 +1011,7 @@ static void _RosterListClear(HWND hwndDlg) HWND hList=GetDlgItem(hwndDlg, IDC_ROSTER); if (!hList) return; ListView_DeleteAllItems(hList); - while ( ListView_DeleteColumn( hList, 0) ); + while ( ListView_DeleteColumn( hList, 0)); LV_COLUMN column={0}; column.mask=LVCF_TEXT; @@ -1156,11 +1156,11 @@ void CJabberProto::_RosterHandleGetRequest( HXML node ) BOOL bPushed = itemRoster ? TRUE : FALSE; if ( !bPushed ) { const TCHAR *rosterName = xmlGetAttrValue( itemRoster, _T("name")); - if ( (rosterName!=NULL || name[0]!=_T('\0')) && lstrcmpi(rosterName,name) ) + if ( (rosterName!=NULL || name[0]!=_T('\0')) && lstrcmpi(rosterName,name)) bPushed=TRUE; if ( !bPushed ) { rosterName = xmlGetAttrValue( itemRoster, _T("subscription")); - if ((rosterName!=NULL || subscr[0]!=_T('\0')) && lstrcmpi(rosterName,subscr) ) + if ((rosterName!=NULL || subscr[0]!=_T('\0')) && lstrcmpi(rosterName,subscr)) bPushed=TRUE; } if ( !bPushed ) { @@ -1168,7 +1168,7 @@ void CJabberProto::_RosterHandleGetRequest( HXML node ) const TCHAR* rosterGroup=NULL; if (groupNode != NULL) rosterGroup = xmlGetText( groupNode ); - if ((rosterGroup!=NULL || group[0]!=_T('\0')) && lstrcmpi(rosterGroup,group) ) + if ((rosterGroup!=NULL || group[0]!=_T('\0')) && lstrcmpi(rosterGroup,group)) bPushed=TRUE; } } @@ -1372,7 +1372,7 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg) int nBytesProcessed = 0; XmlNode node( newBuf, &nBytesProcessed, NULL ); if ( node ) { - HXML Workbook = xmlGetChild( node, _T("Workbook") ); + HXML Workbook = xmlGetChild( node, _T("Workbook")); if ( Workbook ) { HXML Worksheet = xmlGetChild( Workbook , "Worksheet"); if ( Worksheet ) { @@ -1450,7 +1450,7 @@ static BOOL CALLBACK _RosterNewListProc( HWND hList, UINT msg, WPARAM wParam, LP RECT rc; TCHAR buff[260]; ListView_GetSubItemRect(hList, lvhti.iItem, lvhti.iSubItem, LVIR_BOUNDS,&rc); - ListView_GetItemText(hList, lvhti.iItem, lvhti.iSubItem, buff, SIZEOF(buff) ); + ListView_GetItemText(hList, lvhti.iItem, lvhti.iSubItem, buff, SIZEOF(buff)); HWND hEditor=CreateWindow(TEXT("EDIT"),buff,WS_CHILD|ES_AUTOHSCROLL,rc.left+3, rc.top+2, rc.right-rc.left-3, rc.bottom - rc.top-3,hList, NULL, hInst, NULL); SendMessage(hEditor,WM_SETFONT,(WPARAM)SendMessage(hList,WM_GETFONT,0,0),0); ShowWindow(hEditor,SW_SHOW); @@ -2269,7 +2269,7 @@ void CJabberDlgAccMgrUI::QueryServerListThread(void *arg) TCHAR* ptszText = mir_a2t( result->pData ); XmlNode node( ptszText, NULL, NULL ); if ( node ) { - HXML queryNode = xmlGetChild( node, _T("query") ); + HXML queryNode = xmlGetChild( node, _T("query")); if ( queryNode && IsWindow(hwnd)) { SendMessage(hwnd, WM_JABBER_REFRESH, 0, (LPARAM)queryNode); bIsError = false; diff --git a/protocols/JabberG/jabber_privacy.cpp b/protocols/JabberG/jabber_privacy.cpp index ada79a9c52..1b9196943b 100644 --- a/protocols/JabberG/jabber_privacy.cpp +++ b/protocols/JabberG/jabber_privacy.cpp @@ -195,15 +195,15 @@ void CJabberProto::OnIqResultPrivacyListActive( HXML iqNode, CJabberIqInfo* pInf m_privacyListManager.Lock(); if ( !_tcscmp( type, _T("result"))) { if ( pList ) { - m_privacyListManager.SetActiveListName( pList->GetListName() ); - mir_sntprintf( szText, SIZEOF( szText ), TranslateT("Privacy list %s set as active"), pList->GetListName() ); + m_privacyListManager.SetActiveListName( pList->GetListName()); + mir_sntprintf( szText, SIZEOF( szText ), TranslateT("Privacy list %s set as active"), pList->GetListName()); } else { m_privacyListManager.SetActiveListName( NULL ); mir_sntprintf( szText, SIZEOF( szText ), TranslateT("Active privacy list successfully declined")); } } - else mir_sntprintf( szText, SIZEOF( szText ), TranslateT("Error occurred while setting active list") ); + else mir_sntprintf( szText, SIZEOF( szText ), TranslateT("Error occurred while setting active list")); m_privacyListManager.Unlock(); @@ -235,8 +235,8 @@ void CJabberProto::OnIqResultPrivacyListDefault( HXML iqNode, CJabberIqInfo* pIn m_privacyListManager.Lock(); if ( !_tcscmp( type, _T("result"))) { if ( pList ) { - m_privacyListManager.SetDefaultListName( pList->GetListName() ); - mir_sntprintf( szText, SIZEOF( szText ), TranslateT("Privacy list %s set as default"), pList->GetListName() ); + m_privacyListManager.SetDefaultListName( pList->GetListName()); + mir_sntprintf( szText, SIZEOF( szText ), TranslateT("Privacy list %s set as default"), pList->GetListName()); } else { m_privacyListManager.SetDefaultListName( NULL ); @@ -244,7 +244,7 @@ void CJabberProto::OnIqResultPrivacyListDefault( HXML iqNode, CJabberIqInfo* pIn } } else { - mir_sntprintf( szText, SIZEOF( szText ), TranslateT("Error occurred while setting default list") ); + mir_sntprintf( szText, SIZEOF( szText ), TranslateT("Error occurred while setting default list")); } m_privacyListManager.Unlock(); @@ -415,7 +415,7 @@ public: SendDlgItemMessage( m_hwnd, IDC_CHECK_PRESENCE_OUT, BM_SETCHECK, BST_CHECKED, 0 ); if ( m_pRule->GetValue() && ( m_pRule->GetType() == Jid || m_pRule->GetType() == Group )) - SetDlgItemText( m_hwnd, IDC_EDIT_VALUE, m_pRule->GetValue() ); + SetDlgItemText( m_hwnd, IDC_EDIT_VALUE, m_pRule->GetValue()); } void cbType_OnChange(CCtrlData*) @@ -461,10 +461,10 @@ public: } // FIXME: ugly code :) - if ( m_pRule->GetValue() ) + if ( m_pRule->GetValue()) { - SetDlgItemText( m_hwnd, IDC_COMBO_VALUES, m_pRule->GetValue() ); - LRESULT nSelPos = SendDlgItemMessage( m_hwnd, IDC_COMBO_VALUES, CB_FINDSTRINGEXACT , -1, (LPARAM)m_pRule->GetValue() ); + SetDlgItemText( m_hwnd, IDC_COMBO_VALUES, m_pRule->GetValue()); + LRESULT nSelPos = SendDlgItemMessage( m_hwnd, IDC_COMBO_VALUES, CB_FINDSTRINGEXACT , -1, (LPARAM)m_pRule->GetValue()); if ( nSelPos != CB_ERR ) SendDlgItemMessage( m_hwnd, IDC_COMBO_VALUES, CB_SETCURSEL, nSelPos, 0 ); } @@ -483,7 +483,7 @@ public: for ( int i = 0; ; i++ ) { mir_snprintf(buf, 20, "%d", i); - if ( DBGetContactSettingTString(NULL, "CListGroups", buf, &dbv) ) + if ( DBGetContactSettingTString(NULL, "CListGroups", buf, &dbv)) break; SendDlgItemMessage( m_hwnd, IDC_COMBO_VALUES, CB_ADDSTRING, 0, (LPARAM)&dbv.ptszVal[1] ); @@ -491,10 +491,10 @@ public: } // FIXME: ugly code :) - if ( m_pRule->GetValue() ) + if ( m_pRule->GetValue()) { - SetDlgItemText( m_hwnd, IDC_COMBO_VALUES, m_pRule->GetValue() ); - LRESULT nSelPos = SendDlgItemMessage( m_hwnd, IDC_COMBO_VALUES, CB_FINDSTRINGEXACT , -1, (LPARAM)m_pRule->GetValue() ); + SetDlgItemText( m_hwnd, IDC_COMBO_VALUES, m_pRule->GetValue()); + LRESULT nSelPos = SendDlgItemMessage( m_hwnd, IDC_COMBO_VALUES, CB_FINDSTRINGEXACT , -1, (LPARAM)m_pRule->GetValue()); if ( nSelPos != CB_ERR ) SendDlgItemMessage( m_hwnd, IDC_COMBO_VALUES, CB_SETCURSEL, nSelPos, 0 ); } @@ -506,9 +506,9 @@ public: ShowWindow( GetDlgItem( m_hwnd, IDC_COMBO_VALUES ), SW_HIDE ); ShowWindow( GetDlgItem( m_hwnd, IDC_COMBO_VALUE ), SW_SHOW ); - if ( m_pRule->GetValue() ) + if ( m_pRule->GetValue()) { - LRESULT nSelected = SendDlgItemMessage( m_hwnd, IDC_COMBO_VALUE, CB_SELECTSTRING, -1, (LPARAM)TranslateTS(m_pRule->GetValue()) ); + LRESULT nSelected = SendDlgItemMessage( m_hwnd, IDC_COMBO_VALUE, CB_SELECTSTRING, -1, (LPARAM)TranslateTS(m_pRule->GetValue())); if ( nSelected == CB_ERR ) SendDlgItemMessage( m_hwnd, IDC_COMBO_VALUE, CB_SETCURSEL, 0, 0 ); } @@ -540,7 +540,7 @@ public: case Group: { TCHAR szText[ 512 ]; - GetDlgItemText( m_hwnd, IDC_COMBO_VALUES, szText, SIZEOF(szText) ); + GetDlgItemText( m_hwnd, IDC_COMBO_VALUES, szText, SIZEOF(szText)); m_pRule->SetValue( szText ); break; } @@ -933,8 +933,8 @@ void CJabberDlgPrivacyLists::OnProtoRefresh(WPARAM, LPARAM) m_proto->m_privacyListManager.Lock(); CPrivacyList* pList = m_proto->m_privacyListManager.GetFirstList(); while ( pList ) { - if ( !pList->IsDeleted() ) { - nItemId = SendDlgItemMessage( m_hwnd, IDC_LB_LISTS, LB_ADDSTRING, 0, (LPARAM)pList->GetListName() ); + if ( !pList->IsDeleted()) { + nItemId = SendDlgItemMessage( m_hwnd, IDC_LB_LISTS, LB_ADDSTRING, 0, (LPARAM)pList->GetListName()); SendDlgItemMessage( m_hwnd, IDC_LB_LISTS, LB_SETITEMDATA, nItemId, (LPARAM)pList ); } pList = pList->GetNext(); @@ -1042,15 +1042,15 @@ void CJabberDlgPrivacyLists::ShowAdvancedList(CPrivacyList *pList) while ( pRule ) { bListEmpty = FALSE; TCHAR szTypeValue[ 512 ]; - switch ( pRule->GetType() ) { + switch ( pRule->GetType()) { case Jid: - mir_sntprintf( szTypeValue, SIZEOF( szTypeValue ), _T( "If jabber id is '%s' then" ), pRule->GetValue() ); + mir_sntprintf( szTypeValue, SIZEOF( szTypeValue ), _T( "If jabber id is '%s' then" ), pRule->GetValue()); break; case Group: - mir_sntprintf( szTypeValue, SIZEOF( szTypeValue ), _T( "If group is '%s' then" ), pRule->GetValue() ); + mir_sntprintf( szTypeValue, SIZEOF( szTypeValue ), _T( "If group is '%s' then" ), pRule->GetValue()); break; case Subscription: - mir_sntprintf( szTypeValue, SIZEOF( szTypeValue ), _T( "If subscription is '%s' then" ), pRule->GetValue() ); + mir_sntprintf( szTypeValue, SIZEOF( szTypeValue ), _T( "If subscription is '%s' then" ), pRule->GetValue()); break; case Else: mir_sntprintf( szTypeValue, SIZEOF( szTypeValue ), _T( "Else")); @@ -1064,24 +1064,24 @@ void CJabberDlgPrivacyLists::ShowAdvancedList(CPrivacyList *pList) if ( !dwPackets ) dwPackets = JABBER_PL_RULE_TYPE_ALL; if ( dwPackets == JABBER_PL_RULE_TYPE_ALL ) - _tcscpy( szPackets, _T("all") ); + _tcscpy( szPackets, _T("all")); else { if ( dwPackets & JABBER_PL_RULE_TYPE_MESSAGE ) - _tcscat( szPackets, _T("messages") ); + _tcscat( szPackets, _T("messages")); if ( dwPackets & JABBER_PL_RULE_TYPE_PRESENCE_IN ) { if ( _tcslen( szPackets )) _tcscat( szPackets, _T(", ")); - _tcscat( szPackets, _T("presence-in") ); + _tcscat( szPackets, _T("presence-in")); } if ( dwPackets & JABBER_PL_RULE_TYPE_PRESENCE_OUT ) { if ( _tcslen( szPackets )) _tcscat( szPackets, _T(", ")); - _tcscat( szPackets, _T("presence-out") ); + _tcscat( szPackets, _T("presence-out")); } if ( dwPackets & JABBER_PL_RULE_TYPE_IQ ) { if ( _tcslen( szPackets )) _tcscat( szPackets, _T(", ")); - _tcscat( szPackets, _T("queries") ); + _tcscat( szPackets, _T("queries")); } } TCHAR szListItem[ 512 ]; @@ -1211,7 +1211,7 @@ void CJabberDlgPrivacyLists::DrawRulesList(LPDRAWITEMSTRUCT lpdis) rc.bottom -= (rc.bottom - rc.top) / 2; rc.left += 25; - switch ( pRule->GetType() ) + switch ( pRule->GetType()) { case Jid: { @@ -1694,7 +1694,7 @@ void CJabberDlgPrivacyLists::EnableEditorControls() EnableWindow( GetDlgItem( m_hwnd, IDC_APPLY ), bListsLoaded && bListsModified ); if (bListsLoaded) - SetStatusText( TranslateT("Ready.") ); + SetStatusText( TranslateT("Ready.")); } LRESULT CALLBACK CJabberDlgPrivacyLists::LstListsSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) @@ -1799,14 +1799,14 @@ void CJabberDlgPrivacyLists::btnActivate_OnClick(CCtrlButton *) { m_proto->m_privacyListManager.Lock(); CPrivacyList* pList = GetSelectedList(m_hwnd); - if ( pList && pList->IsModified() ) { + if ( pList && pList->IsModified()) { m_proto->m_privacyListManager.Unlock(); MessageBox( m_hwnd, TranslateT("Please save list before activating"), TranslateT("First, save the list"), MB_OK | MB_ICONSTOP ); return; } EnableWindow( GetDlgItem( m_hwnd, IDC_ACTIVATE ), FALSE ); SetWindowLongPtr( GetDlgItem( m_hwnd, IDC_ACTIVATE ), GWLP_USERDATA, (LONG_PTR)pList ); - XmlNodeIq iq( m_proto->m_iqManager.AddHandler( &CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList ) ); + XmlNodeIq iq( m_proto->m_iqManager.AddHandler( &CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList )); HXML query = iq << XQUERY( _T(JABBER_FEAT_PRIVACY_LISTS)); HXML active = query << XCHILD( _T("active")); if ( pList ) @@ -1825,7 +1825,7 @@ void CJabberDlgPrivacyLists::btnSetDefault_OnClick(CCtrlButton *) { m_proto->m_privacyListManager.Lock(); CPrivacyList* pList = GetSelectedList(m_hwnd); - if ( pList && pList->IsModified() ) { + if ( pList && pList->IsModified()) { m_proto->m_privacyListManager.Unlock(); MessageBox( m_hwnd, TranslateT("Please save list before you make it the default list"), TranslateT("First, save the list"), MB_OK | MB_ICONSTOP ); return; @@ -1833,11 +1833,11 @@ void CJabberDlgPrivacyLists::btnSetDefault_OnClick(CCtrlButton *) EnableWindow( GetDlgItem( m_hwnd, IDC_SET_DEFAULT ), FALSE ); SetWindowLongPtr( GetDlgItem( m_hwnd, IDC_SET_DEFAULT ), GWLP_USERDATA, (LONG_PTR)pList ); - XmlNodeIq iq( m_proto->m_iqManager.AddHandler( &CJabberProto::OnIqResultPrivacyListDefault, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList ) ); + XmlNodeIq iq( m_proto->m_iqManager.AddHandler( &CJabberProto::OnIqResultPrivacyListDefault, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList )); HXML query = iq << XQUERY( _T(JABBER_FEAT_PRIVACY_LISTS )); HXML defaultTag = query << XCHILD( _T("default")); if ( pList ) - xmlAddAttr( defaultTag, _T("name"), pList->GetListName() ); + xmlAddAttr( defaultTag, _T("name"), pList->GetListName()); m_proto->m_privacyListManager.Unlock(); SetStatusText(TranslateT( JABBER_PL_BUSY_MSG )); @@ -2001,7 +2001,7 @@ void CJabberDlgPrivacyLists::btnAddList_OnClick(CCtrlButton *) // FIXME: line length is hard coded in dialog procedure CJabberDlgPrivacyAddList dlgPrivacyAddList(m_proto, m_hwnd); int nRetVal = dlgPrivacyAddList.DoModal(); - if ( nRetVal && _tcslen( dlgPrivacyAddList.szLine ) ) { + if ( nRetVal && _tcslen( dlgPrivacyAddList.szLine )) { m_proto->m_privacyListManager.Lock(); CPrivacyList* pList = m_proto->m_privacyListManager.FindList( dlgPrivacyAddList.szLine ); if ( !pList ) { @@ -2033,7 +2033,7 @@ void CJabberDlgPrivacyLists::btnRemoveList_OnClick(CCtrlButton *) if ( pList ) { TCHAR *szListName = pList->GetListName(); if ( ( m_proto->m_privacyListManager.GetActiveListName() && !_tcscmp( szListName, m_proto->m_privacyListManager.GetActiveListName())) - || ( m_proto->m_privacyListManager.GetDefaultListName() && !_tcscmp( szListName, m_proto->m_privacyListManager.GetDefaultListName()) )) { + || ( m_proto->m_privacyListManager.GetDefaultListName() && !_tcscmp( szListName, m_proto->m_privacyListManager.GetDefaultListName()))) { m_proto->m_privacyListManager.Unlock(); MessageBox( m_hwnd, TranslateTS(_T("Can't remove active or default list")), TranslateTS(_T("Sorry")), MB_OK | MB_ICONSTOP ); return; @@ -2061,11 +2061,11 @@ void CJabberDlgPrivacyLists::btnApply_OnClick(CCtrlButton *) CPrivacyListModifyUserParam *pUserData = NULL; CPrivacyList* pList = m_proto->m_privacyListManager.GetFirstList(); while ( pList ) { - if ( pList->IsModified() ) { + if ( pList->IsModified()) { CPrivacyListRule* pRule = pList->GetFirstRule(); if ( !pRule ) pList->SetDeleted(); - if ( pList->IsDeleted() ) { + if ( pList->IsDeleted()) { pList->RemoveAllRules(); pRule = NULL; } @@ -2078,11 +2078,11 @@ void CJabberDlgPrivacyLists::btnApply_OnClick(CCtrlButton *) XmlNodeIq iq( m_proto->m_iqManager.AddHandler( &CJabberProto::OnIqResultPrivacyListModify, JABBER_IQ_TYPE_SET, NULL, 0, -1, pUserData )); HXML query = iq << XQUERY( _T(JABBER_FEAT_PRIVACY_LISTS )); - HXML listTag = query << XCHILD( _T("list")) << XATTR( _T("name"), pList->GetListName() ); + HXML listTag = query << XCHILD( _T("list")) << XATTR( _T("name"), pList->GetListName()); while ( pRule ) { HXML itemTag = listTag << XCHILD( _T("item")); - switch ( pRule->GetType() ) { + switch ( pRule->GetType()) { case Jid: itemTag << XATTR( _T("type"), _T("jid")); break; @@ -2094,12 +2094,12 @@ void CJabberDlgPrivacyLists::btnApply_OnClick(CCtrlButton *) break; } if ( pRule->GetType() != Else ) - itemTag << XATTR( _T("value"), pRule->GetValue() ); - if ( pRule->GetAction() ) + itemTag << XATTR( _T("value"), pRule->GetValue()); + if ( pRule->GetAction()) itemTag << XATTR( _T("action"), _T("allow")); else itemTag << XATTR( _T("action"), _T("deny")); - itemTag << XATTRI( _T("order"), pRule->GetOrder() ); + itemTag << XATTRI( _T("order"), pRule->GetOrder()); DWORD dwPackets = pRule->GetPackets(); if ( dwPackets != JABBER_PL_RULE_TYPE_ALL ) { if ( dwPackets & JABBER_PL_RULE_TYPE_IQ ) @@ -2216,7 +2216,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandlePrivacyLists( WPARAM, LPARAM ) void CJabberProto::QueryPrivacyLists( ThreadData *pThreadInfo ) { - XmlNodeIq iq( m_iqManager.AddHandler( &CJabberProto::OnIqResultPrivacyLists ) ); + XmlNodeIq iq( m_iqManager.AddHandler( &CJabberProto::OnIqResultPrivacyLists )); iq << XQUERY( _T(JABBER_FEAT_PRIVACY_LISTS)); if ( pThreadInfo ) pThreadInfo->send( iq ); @@ -2239,11 +2239,11 @@ INT_PTR __cdecl CJabberProto::menuSetPrivacyList( WPARAM, LPARAM, LPARAM iList ) pList = pList->GetNext(); } - XmlNodeIq iq( m_iqManager.AddHandler( &CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList ) ); + XmlNodeIq iq( m_iqManager.AddHandler( &CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList )); HXML query = iq << XQUERY( _T(JABBER_FEAT_PRIVACY_LISTS)); HXML active = query << XCHILD( _T("active")); if ( pList ) - active << XATTR( _T("name"), pList->GetListName() ); + active << XATTR( _T("name"), pList->GetListName()); m_privacyListManager.Unlock(); m_ThreadInfo->send( iq ); diff --git a/protocols/JabberG/jabber_privacy.h b/protocols/JabberG/jabber_privacy.h index 84cef9e22e..7eda283a94 100644 --- a/protocols/JabberG/jabber_privacy.h +++ b/protocols/JabberG/jabber_privacy.h @@ -228,9 +228,9 @@ public: } CPrivacyListRule *pRule = m_pRules; - while ( pRule->GetNext() ) { + while ( pRule->GetNext()) { if ( pRule->GetNext() == pRuleToRemove ) { - pRule->SetNext( pRule->GetNext()->GetNext() ); + pRule->SetNext( pRule->GetNext()->GetNext()); pRuleToRemove->SetNext( NULL ); delete pRuleToRemove; return TRUE; @@ -244,7 +244,7 @@ public: // 0 or 1 rules? if ( !m_pRules ) return TRUE; - if ( !m_pRules->GetNext() ) { + if ( !m_pRules->GetNext()) { m_pRules->SetOrder( 100 ); return TRUE; } @@ -273,7 +273,7 @@ public: CPrivacyListRule *pTmp; for ( i = 0; i < dwCount; i++ ) { for ( j = dwCount - 1; j > i; j-- ) { - if ( pRules[j - 1]->GetOrder() > pRules[j]->GetOrder() ) { + if ( pRules[j - 1]->GetOrder() > pRules[j]->GetOrder()) { pTmp = pRules[j - 1]; pRules[j - 1] = pRules[j]; pRules[j] = pTmp; @@ -418,7 +418,7 @@ public: return TRUE; CPrivacyList *pList = m_pLists; while ( pList ) { - if ( pList->IsModified() ) + if ( pList->IsModified()) return TRUE; pList = pList->GetNext(); } @@ -428,7 +428,7 @@ public: { CPrivacyList *pList = m_pLists; while ( pList ) { - if ( !pList->IsLoaded() ) + if ( !pList->IsLoaded()) return FALSE; pList = pList->GetNext(); } diff --git a/protocols/JabberG/jabber_proto.cpp b/protocols/JabberG/jabber_proto.cpp index 46042c7640..cfe4c40a23 100644 --- a/protocols/JabberG/jabber_proto.cpp +++ b/protocols/JabberG/jabber_proto.cpp @@ -480,7 +480,7 @@ int CJabberProto::Authorize( HANDLE hContact ) if ( !m_bJabberOnline ) return 1; - memset( &dbei, 0, sizeof( dbei ) ); + memset( &dbei, 0, sizeof( dbei )); dbei.cbSize = sizeof( dbei ); if (( dbei.cbBlob=JCallService( MS_DB_EVENT_GETBLOBSIZE, ( WPARAM )hContact, 0 )) == ( DWORD )( -1 )) return 1; @@ -533,7 +533,7 @@ int CJabberProto::AuthDeny( HANDLE hDbEvent, const TCHAR* /*szReason*/ ) return 1; Log( "Entering AuthDeny" ); - memset( &dbei, 0, sizeof( dbei ) ); + memset( &dbei, 0, sizeof( dbei )); dbei.cbSize = sizeof( dbei ); if (( dbei.cbBlob=JCallService( MS_DB_EVENT_GETBLOBSIZE, ( WPARAM )hDbEvent, 0 )) == ( DWORD )( -1 )) return 1; @@ -758,7 +758,7 @@ int __cdecl CJabberProto::GetInfo( HANDLE hContact, int /*infoType*/ ) int result = 1; DBVARIANT dbv; - if ( JGetByte( hContact, "ChatRoom" , 0) ) + if ( JGetByte( hContact, "ChatRoom" , 0)) return 1; if ( !JGetStringT( hContact, "jid", &dbv )) { @@ -783,7 +783,7 @@ int __cdecl CJabberProto::GetInfo( HANDLE hContact, int /*infoType*/ ) if ( !item ) { TCHAR szBareJid[ JABBER_MAX_JID_LEN ]; _tcsncpy( szBareJid, dbv.ptszVal, SIZEOF( szBareJid )); - TCHAR* pDelimiter = _tcschr( szBareJid, _T('/') ); + TCHAR* pDelimiter = _tcschr( szBareJid, _T('/')); if ( pDelimiter ) { *pDelimiter = 0; pDelimiter++; @@ -877,7 +877,7 @@ HANDLE __cdecl CJabberProto::SearchBasic( const TCHAR* szJid ) Log( "JabberBasicSearch called with lParam = '%s'", szJid ); JABBER_SEARCH_BASIC *jsb; - if ( !m_bJabberOnline || ( jsb=( JABBER_SEARCH_BASIC * ) mir_alloc( sizeof( JABBER_SEARCH_BASIC )) )==NULL ) + if ( !m_bJabberOnline || ( jsb=( JABBER_SEARCH_BASIC * ) mir_alloc( sizeof( JABBER_SEARCH_BASIC )))==NULL ) return 0; if ( _tcschr( szJid, '@' ) == NULL ) { @@ -1007,7 +1007,7 @@ int __cdecl CJabberProto::RecvMsg( HANDLE hContact, PROTORECVEVENT* evt ) int nDbEvent = JCallService( MS_PROTO_RECVMSG, 0, ( LPARAM )&ccs ); EnterCriticalSection( &m_csLastResourceMap ); - if (IsLastResourceExists( (void *)evt->lParam) ) { + if (IsLastResourceExists( (void *)evt->lParam)) { m_ulpResourceToDbEventMap[ m_dwResourceMapPointer++ ] = ( ULONG_PTR )nDbEvent; m_ulpResourceToDbEventMap[ m_dwResourceMapPointer++ ] = ( ULONG_PTR )evt->lParam; if ( m_dwResourceMapPointer >= SIZEOF( m_ulpResourceToDbEventMap )) @@ -1116,7 +1116,7 @@ HANDLE __cdecl CJabberProto::SendFile( HANDLE hContact, const TCHAR* szDescripti // caps not already received || ( jcb == JABBER_RESOURCE_CAPS_NONE ) // XEP-0096 and OOB not supported? - || !(jcb & ( JABBER_CAPS_SI_FT | JABBER_CAPS_OOB ) ) + || !(jcb & ( JABBER_CAPS_SI_FT | JABBER_CAPS_OOB )) ) { JFreeVariant( &dbv ); MsgPopup( hContact, TranslateT("No compatible file transfer machanism exist"), item->jid ); @@ -1514,7 +1514,7 @@ int __cdecl CJabberProto::SetAwayMsg( int status, const TCHAR* msg ) TCHAR* newModeMsg = mir_tstrdup( msg ); if (( *szMsg == NULL && newModeMsg == NULL ) || - ( *szMsg != NULL && newModeMsg != NULL && !lstrcmp( *szMsg, newModeMsg )) ) { + ( *szMsg != NULL && newModeMsg != NULL && !lstrcmp( *szMsg, newModeMsg ))) { // Message is the same, no update needed mir_free( newModeMsg ); LeaveCriticalSection( &m_csModeMsgMutex ); diff --git a/protocols/JabberG/jabber_rc.cpp b/protocols/JabberG/jabber_rc.cpp index 55e7779045..312db4bac4 100644 --- a/protocols/JabberG/jabber_rc.cpp +++ b/protocols/JabberG/jabber_rc.cpp @@ -45,15 +45,15 @@ CJabberAdhocSession::CJabberAdhocSession( CJabberProto* global ) BOOL CJabberProto::IsRcRequestAllowedByACL( CJabberIqInfo* pInfo ) { - if ( !pInfo || !pInfo->GetFrom() ) + if ( !pInfo || !pInfo->GetFrom()) return FALSE; - return IsMyOwnJID( pInfo->GetFrom() ); + return IsMyOwnJID( pInfo->GetFrom()); } BOOL CJabberProto::HandleAdhocCommandRequest( HXML iqNode, CJabberIqInfo* pInfo ) { - if ( !pInfo->GetChildNode() ) + if ( !pInfo->GetChildNode()) return TRUE; if ( !m_options.EnableRemoteControl || !IsRcRequestAllowedByACL( pInfo )) { @@ -277,7 +277,7 @@ int CJabberProto::AdhocSetStatusHandler( HXML, CJabberIqInfo* pInfo, CJabberAdho HXML fieldNode = xNode << XCHILD( _T("field")) << XATTR( _T("label"), TranslateT("Status")) << XATTR( _T("type"), _T("list-single")) << XATTR( _T("var"), _T("status")); - fieldNode << XCHILD( _T("required") ); + fieldNode << XCHILD( _T("required")); int status = JCallService( MS_CLIST_GETSTATUSMODE, 0, 0 ); switch ( status ) { @@ -339,16 +339,16 @@ int CJabberProto::AdhocSetStatusHandler( HXML, CJabberIqInfo* pInfo, CJabberAdho else if ( pSession->GetStage() == 1 ) { // result form here HXML commandNode = pInfo->GetChildNode(); - HXML xNode = xmlGetChildByTag( commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS) ); + HXML xNode = xmlGetChildByTag( commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS)); if ( !xNode ) return JABBER_ADHOC_HANDLER_STATUS_CANCEL; - HXML fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("status") ); + HXML fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("status")); if ( !xNode ) return JABBER_ADHOC_HANDLER_STATUS_CANCEL; HXML valueNode = xmlGetChild( fieldNode , "value" ); - if ( !valueNode || !xmlGetText( valueNode ) ) + if ( !valueNode || !xmlGetText( valueNode )) return JABBER_ADHOC_HANDLER_STATUS_CANCEL; int status = 0; @@ -366,19 +366,19 @@ int CJabberProto::AdhocSetStatusHandler( HXML, CJabberIqInfo* pInfo, CJabberAdho int priority = -9999; - fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("status-priority") ); + fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("status-priority")); if ( fieldNode && (valueNode = xmlGetChild( fieldNode , "value" ))) { - if ( xmlGetText( valueNode ) ) - priority = _ttoi( xmlGetText( valueNode ) ); + if ( xmlGetText( valueNode )) + priority = _ttoi( xmlGetText( valueNode )); } if ( priority >= -128 && priority <= 127 ) JSetWord( NULL, "Priority", (WORD)priority ); const TCHAR* szStatusMessage = NULL; - fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("status-message") ); + fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("status-message")); if ( fieldNode && (valueNode = xmlGetChild( fieldNode , "value" ))) { - if ( xmlGetText( valueNode ) ) + if ( xmlGetText( valueNode )) szStatusMessage = xmlGetText( valueNode ); } @@ -388,9 +388,9 @@ int CJabberProto::AdhocSetStatusHandler( HXML, CJabberIqInfo* pInfo, CJabberAdho DBWriteContactSettingTString( NULL, "SRAway", StatusModeToDbSetting( status, "Msg" ), szStatusMessage ? szStatusMessage : _T( "" )); - fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("status-global") ); + fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("status-global")); if ( fieldNode && (valueNode = xmlGetChild( fieldNode , "value" ))) { - if ( xmlGetText( valueNode ) && _ttoi( xmlGetText( valueNode ) )) + if ( xmlGetText( valueNode ) && _ttoi( xmlGetText( valueNode ))) JCallService( MS_CLIST_SETSTATUSMODE, status, NULL ); else CallProtoService( m_szModuleName, PS_SETSTATUS, status, NULL ); @@ -445,30 +445,30 @@ int CJabberProto::AdhocOptionsHandler( HXML, CJabberIqInfo* pInfo, CJabberAdhocS if ( pSession->GetStage() == 1 ) { // result form here HXML commandNode = pInfo->GetChildNode(); - HXML xNode = xmlGetChildByTag( commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS) ); + HXML xNode = xmlGetChildByTag( commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS)); if ( !xNode ) return JABBER_ADHOC_HANDLER_STATUS_CANCEL; HXML fieldNode, valueNode; // Automatically Accept File Transfers - fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("auto-files") ); + fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("auto-files")); if ( fieldNode && (valueNode = xmlGetChild( fieldNode , "value" ))) { - if ( xmlGetText( valueNode ) ) - DBWriteContactSettingByte( NULL, "SRFile", "AutoAccept", (BYTE)_ttoi( xmlGetText( valueNode ) ) ); + if ( xmlGetText( valueNode )) + DBWriteContactSettingByte( NULL, "SRFile", "AutoAccept", (BYTE)_ttoi( xmlGetText( valueNode )) ); } // Use sounds - fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("sounds") ); + fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("sounds")); if ( fieldNode && (valueNode = xmlGetChild( fieldNode , "value" ))) { - if ( xmlGetText( valueNode ) ) - DBWriteContactSettingByte( NULL, "Skin", "UseSound", (BYTE)_ttoi( xmlGetText( valueNode ) ) ); + if ( xmlGetText( valueNode )) + DBWriteContactSettingByte( NULL, "Skin", "UseSound", (BYTE)_ttoi( xmlGetText( valueNode )) ); } // Disable remote controlling - fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("enable-rc") ); + fieldNode = xmlGetChildByTag( xNode, "field", "var", _T("enable-rc")); if ( fieldNode && (valueNode = xmlGetChild( fieldNode , "value" ))) { - if ( xmlGetText( valueNode ) && _ttoi( xmlGetText( valueNode ) )) + if ( xmlGetText( valueNode ) && _ttoi( xmlGetText( valueNode ))) m_options.EnableRemoteControl = 0; } @@ -519,7 +519,7 @@ int CJabberProto::AdhocForwardHandler( HXML, CJabberIqInfo* pInfo, CJabberAdhocS if ( pSession->GetStage() == 0 ) { int nUnreadEvents = RcGetUnreadEventsCount(); if ( !nUnreadEvents ) { - mir_sntprintf( szMsg, SIZEOF(szMsg), TranslateT("There is no messages to forward") ); + mir_sntprintf( szMsg, SIZEOF(szMsg), TranslateT("There is no messages to forward")); m_ThreadInfo->send( XmlNodeIq( _T("result"), pInfo ) @@ -550,7 +550,7 @@ int CJabberProto::AdhocForwardHandler( HXML, CJabberIqInfo* pInfo, CJabberAdhocS // remove clist events xNode << XCHILD( _T("field")) << XATTR( _T("label"), TranslateT("Mark messages as read")) << XATTR( _T("type"), _T("boolean")) << XATTR( _T("var"), _T("remove-clist-events")) << XCHILD( _T("value"), - m_options.RcMarkMessagesAsRead == 1 ? _T("1") : _T("0") ); + m_options.RcMarkMessagesAsRead == 1 ? _T("1") : _T("0")); m_ThreadInfo->send( iq ); return JABBER_ADHOC_HANDLER_STATUS_EXECUTING; @@ -559,7 +559,7 @@ int CJabberProto::AdhocForwardHandler( HXML, CJabberIqInfo* pInfo, CJabberAdhocS if ( pSession->GetStage() == 1 ) { // result form here HXML commandNode = pInfo->GetChildNode(); - HXML xNode = xmlGetChildByTag( commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS) ); + HXML xNode = xmlGetChildByTag( commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS)); if ( !xNode ) return JABBER_ADHOC_HANDLER_STATUS_CANCEL; @@ -568,9 +568,9 @@ int CJabberProto::AdhocForwardHandler( HXML, CJabberIqInfo* pInfo, CJabberAdhocS BOOL bRemoveCListEvents = TRUE; // remove clist events - fieldNode = xmlGetChildByTag( xNode,"field", "var", _T("remove-clist-events") ); + fieldNode = xmlGetChildByTag( xNode,"field", "var", _T("remove-clist-events")); if ( fieldNode && (valueNode = xmlGetChild( fieldNode , "value" ))) { - if ( xmlGetText( valueNode ) && !_ttoi( xmlGetText( valueNode ) ) ) { + if ( xmlGetText( valueNode ) && !_ttoi( xmlGetText( valueNode )) ) { bRemoveCListEvents = FALSE; } } @@ -658,7 +658,7 @@ typedef BOOL (WINAPI *LWS )( VOID ); int CJabberProto::AdhocLockWSHandler( HXML, CJabberIqInfo* pInfo, CJabberAdhocSession* pSession ) { BOOL bOk = FALSE; - HMODULE hLibrary = LoadLibrary( _T("user32.dll") ); + HMODULE hLibrary = LoadLibrary( _T("user32.dll")); if ( hLibrary ) { LWS pLws = (LWS)GetProcAddress( hLibrary, "LockWorkStation" ); if ( pLws ) @@ -668,9 +668,9 @@ int CJabberProto::AdhocLockWSHandler( HXML, CJabberIqInfo* pInfo, CJabberAdhocSe TCHAR szMsg[ 1024 ]; if ( bOk ) - mir_sntprintf( szMsg, SIZEOF(szMsg), TranslateT("Workstation successfully locked") ); + mir_sntprintf( szMsg, SIZEOF(szMsg), TranslateT("Workstation successfully locked")); else - mir_sntprintf( szMsg, SIZEOF(szMsg), TranslateT("Error %d occured during workstation lock"), GetLastError() ); + mir_sntprintf( szMsg, SIZEOF(szMsg), TranslateT("Error %d occured during workstation lock"), GetLastError()); m_ThreadInfo->send( XmlNodeIq( _T("result"), pInfo ) @@ -716,16 +716,16 @@ int CJabberProto::AdhocQuitMirandaHandler( HXML, CJabberIqInfo* pInfo, CJabberAd if ( pSession->GetStage() == 1 ) { // result form here HXML commandNode = pInfo->GetChildNode(); - HXML xNode = xmlGetChildByTag( commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS) ); + HXML xNode = xmlGetChildByTag( commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS)); if ( !xNode ) return JABBER_ADHOC_HANDLER_STATUS_CANCEL; HXML fieldNode, valueNode; // I Agree checkbox - fieldNode = xmlGetChildByTag( xNode,"field", "var", _T("allow-shutdown") ); + fieldNode = xmlGetChildByTag( xNode,"field", "var", _T("allow-shutdown")); if ( fieldNode && (valueNode = xmlGetChild( fieldNode , "value" ))) - if ( xmlGetText( valueNode ) && _ttoi( xmlGetText( valueNode ) )) + if ( xmlGetText( valueNode ) && _ttoi( xmlGetText( valueNode ))) mir_forkthread( JabberQuitMirandaIMThread, NULL ); return JABBER_ADHOC_HANDLER_STATUS_COMPLETED; @@ -751,7 +751,7 @@ int CJabberProto::AdhocLeaveGroupchatsHandler( HXML, CJabberIqInfo* pInfo, CJabb ListUnlock(); if ( !nChatsCount ) { - mir_sntprintf( szMsg, SIZEOF(szMsg), TranslateT("There is no groupchats to leave") ); + mir_sntprintf( szMsg, SIZEOF(szMsg), TranslateT("There is no groupchats to leave")); m_ThreadInfo->send( XmlNodeIq( _T("result"), pInfo ) @@ -796,12 +796,12 @@ int CJabberProto::AdhocLeaveGroupchatsHandler( HXML, CJabberIqInfo* pInfo, CJabb if ( pSession->GetStage() == 1 ) { // result form here HXML commandNode = pInfo->GetChildNode(); - HXML xNode = xmlGetChildByTag( commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS) ); + HXML xNode = xmlGetChildByTag( commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS)); if ( !xNode ) return JABBER_ADHOC_HANDLER_STATUS_CANCEL; // Groupchat list here: - HXML fieldNode = xmlGetChildByTag( xNode,"field", "var", _T("groupchats") ); + HXML fieldNode = xmlGetChildByTag( xNode,"field", "var", _T("groupchats")); if ( fieldNode ) { for ( i = 0; i < xmlGetChildCount( fieldNode ); i++ ) { HXML valueNode = xmlGetChild( fieldNode, i ); diff --git a/protocols/JabberG/jabber_rc.h b/protocols/JabberG/jabber_rc.h index 394b905fbf..a83db38ab4 100644 --- a/protocols/JabberG/jabber_rc.h +++ b/protocols/JabberG/jabber_rc.h @@ -216,9 +216,9 @@ protected: } CJabberAdhocSession* pTmp = m_pSessions; - while ( pTmp->GetNext() ) { + while ( pTmp->GetNext()) { if ( pTmp->GetNext() == pSession ) { - pTmp->SetNext( pSession->GetNext() ); + pTmp->SetNext( pSession->GetNext()); pSession->SetNext( NULL ); delete pSession; return TRUE; @@ -241,10 +241,10 @@ protected: return TRUE; } - while ( pSession->GetNext() ) { + while ( pSession->GetNext()) { if ( pSession->GetNext()->GetSessionStartTime() < dwExpireTime ) { CJabberAdhocSession* pRetVal = pSession->GetNext(); - pSession->SetNext( pSession->GetNext()->GetNext() ); + pSession->SetNext( pSession->GetNext()->GetNext()); pRetVal->SetNext( NULL ); delete pRetVal; return TRUE; @@ -289,7 +289,7 @@ public: m_pNodes = pNode; else { CJabberAdhocNode* pTmp = m_pNodes; - while ( pTmp->GetNext() ) + while ( pTmp->GetNext()) pTmp = pTmp->GetNext(); pTmp->SetNext( pNode ); } diff --git a/protocols/JabberG/jabber_search.cpp b/protocols/JabberG/jabber_search.cpp index de2c0121a5..fddcc5617d 100644 --- a/protocols/JabberG/jabber_search.cpp +++ b/protocols/JabberG/jabber_search.cpp @@ -162,7 +162,7 @@ void CJabberProto::OnIqResultGetSearchFields( HXML iqNode ) if ( !_tcsicmp( xmlGetName( chNode ), _T("instructions")) && xmlGetText( chNode )) SetDlgItemText(searchHandleDlg,IDC_INSTRUCTIONS,TranslateTS(xmlGetText( chNode ))); - else if ( xmlGetName( chNode ) ) { + else if ( xmlGetName( chNode )) { Data *MyData=(Data*)malloc(sizeof(Data)); memset(MyData,0,sizeof(Data)); diff --git a/protocols/JabberG/jabber_svc.cpp b/protocols/JabberG/jabber_svc.cpp index 37cc368549..8b51b63e48 100644 --- a/protocols/JabberG/jabber_svc.cpp +++ b/protocols/JabberG/jabber_svc.cpp @@ -432,7 +432,7 @@ INT_PTR __cdecl CJabberProto::JabberGCGetToolTipText( WPARAM wParam, LPARAM lPar bool bIsTipper = DBGetContactSettingByte(NULL, "Tab_SRMsg", "adv_TipperTooltip", 1) && ServiceExists("mToolTip/HideTip"); //JID: - if ( _tcschr(info->resourceName, _T('@') ) != NULL ) + if ( _tcschr(info->resourceName, _T('@')) != NULL ) appendString(bIsTipper, _T("JID:"), info->resourceName, outBuf, SIZEOF(outBuf)); else if (lParam) { //or simple nick appendString(bIsTipper, _T("Nick:"), (TCHAR*) lParam, outBuf, SIZEOF(outBuf)); @@ -614,7 +614,7 @@ INT_PTR __cdecl CJabberProto::JabberSendNudge( WPARAM wParam, LPARAM ) m_ThreadInfo->send( XmlNode( _T("message")) << XATTR( _T("type"), _T("headline")) << XATTR( _T("to"), tszJid ) << XCHILDNS( _T("attention"), - jcb & JABBER_CAPS_ATTENTION ? _T(JABBER_FEAT_ATTENTION) : _T(JABBER_FEAT_ATTENTION_0 )) ); + jcb & JABBER_CAPS_ATTENTION ? _T(JABBER_FEAT_ATTENTION) : _T(JABBER_FEAT_ATTENTION_0 ))); } return 0; } @@ -1120,7 +1120,7 @@ LPTSTR CJabberNetInterface::GetResourceFeatures( LPCTSTR jid ) } // allocate memory and fill it - LPTSTR str = (LPTSTR)mir_alloc( iLen * sizeof(TCHAR) ); + LPTSTR str = (LPTSTR)mir_alloc( iLen * sizeof(TCHAR)); LPTSTR p = str; for ( i = 0; g_JabberFeatCapPairs[i].szFeature; i++ ) { if ( jcb & g_JabberFeatCapPairs[i].jcbCap ) { diff --git a/protocols/JabberG/jabber_thread.cpp b/protocols/JabberG/jabber_thread.cpp index 116328250f..5635c10a57 100644 --- a/protocols/JabberG/jabber_thread.cpp +++ b/protocols/JabberG/jabber_thread.cpp @@ -683,7 +683,7 @@ void CJabberProto::PerformAuthentication( ThreadData* info ) if ( m_AuthMechs.isSpnegoAvailable ) { m_AuthMechs.isSpnegoAvailable = false; auth = new TNtlmAuth( info, "GSS-SPNEGO" ); - if ( !auth->isValid() ) { + if ( !auth->isValid()) { delete auth; auth = NULL; } } @@ -691,7 +691,7 @@ void CJabberProto::PerformAuthentication( ThreadData* info ) if ( auth == NULL && m_AuthMechs.isNtlmAvailable ) { m_AuthMechs.isNtlmAvailable = false; auth = new TNtlmAuth( info, "NTLM" ); - if ( !auth->isValid() ) { + if ( !auth->isValid()) { delete auth; auth = NULL; } } @@ -699,7 +699,7 @@ void CJabberProto::PerformAuthentication( ThreadData* info ) if ( auth == NULL && m_AuthMechs.isKerberosAvailable ) { m_AuthMechs.isKerberosAvailable = false; auth = new TNtlmAuth( info, "GSSAPI", m_AuthMechs.m_gssapiHostName ); - if ( !auth->isValid() ) { + if ( !auth->isValid()) { delete auth; auth = NULL; } else { @@ -749,7 +749,7 @@ void CJabberProto::PerformAuthentication( ThreadData* info ) if ( !request ) request = auth->getInitialRequest(); info->send( XmlNode( _T("auth"), _A2T(request)) << XATTR( _T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-sasl")) - << XATTR( _T("mechanism"), _A2T(auth->getName() ))); + << XATTR( _T("mechanism"), _A2T(auth->getName()))); mir_free( request ); } @@ -857,7 +857,7 @@ void CJabberProto::OnProcessFailure( HXML node, ThreadData* info ) const TCHAR* type; //failure xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" if (( type = xmlGetAttrValue( node, _T("xmlns"))) == NULL ) return; - if ( !_tcscmp( type, _T("urn:ietf:params:xml:ns:xmpp-sasl") )) { + if ( !_tcscmp( type, _T("urn:ietf:params:xml:ns:xmpp-sasl"))) { PerformAuthentication( info ); } } @@ -906,7 +906,7 @@ void CJabberProto::OnProcessSuccess( HXML node, ThreadData* info ) if (( type = xmlGetAttrValue( node, _T("xmlns"))) == NULL ) return; - if ( !_tcscmp( type, _T("urn:ietf:params:xml:ns:xmpp-sasl") )) { + if ( !_tcscmp( type, _T("urn:ietf:params:xml:ns:xmpp-sasl"))) { DBVARIANT dbv; if ( !info->auth->validateLogin( xmlGetText( node ))) { @@ -1044,7 +1044,7 @@ void CJabberProto::OnProcessPubsubEvent( HXML node ) return; } - HXML tuneNode = XPath( itemsNode, _T("item/tune[@xmlns='") _T(JABBER_FEAT_USER_TUNE) _T("']") ); + HXML tuneNode = XPath( itemsNode, _T("item/tune[@xmlns='") _T(JABBER_FEAT_USER_TUNE) _T("']")); if ( !tuneNode ) return; @@ -1157,15 +1157,15 @@ void CJabberProto::OnProcessMessage( HXML node, ThreadData* info ) HXML bodyNode = xmlGetChildByTag( node , "body", "xml:lang", m_tszSelectedLang ); if ( bodyNode == NULL ) bodyNode = xmlGetChild( node , "body" ); - if ( bodyNode != NULL && xmlGetText( bodyNode ) ) + if ( bodyNode != NULL && xmlGetText( bodyNode )) szMessage = xmlGetText( bodyNode ); if (( subjectNode = xmlGetChild( node , "subject" )) && xmlGetText( subjectNode ) && xmlGetText( subjectNode )[0] != _T('\0')) { - size_t cbLen = (szMessage ? _tcslen( szMessage ) : 0) + _tcslen( xmlGetText( subjectNode ) ) + 128; + size_t cbLen = (szMessage ? _tcslen( szMessage ) : 0) + _tcslen( xmlGetText( subjectNode )) + 128; TCHAR* szTmp = ( TCHAR * )alloca( sizeof(TCHAR) * cbLen ); szTmp[0] = _T('\0'); if ( szMessage ) _tcscat( szTmp, _T("Subject: ")); - _tcscat( szTmp, xmlGetText( subjectNode ) ); + _tcscat( szTmp, xmlGetText( subjectNode )); if ( szMessage ) { _tcscat( szTmp, _T("\r\n")); _tcscat( szTmp, szMessage ); @@ -1174,7 +1174,7 @@ void CJabberProto::OnProcessMessage( HXML node, ThreadData* info ) } if ( szMessage && (n = xmlGetChildByTag( node, "addresses", "xmlns", _T(JABBER_FEAT_EXT_ADDRESSING)))) { - HXML addressNode = xmlGetChildByTag( n, "address", "type", _T("ofrom") ); + HXML addressNode = xmlGetChildByTag( n, "address", "type", _T("ofrom")); if ( addressNode ) { const TCHAR* szJid = xmlGetAttrValue( addressNode, _T("jid")); if ( szJid ) { @@ -1228,14 +1228,14 @@ void CJabberProto::OnProcessMessage( HXML node, ThreadData* info ) } // XEP-0203 delay support - if ( n = xmlGetChildByTag( node, "delay", "xmlns", _T("urn:xmpp:delay") ) ) { + if ( n = xmlGetChildByTag( node, "delay", "xmlns", _T("urn:xmpp:delay")) ) { const TCHAR* ptszTimeStamp = xmlGetAttrValue( n, _T("stamp")); if ( ptszTimeStamp != NULL ) { // skip '-' chars TCHAR* szStamp = mir_tstrdup( ptszTimeStamp ); int si = 0, sj = 0; while (1) { - if ( szStamp[si] == _T('-') ) + if ( szStamp[si] == _T('-')) si++; else if ( !( szStamp[sj++] = szStamp[si++] )) @@ -1248,7 +1248,7 @@ void CJabberProto::OnProcessMessage( HXML node, ThreadData* info ) // XEP-0224 support (Attention/Nudge) if ( xmlGetChildByTag( node, "attention", "xmlns", _T( JABBER_FEAT_ATTENTION )) || - xmlGetChildByTag( node, "attention", "xmlns", _T( JABBER_FEAT_ATTENTION_0 )) ) { + xmlGetChildByTag( node, "attention", "xmlns", _T( JABBER_FEAT_ATTENTION_0 ))) { if ( !hContact ) hContact = CreateTemporaryContact( from, chatItem ); if ( hContact ) @@ -1285,7 +1285,7 @@ void CJabberProto::OnProcessMessage( HXML node, ThreadData* info ) pParams->m_szFrom = mir_tstrdup( from ); HXML pThreadNode = xmlGetChild( node , "thread" ); if ( pThreadNode && xmlGetText( pThreadNode ) && xmlGetText( pThreadNode )[0] ) - pParams->m_szThreadId = mir_tstrdup( xmlGetText( pThreadNode ) ); + pParams->m_szThreadId = mir_tstrdup( xmlGetText( pThreadNode )); pParams->m_szId = mir_tstrdup( szId ); pParams->m_szMethod = mir_tstrdup( szMethod ); pParams->m_szUrl = mir_tstrdup( szUrl ); @@ -1318,10 +1318,10 @@ void CJabberProto::OnProcessMessage( HXML node, ThreadData* info ) TCHAR* prolog = _T("-----BEGIN PGP MESSAGE-----\r\n\r\n"); TCHAR* epilog = _T("\r\n-----END PGP MESSAGE-----\r\n"); - TCHAR* tempstring = ( TCHAR* )alloca( sizeof( TCHAR ) * ( _tcslen( prolog ) + _tcslen( xmlGetText( xNode ) ) + _tcslen( epilog ) + 3 )); + TCHAR* tempstring = ( TCHAR* )alloca( sizeof( TCHAR ) * ( _tcslen( prolog ) + _tcslen( xmlGetText( xNode )) + _tcslen( epilog ) + 3 )); _tcsncpy( tempstring, prolog, _tcslen( prolog ) + 1 ); - _tcsncpy( tempstring + _tcslen( prolog ), xmlGetText( xNode ), _tcslen( xmlGetText( xNode ) ) + 1); - _tcsncpy( tempstring + _tcslen( prolog ) + _tcslen(xmlGetText( xNode ) ), epilog, _tcslen( epilog ) + 1); + _tcsncpy( tempstring + _tcslen( prolog ), xmlGetText( xNode ), _tcslen( xmlGetText( xNode )) + 1); + _tcsncpy( tempstring + _tcslen( prolog ) + _tcslen(xmlGetText( xNode )), epilog, _tcslen( epilog ) + 1); szMessage = tempstring; } else if ( !_tcscmp( ptszXmlns, _T(JABBER_FEAT_DELAY)) && msgTime == 0 ) { @@ -1336,7 +1336,7 @@ void CJabberProto::OnProcessMessage( HXML node, ThreadData* info ) if ( jcbCaps & JABBER_RESOURCE_CAPS_ERROR ) jcbCaps = JABBER_RESOURCE_CAPS_NONE; // FIXME: disabled due to expired XEP-0022 and problems with bombus delivery checks -// if ( jcbCaps && resourceStatus && (!(jcbCaps & JABBER_CAPS_MESSAGE_EVENTS)) ) +// if ( jcbCaps && resourceStatus && (!(jcbCaps & JABBER_CAPS_MESSAGE_EVENTS))) // resourceStatus->jcbManualDiscoveredCaps |= (JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY); if ( bodyNode == NULL ) { @@ -1344,8 +1344,8 @@ void CJabberProto::OnProcessMessage( HXML node, ThreadData* info ) if ( xmlGetChild( xNode , "delivered" ) != NULL || xmlGetChild( xNode , "offline" ) != NULL ) { int id = -1; if ( idNode != NULL && xmlGetText( idNode ) != NULL ) - if ( !_tcsncmp( xmlGetText( idNode ), _T(JABBER_IQID), strlen( JABBER_IQID )) ) - id = _ttoi(( xmlGetText( idNode ) )+strlen( JABBER_IQID )); + if ( !_tcsncmp( xmlGetText( idNode ), _T(JABBER_IQID), strlen( JABBER_IQID ))) + id = _ttoi(( xmlGetText( idNode ))+strlen( JABBER_IQID )); if ( id != -1 ) JSendBroadcast( hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, ( HANDLE ) id, 0 ); @@ -1379,9 +1379,9 @@ void CJabberProto::OnProcessMessage( HXML node, ThreadData* info ) else if ( !_tcscmp( ptszXmlns, _T(JABBER_FEAT_OOB2))) { HXML urlNode; if ( ((urlNode = xmlGetChild( xNode , "url" )) != NULL) && xmlGetText( urlNode ) && xmlGetText( urlNode )[0] != _T('\0')) { - size_t cbLen = (szMessage ? _tcslen( szMessage ) : 0) + _tcslen( xmlGetText( urlNode ) ) + 32; + size_t cbLen = (szMessage ? _tcslen( szMessage ) : 0) + _tcslen( xmlGetText( urlNode )) + 32; TCHAR* szTmp = ( TCHAR * )alloca( sizeof(TCHAR) * cbLen ); - _tcscpy( szTmp, xmlGetText( urlNode ) ); + _tcscpy( szTmp, xmlGetText( urlNode )); if ( szMessage ) { _tcscat( szTmp, _T("\r\n")); _tcscat( szTmp, szMessage ); @@ -1667,7 +1667,7 @@ void CJabberProto::OnProcessPresence( HXML node, ThreadData* info ) DBCheckIsTransportedContact( from, hContact ); int status = ID_STATUS_ONLINE; if (( showNode = xmlGetChild( node , "show" )) != NULL ) { - if (( show = xmlGetText( showNode ) ) != NULL ) { + if (( show = xmlGetText( showNode )) != NULL ) { if ( !_tcscmp( show, _T("away"))) status = ID_STATUS_AWAY; else if ( !_tcscmp( show, _T("xa"))) status = ID_STATUS_NA; else if ( !_tcscmp( show, _T("dnd"))) status = ID_STATUS_DND; @@ -1676,7 +1676,7 @@ void CJabberProto::OnProcessPresence( HXML node, ThreadData* info ) char priority = 0; if (( priorityNode = xmlGetChild( node , "priority" )) != NULL && xmlGetText( priorityNode ) != NULL ) - priority = (char)_ttoi( xmlGetText( priorityNode ) ); + priority = (char)_ttoi( xmlGetText( priorityNode )); if (( statusNode = xmlGetChild( node , "status" )) != NULL && xmlGetText( statusNode ) != NULL ) p = xmlGetText( statusNode ); @@ -1706,11 +1706,11 @@ void CJabberProto::OnProcessPresence( HXML node, ThreadData* info ) if (( xNode = xmlGetChild( xNode , "hash" )) != NULL && xmlGetText( xNode ) != NULL ) { JDeleteSetting(hContact,"AvatarXVcard"); Log( "AvatarXVcard deleted" ); - JSetStringT( hContact, "AvatarHash", xmlGetText( xNode ) ); + JSetStringT( hContact, "AvatarHash", xmlGetText( xNode )); hasAvatar = true; DBVARIANT dbv; int result = JGetStringT( hContact, "AvatarSaved", &dbv ); - if ( result || lstrcmp( dbv.ptszVal, xmlGetText( xNode ) )) { + if ( result || lstrcmp( dbv.ptszVal, xmlGetText( xNode ))) { Log( "Avatar was changed" ); JSendBroadcast( hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL ); } else Log( "Not broadcasting avatar changed" ); @@ -1746,7 +1746,7 @@ void CJabberProto::OnProcessPresence( HXML node, ThreadData* info ) Log( "Has no avatar" ); JDeleteSetting( hContact, "AvatarHash" ); DBVARIANT dbv = {0}; - if ( !JGetStringT( hContact, "AvatarSaved", &dbv ) ) { + if ( !JGetStringT( hContact, "AvatarSaved", &dbv )) { JFreeVariant( &dbv ); JDeleteSetting( hContact, "AvatarSaved" ); JSendBroadcast( hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL ); @@ -1771,8 +1771,8 @@ void CJabberProto::OnProcessPresence( HXML node, ThreadData* info ) if ( !item->resourceCount ) { item->itemResource.status = ID_STATUS_OFFLINE; - if ((( statusNode = xmlGetChild( node , "status" )) != NULL ) && xmlGetText( statusNode ) ) - replaceStr( item->itemResource.statusMessage, xmlGetText( statusNode ) ); + if ((( statusNode = xmlGetChild( node , "status" )) != NULL ) && xmlGetText( statusNode )) + replaceStr( item->itemResource.statusMessage, xmlGetText( statusNode )); else replaceStr( item->itemResource.statusMessage, NULL ); } @@ -1809,7 +1809,7 @@ void CJabberProto::OnProcessPresence( HXML node, ThreadData* info ) } else { HXML n = xmlGetChild( node , "nick" ); - nick = ( n == NULL ) ? JabberNickFromJID( from ) : mir_tstrdup( xmlGetText( n ) ); + nick = ( n == NULL ) ? JabberNickFromJID( from ) : mir_tstrdup( xmlGetText( n )); if ( nick != NULL ) { Log( TCHAR_STR_PARAM " ( " TCHAR_STR_PARAM " ) requests authorization", nick, from ); DBAddAuthRequest( from, nick ); @@ -1854,7 +1854,7 @@ void CJabberProto::OnProcessPresence( HXML node, ThreadData* info ) void CJabberProto::OnIqResultVersion( HXML /*node*/, CJabberIqInfo *pInfo ) { - JABBER_RESOURCE_STATUS *r = ResourceInfoFromJID( pInfo->GetFrom() ); + JABBER_RESOURCE_STATUS *r = ResourceInfoFromJID( pInfo->GetFrom()); if ( r == NULL ) return; r->dwVersionRequestTime = -1; @@ -1867,16 +1867,16 @@ void CJabberProto::OnIqResultVersion( HXML /*node*/, CJabberIqInfo *pInfo ) if ( pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && queryNode) { HXML n; - if (( n = xmlGetChild( queryNode , "name" ))!=NULL && xmlGetText( n ) ) - r->software = mir_tstrdup( xmlGetText( n ) ); - if (( n = xmlGetChild( queryNode , "version" ))!=NULL && xmlGetText( n ) ) - r->version = mir_tstrdup( xmlGetText( n ) ); - if (( n = xmlGetChild( queryNode , "os" ))!=NULL && xmlGetText( n ) ) - r->system = mir_tstrdup( xmlGetText( n ) ); + if (( n = xmlGetChild( queryNode , "name" ))!=NULL && xmlGetText( n )) + r->software = mir_tstrdup( xmlGetText( n )); + if (( n = xmlGetChild( queryNode , "version" ))!=NULL && xmlGetText( n )) + r->version = mir_tstrdup( xmlGetText( n )); + if (( n = xmlGetChild( queryNode , "os" ))!=NULL && xmlGetText( n )) + r->system = mir_tstrdup( xmlGetText( n )); } GetResourceCapabilites( pInfo->GetFrom(), TRUE ); - if ( pInfo->GetHContact() ) + if ( pInfo->GetHContact()) UpdateMirVer( pInfo->GetHContact(), r ); JabberUserInfoUpdate(pInfo->GetHContact()); @@ -1889,11 +1889,11 @@ BOOL CJabberProto::OnProcessJingle( HXML node ) if ( child ) { if (( type=xmlGetAttrValue( node, _T("type"))) == NULL ) return FALSE; - if (( !_tcscmp( type, _T("get")) || !_tcscmp( type, _T("set") ))) { + if (( !_tcscmp( type, _T("get")) || !_tcscmp( type, _T("set")))) { LPCTSTR szAction = xmlGetAttrValue( child, _T("action")); LPCTSTR idStr = xmlGetAttrValue( node, _T("id")); LPCTSTR from = xmlGetAttrValue( node, _T("from")); - if ( szAction && !_tcscmp( szAction, _T("session-initiate")) ) { + if ( szAction && !_tcscmp( szAction, _T("session-initiate"))) { // if this is a Jingle 'session-initiate' and noone processed it yet, reply with "unsupported-applications" m_ThreadInfo->send( XmlNodeIq( _T("result"), idStr, from )); @@ -1958,7 +1958,7 @@ void CJabberProto::OnProcessIq( HXML node ) ///////////////////////////////////////////////////////////////////////// // OLD MATCH BY ID ///////////////////////////////////////////////////////////////////////// - if ( ( !_tcscmp( type, _T("result")) || !_tcscmp( type, _T("error")) ) && (( pfunc=JabberIqFetchFunc( id )) != NULL )) { + if ( ( !_tcscmp( type, _T("result")) || !_tcscmp( type, _T("error"))) && (( pfunc=JabberIqFetchFunc( id )) != NULL )) { Log( "Handling iq request for id=%d", id ); (this->*pfunc)( node ); return; @@ -1977,8 +1977,8 @@ void CJabberProto::OnProcessIq( HXML node ) SetEvent( item->ft->hFileEvent ); // Simulate the termination of file server connection } } } - else if (( !_tcscmp( type, _T("get")) || !_tcscmp( type, _T("set") ))) { - XmlNodeIq iq( _T("error"), idStr, xmlGetAttrValue( node, _T("from")) ); + else if (( !_tcscmp( type, _T("get")) || !_tcscmp( type, _T("set")))) { + XmlNodeIq iq( _T("error"), idStr, xmlGetAttrValue( node, _T("from"))); HXML pFirstChild = xmlGetChild( node , 0 ); if ( pFirstChild ) diff --git a/protocols/JabberG/jabber_userinfo.cpp b/protocols/JabberG/jabber_userinfo.cpp index dc433f9b93..3ba8bfa57e 100644 --- a/protocols/JabberG/jabber_userinfo.cpp +++ b/protocols/JabberG/jabber_userinfo.cpp @@ -256,7 +256,7 @@ static void sttFillResourceInfo( CJabberProto* ppro, HWND hwndTree, HTREEITEM ht // Resource priority TCHAR szPriority[128]; mir_sntprintf( szPriority, SIZEOF( szPriority ), _T("%d"), (int)res->priority ); - sttFillInfoLine( hwndTree, htiResource, NULL, TranslateT( "Resource priority" ), szPriority, sttInfoLineId(resource, INFOLINE_PRIORITY) ); + sttFillInfoLine( hwndTree, htiResource, NULL, TranslateT( "Resource priority" ), szPriority, sttInfoLineId(resource, INFOLINE_PRIORITY)); // Idle if ( res->idleStartTime > 0 ) { @@ -269,7 +269,7 @@ static void sttFillResourceInfo( CJabberProto* ppro, HWND hwndTree, HTREEITEM ht else lstrcpyn(buf, TranslateT( "" ), SIZEOF( buf )); - sttFillInfoLine( hwndTree, htiResource, NULL, TranslateT("Idle since"), buf, sttInfoLineId(resource, INFOLINE_IDLE) ); + sttFillInfoLine( hwndTree, htiResource, NULL, TranslateT("Idle since"), buf, sttInfoLineId(resource, INFOLINE_IDLE)); // caps mir_sntprintf( buf, SIZEOF(buf), _T("%s/%s"), item->jid, res->resourceName ); @@ -285,7 +285,7 @@ static void sttFillResourceInfo( CJabberProto* ppro, HWND hwndTree, HTREEITEM ht mir_sntprintf( szDescription, SIZEOF( szDescription ), _T("%s (%s)"), TranslateTS(g_JabberFeatCapPairs[i].szDescription), g_JabberFeatCapPairs[i].szFeature ); else mir_sntprintf( szDescription, SIZEOF( szDescription ), _T("%s"), g_JabberFeatCapPairs[i].szFeature ); - sttFillInfoLine( hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i) ); + sttFillInfoLine( hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i)); } for ( int j = 0; j < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); j++, i++ ) @@ -295,7 +295,7 @@ static void sttFillResourceInfo( CJabberProto* ppro, HWND hwndTree, HTREEITEM ht mir_sntprintf( szDescription, SIZEOF( szDescription ), _T("%s (%s)"), TranslateTS(ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature ); else mir_sntprintf( szDescription, SIZEOF( szDescription ), _T("%s"), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature ); - sttFillInfoLine( hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i) ); + sttFillInfoLine( hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i)); } } @@ -304,18 +304,18 @@ static void sttFillResourceInfo( CJabberProto* ppro, HWND hwndTree, HTREEITEM ht HTREEITEM htiSoftwareInfo = sttFillInfoLine( hwndTree, htiResource, ppro->LoadIconEx( "main" ), NULL, TranslateT( "Software information" ), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION)); int nLineId = 0; if ( res->pSoftwareInfo->szOs ) - sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Operating system"), res->pSoftwareInfo->szOs, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++) ); + sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Operating system"), res->pSoftwareInfo->szOs, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++)); if ( res->pSoftwareInfo->szOsVersion ) - sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Operating system version"), res->pSoftwareInfo->szOsVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++) ); + sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Operating system version"), res->pSoftwareInfo->szOsVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++)); if ( res->pSoftwareInfo->szSoftware ) - sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Software"), res->pSoftwareInfo->szSoftware, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++) ); + sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Software"), res->pSoftwareInfo->szSoftware, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++)); if ( res->pSoftwareInfo->szSoftwareVersion ) - sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Software version"), res->pSoftwareInfo->szSoftwareVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++) ); + sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Software version"), res->pSoftwareInfo->szSoftwareVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++)); if ( res->pSoftwareInfo->szXMirandaCoreVersion ) { - sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Miranda IM core version"), res->pSoftwareInfo->szXMirandaCoreVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++) ); - sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Unicode build"), res->pSoftwareInfo->bXMirandaIsUnicode ? TranslateT("Yes") : TranslateT("No"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++) ); - sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Alpha build"), res->pSoftwareInfo->bXMirandaIsAlpha ? TranslateT("Yes") : TranslateT("No"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++) ); - sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Debug build"), res->pSoftwareInfo->bXMirandaIsDebug ? TranslateT("Yes") : TranslateT("No"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++) ); + sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Miranda IM core version"), res->pSoftwareInfo->szXMirandaCoreVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++)); + sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Unicode build"), res->pSoftwareInfo->bXMirandaIsUnicode ? TranslateT("Yes") : TranslateT("No"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++)); + sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Alpha build"), res->pSoftwareInfo->bXMirandaIsAlpha ? TranslateT("Yes") : TranslateT("No"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++)); + sttFillInfoLine( hwndTree, htiSoftwareInfo, NULL, TranslateT("Debug build"), res->pSoftwareInfo->bXMirandaIsDebug ? TranslateT("Yes") : TranslateT("No"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++)); } } } @@ -405,7 +405,7 @@ static void sttFillUserInfo( CJabberProto* ppro, HWND hwndTree, JABBER_LIST_ITEM for (int i = 0; i < item->resourceCount; ++i) sttFillResourceInfo( ppro, hwndTree, htiRoot, item, i+1 ); } - else if ( !_tcschr(item->jid, _T('@')) || (item->itemResource.status != ID_STATUS_OFFLINE) ) + else if ( !_tcschr(item->jid, _T('@')) || (item->itemResource.status != ID_STATUS_OFFLINE)) sttFillResourceInfo( ppro, hwndTree, htiRoot, item, 0 ); sttCleanupInfo(hwndTree, 1); @@ -491,7 +491,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc( HWND hwndDlg, UINT msg, WPARAM wP TreeView_DeleteAllItems( hwndTree ); HTREEITEM htiRoot = sttFillInfoLine( hwndTree, NULL, dat->ppro->LoadIconEx( "main" ), _T( "JID" ), dbv.ptszVal, sttInfoLineId(0, INFOLINE_NAME), true ); sttFillInfoLine( hwndTree, htiRoot, dat->ppro->LoadIconEx("vcard"), NULL, - TranslateT("Please switch online to see more details.") ); + TranslateT("Please switch online to see more details.")); JFreeVariant(&dbv); break; diff --git a/protocols/JabberG/jabber_util.cpp b/protocols/JabberG/jabber_util.cpp index 7c9867a377..9df7bd2620 100644 --- a/protocols/JabberG/jabber_util.cpp +++ b/protocols/JabberG/jabber_util.cpp @@ -206,7 +206,7 @@ TCHAR* JabberPrepareJid( LPCTSTR jid ) if ( !jid ) return NULL; TCHAR* szNewJid = mir_tstrdup( jid ); if ( !szNewJid ) return NULL; - TCHAR* pDelimiter = _tcschr( szNewJid, _T('/') ); + TCHAR* pDelimiter = _tcschr( szNewJid, _T('/')); if ( pDelimiter ) *pDelimiter = _T('\0'); CharLower( szNewJid ); if ( pDelimiter ) *pDelimiter = _T('/'); @@ -453,7 +453,7 @@ WCHAR* __stdcall JabberUnixToDosW( const WCHAR* str ) if ( *p == '\n' ) extra++; } - if (( res = ( WCHAR* )mir_alloc( sizeof( WCHAR )*( wcslen( str ) + extra + 1 )) ) != NULL ) { + if (( res = ( WCHAR* )mir_alloc( sizeof( WCHAR )*( wcslen( str ) + extra + 1 ))) != NULL ) { for ( p = str,q=res; *p!='\0'; p++,q++ ) { if ( *p == '\n' ) { *q = '\r'; @@ -492,7 +492,7 @@ void __stdcall JabberHttpUrlDecode( TCHAR* str ) if ( str == NULL ) return; for ( p = q = ( TCHAR* )str; *p!='\0'; p++,q++ ) { - if ( *p=='%' && *( p+1 )!='\0' && isxdigit( *( p+1 )) && *( p+2 )!='\0' && isxdigit( *( p+2 )) ) { + if ( *p=='%' && *( p+1 )!='\0' && isxdigit( *( p+1 )) && *( p+2 )!='\0' && isxdigit( *( p+2 ))) { _stscanf(( TCHAR* )p+1, _T("%2x"), &code ); *q = ( unsigned char ) code; p += 2; @@ -818,42 +818,42 @@ void CJabberProto::SendPresenceTo( int status, TCHAR* to, HXML extra, const TCHA TCHAR szExtCaps[ 512 ] = _T(""); if ( m_bGoogleTalk ) - _tcscat( szExtCaps, _T(JABBER_EXT_GTALK_PMUC) ); + _tcscat( szExtCaps, _T(JABBER_EXT_GTALK_PMUC)); if ( bSecureIM ) { if ( szExtCaps[0] ) _tcscat( szExtCaps, _T(" ")); - _tcscat( szExtCaps, _T(JABBER_EXT_SECUREIM) ); + _tcscat( szExtCaps, _T(JABBER_EXT_SECUREIM)); } if ( m_options.EnableRemoteControl ) { if ( szExtCaps[0] ) _tcscat( szExtCaps, _T(" ")); - _tcscat( szExtCaps, _T(JABBER_EXT_COMMANDS) ); + _tcscat( szExtCaps, _T(JABBER_EXT_COMMANDS)); } if ( m_options.EnableUserMood ) { if ( szExtCaps[0] ) _tcscat( szExtCaps, _T(" ")); - _tcscat( szExtCaps, _T(JABBER_EXT_USER_MOOD) ); + _tcscat( szExtCaps, _T(JABBER_EXT_USER_MOOD)); } if ( m_options.EnableUserTune ) { if ( szExtCaps[0] ) _tcscat( szExtCaps, _T(" ")); - _tcscat( szExtCaps, _T(JABBER_EXT_USER_TUNE) ); + _tcscat( szExtCaps, _T(JABBER_EXT_USER_TUNE)); } if ( m_options.EnableUserActivity ) { if ( szExtCaps[0] ) _tcscat( szExtCaps, _T(" ")); - _tcscat( szExtCaps, _T(JABBER_EXT_USER_ACTIVITY) ); + _tcscat( szExtCaps, _T(JABBER_EXT_USER_ACTIVITY)); } if ( m_options.AcceptNotes ) { if ( szExtCaps[0] ) _tcscat( szExtCaps, _T(" ")); - _tcscat( szExtCaps, _T(JABBER_EXT_MIR_NOTES) ); + _tcscat( szExtCaps, _T(JABBER_EXT_MIR_NOTES)); } // add features enabled through IJabberNetInterface::AddFeatures() @@ -1669,10 +1669,10 @@ BOOL CJabberProto::IsMyOwnJID( LPCTSTR szJID ) return FALSE; } - TCHAR* pDelimiter = _tcschr( szFrom, _T('/') ); + TCHAR* pDelimiter = _tcschr( szFrom, _T('/')); if ( pDelimiter ) *pDelimiter = _T('\0'); - pDelimiter = _tcschr( szTo, _T('/') ); + pDelimiter = _tcschr( szTo, _T('/')); if ( pDelimiter ) *pDelimiter = _T('\0'); BOOL bRetVal = _tcscmp( szFrom, szTo ) == 0; diff --git a/protocols/JabberG/jabber_vcard.cpp b/protocols/JabberG/jabber_vcard.cpp index f8edc245ae..70213922f8 100644 --- a/protocols/JabberG/jabber_vcard.cpp +++ b/protocols/JabberG/jabber_vcard.cpp @@ -93,7 +93,7 @@ static INT_PTR CALLBACK PersonalDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam, case WM_COMMAND: if (( ( HWND )lParam==GetFocus() && HIWORD( wParam )==EN_CHANGE ) || - (( HWND )lParam==GetDlgItem( hwndDlg, IDC_GENDER ) && ( HIWORD( wParam )==CBN_EDITCHANGE||HIWORD( wParam )==CBN_SELCHANGE )) ) + (( HWND )lParam==GetDlgItem( hwndDlg, IDC_GENDER ) && ( HIWORD( wParam )==CBN_EDITCHANGE||HIWORD( wParam )==CBN_SELCHANGE ))) { ppro->m_vCardUpdates |= (1UL<m_vCardUpdates |= (1UL<m_vCardUpdates |= (1UL<GetCharIqType() != NULL ) *this << XATTR( _T("type"), _A2T(pInfo->GetCharIqType())); - if ( pInfo->GetReceiver() != NULL ) *this << XATTR( _T("to"), pInfo->GetReceiver() ); - if ( pInfo->GetIqId() != -1 ) *this << XATTRID( pInfo->GetIqId() ); + if ( pInfo->GetReceiver() != NULL ) *this << XATTR( _T("to"), pInfo->GetReceiver()); + if ( pInfo->GetIqId() != -1 ) *this << XATTRID( pInfo->GetIqId()); } } @@ -77,8 +77,8 @@ XmlNodeIq::XmlNodeIq( const TCHAR* type, CJabberIqInfo* pInfo ) : { if ( type != NULL ) *this << XATTR( _T("type"), type ); if ( pInfo ) { - if ( pInfo->GetFrom() != NULL ) *this << XATTR( _T("to"), pInfo->GetFrom() ); - if ( pInfo->GetIdStr() != NULL ) *this << XATTR( _T("id"), pInfo->GetIdStr() ); + if ( pInfo->GetFrom() != NULL ) *this << XATTR( _T("to"), pInfo->GetFrom()); + if ( pInfo->GetIdStr() != NULL ) *this << XATTR( _T("id"), pInfo->GetIdStr()); } } diff --git a/protocols/JabberG/jabber_xstatus.cpp b/protocols/JabberG/jabber_xstatus.cpp index efdb377edc..d35c5a4b88 100644 --- a/protocols/JabberG/jabber_xstatus.cpp +++ b/protocols/JabberG/jabber_xstatus.cpp @@ -679,7 +679,7 @@ void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode) return; } - HXML n, moodNode = XPath( itemsNode, _T("item/mood[@xmlns='") _T(JABBER_FEAT_USER_MOOD) _T("']") ); + HXML n, moodNode = XPath( itemsNode, _T("item/mood[@xmlns='") _T(JABBER_FEAT_USER_MOOD) _T("']")); if ( !moodNode ) return; LPCTSTR moodType = NULL, moodText = NULL; @@ -1097,7 +1097,7 @@ void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode) return; } - HXML actNode = XPath( itemsNode, _T("item/activity[@xmlns='") _T(JABBER_FEAT_USER_ACTIVITY) _T("']") ); + HXML actNode = XPath( itemsNode, _T("item/activity[@xmlns='") _T(JABBER_FEAT_USER_ACTIVITY) _T("']")); if ( !actNode ) return; LPCTSTR szText = XPathT( actNode, "text" ); @@ -1217,7 +1217,7 @@ void CPepActivity::ShowSetDialog(BYTE bQuiet) CJabberDlgPepSimple dlg(m_proto, TranslateT("Set Activity")); for (int i = 0; i < SIZEOF(g_arrActivities); ++i) if (g_arrActivities[i].szFirst || g_arrActivities[i].szSecond) - dlg.AddStatusMode(i, ActivityGetId(i), m_icons.GetIcon(returnActivity(i)), TranslateTS(g_arrActivities[i].szTitle), (g_arrActivities[i].szSecond != NULL) ); + dlg.AddStatusMode(i, ActivityGetId(i), m_icons.GetIcon(returnActivity(i)), TranslateTS(g_arrActivities[i].szTitle), (g_arrActivities[i].szSecond != NULL)); dlg.SetActiveStatus(m_mode, m_text); dlg.DoModal(); @@ -1306,7 +1306,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusIcon( WPARAM wParam, LPARAM lParam ) if ( !wParam ) wParam = ((CPepMood *)m_pepServices.Find(_T(JABBER_FEAT_USER_MOOD)))->m_mode; - if ( wParam < 1 || wParam >= SIZEOF(g_arrMoods) ) + if ( wParam < 1 || wParam >= SIZEOF(g_arrMoods)) return 0; int flags = 0; @@ -1324,7 +1324,7 @@ BOOL CJabberProto::SendPepTune( TCHAR* szArtist, TCHAR* szLength, TCHAR* szSourc if ( !m_bJabberOnline || !m_bPepSupported ) return FALSE; - XmlNodeIq iq( _T("set"), SerialNext() ); + XmlNodeIq iq( _T("set"), SerialNext()); HXML tuneNode = iq << XCHILDNS( _T("pubsub"), _T(JABBER_FEAT_PUBSUB)) << XCHILD( _T("publish")) << XATTR( _T("node"), _T(JABBER_FEAT_USER_TUNE)) << XCHILD( _T("item")) << XCHILDNS( _T("tune"), _T(JABBER_FEAT_USER_TUNE)); @@ -1365,7 +1365,7 @@ void CJabberProto::SetContactTune( HANDLE hContact, LPCTSTR szArtist, LPCTSTR sz } else { szListeningTo = (TCHAR *) mir_alloc( 2048 * sizeof( TCHAR )); - mir_sntprintf( szListeningTo, 2047, _T("%s - %s"), szTitle ? szTitle : _T(""), szArtist ? szArtist : _T("") ); + mir_sntprintf( szListeningTo, 2047, _T("%s - %s"), szTitle ? szTitle : _T(""), szArtist ? szArtist : _T("")); } JSetStringT( hContact, "ListeningTo", szListeningTo ); @@ -1402,7 +1402,7 @@ void overrideStr( TCHAR*& dest, const TCHAR* src, BOOL unicode, const TCHAR* def INT_PTR __cdecl CJabberProto::OnSetListeningTo( WPARAM, LPARAM lParam ) { LISTENINGTOINFO *cm = (LISTENINGTOINFO *)lParam; - if ( !cm || cm->cbSize != sizeof(LISTENINGTOINFO) ) { + if ( !cm || cm->cbSize != sizeof(LISTENINGTOINFO)) { SendPepTune( NULL, NULL, NULL, NULL, NULL, NULL ); JDeleteSetting( NULL, "ListeningTo" ); } @@ -1430,7 +1430,7 @@ INT_PTR __cdecl CJabberProto::OnSetListeningTo( WPARAM, LPARAM lParam ) while ( szTmp[0] ) { result += ( _ttoi( szTmp ) * multiplier ); multiplier /= 60; - szTmp = _tcschr( szTmp, _T(':') ); + szTmp = _tcschr( szTmp, _T(':')); if ( !szTmp ) break; szTmp++; diff --git a/protocols/JabberG/ui_utils.cpp b/protocols/JabberG/ui_utils.cpp index 4386a02a53..eb91ecb74b 100644 --- a/protocols/JabberG/ui_utils.cpp +++ b/protocols/JabberG/ui_utils.cpp @@ -554,7 +554,7 @@ CCtrlMButton::CCtrlMButton( CDlgBase* dlg, int ctrlId, HICON hIcon, const char* CCtrlMButton::CCtrlMButton( CDlgBase* dlg, int ctrlId, int iCoreIcon, const char* tooltip ) : CCtrlButton( dlg, ctrlId ), - m_hIcon( LoadSkinnedIcon(iCoreIcon) ), + m_hIcon( LoadSkinnedIcon(iCoreIcon)), m_toolTip( tooltip ) { } -- cgit v1.2.3