diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2012-09-16 14:52:19 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2012-09-16 14:52:19 +0100 |
commit | 080c43a862bca535e51682423afc9d0f75ea1d02 (patch) | |
tree | 7d265fde60504f9fb47de731fae8117ea1234ca9 /protocols/msn/msn.c | |
parent | f9258aead615ef9b87baa1754777fd5faf867fe1 (diff) |
Some more tweaks: Should show up online now, and be able to send and receive
messages. Seeing online state is still a problem due to the protocol#: gunk.
Diffstat (limited to 'protocols/msn/msn.c')
-rw-r--r-- | protocols/msn/msn.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index 59adec62..8e10e202 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -190,11 +190,29 @@ static void msn_set_away( struct im_connection *ic, char *state, char *message ) else if( ( md->away_state = msn_away_state_by_name( state ) ) == NULL ) md->away_state = msn_away_state_list + 1; - if( !msn_ns_write( ic, -1, "CHG %d %s\r\n", ++md->trId, md->away_state->code ) ) + if( !msn_ns_write( ic, -1, "CHG %d %s %d:%02d\r\n", ++md->trId, md->away_state->code, MSN_CAP1, MSN_CAP2 ) ) return; - uux = g_markup_printf_escaped( "<Data><PSM>%s</PSM><CurrentMedia></CurrentMedia>" - "</Data>", message ? message : "" ); + uux = g_markup_printf_escaped( "<EndpointData><Capabilities>%d:%02d" + "</Capabilities></EndpointData>", + MSN_CAP1, MSN_CAP2 ); + msn_ns_write( ic, -1, "UUX %d %zd\r\n%s", ++md->trId, strlen( uux ), uux ); + g_free( uux ); + + uux = g_markup_printf_escaped( "<PrivateEndpointData><EpName>%s</EpName>" + "<Idle>%s</Idle><ClientType>%d</ClientType>" + "<State>%s</State></PrivateEndpointData>", + md->uuid, + strcmp( md->away_state->code, "IDL" ) ? "false" : "true", + 1, /* ? */ + md->away_state->code ); + msn_ns_write( ic, -1, "UUX %d %zd\r\n%s", ++md->trId, strlen( uux ), uux ); + g_free( uux ); + + uux = g_markup_printf_escaped( "<Data><DDP></DDP><PSM>%s</PSM>" + "<CurrentMedia></CurrentMedia>" + "<MachineGuid>%s</MachineGuid></Data>", + message ? message : "", md->uuid ); msn_ns_write( ic, -1, "UUX %d %zd\r\n%s", ++md->trId, strlen( uux ), uux ); g_free( uux ); } |