diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-17 14:07:44 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-17 14:07:44 +0000 |
commit | 122baf7f7465e0b5b890729d65914f527db1ca26 (patch) | |
tree | 117f5fe7914b636a5d99577235e58727c8ddedb3 /protocols/JabberG | |
parent | 5b68af4bce0056e373e69bf16fb7d3bdfac96dd8 (diff) |
Unicode ACKTYPE_AWAYMSG broadcast
git-svn-id: http://svn.miranda-ng.org/main/trunk@458 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG')
-rw-r--r-- | protocols/JabberG/jabber_proto.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/protocols/JabberG/jabber_proto.cpp b/protocols/JabberG/jabber_proto.cpp index 350c9d28a8..46042c7640 100644 --- a/protocols/JabberG/jabber_proto.cpp +++ b/protocols/JabberG/jabber_proto.cpp @@ -1407,7 +1407,7 @@ void __cdecl CJabberProto::GetAwayMsgThread( void* hContact ) JABBER_LIST_ITEM *item;
JABBER_RESOURCE_STATUS *r;
int i, msgCount;
- size_t len;
+ size_t len;
if ( !JGetStringT( hContact, "jid", &dbv )) {
if (( item = ListGetItemPtr( LIST_ROSTER, dbv.ptszVal )) != NULL ) {
@@ -1416,15 +1416,15 @@ void __cdecl CJabberProto::GetAwayMsgThread( void* hContact ) Log( "resourceCount > 0" );
r = item->resource;
len = msgCount = 0;
- for ( i=0; i<item->resourceCount; i++ ) {
+ for ( i=0; i<item->resourceCount; i++ )
if ( r[i].statusMessage ) {
msgCount++;
len += ( _tcslen( r[i].resourceName ) + _tcslen( r[i].statusMessage ) + 8 );
- } }
+ }
TCHAR* str = ( TCHAR* )alloca( sizeof( TCHAR )*( len+1 ));
str[0] = str[len] = '\0';
- for ( i=0; i < item->resourceCount; i++ ) {
+ for ( i=0; i < item->resourceCount; i++ )
if ( r[i].statusMessage ) {
if ( str[0] != '\0' ) _tcscat( str, _T("\r\n" ));
if ( msgCount > 1 ) {
@@ -1433,27 +1433,21 @@ void __cdecl CJabberProto::GetAwayMsgThread( void* hContact ) _tcscat( str, _T(" ): "));
}
_tcscat( str, r[i].statusMessage );
- } }
+ }
- char* msg = mir_t2a(str);
- char* msg2 = JabberUnixToDos(msg);
- JSendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE ) 1, ( LPARAM )msg2 );
- mir_free(msg);
- mir_free(msg2);
+ JSendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)str);
return;
}
if ( item->itemResource.statusMessage != NULL ) {
- char* msg = mir_t2a(item->itemResource.statusMessage);
- JSendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE ) 1, ( LPARAM )msg );
- mir_free(msg);
+ JSendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)item->itemResource.statusMessage);
return;
}
}
else JFreeVariant( &dbv );
}
- JSendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE ) 1, ( LPARAM )"" );
+ JSendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE ) 1, ( LPARAM )0 );
}
HANDLE __cdecl CJabberProto::GetAwayMsg( HANDLE hContact )
|