From d93c0eb9f3f5d2d2cd78f02422d0c0ed25743e3a Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 14 Aug 2010 13:20:59 +0100 Subject: Read incoming MSN status/away messages. --- protocols/msn/ns.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'protocols/msn/ns.c') diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index 40f96b21..0c067b8c 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -576,6 +576,13 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) if( num_parts >= 4 ) md->handler->msglen = atoi( cmd[3] ); } + else if( strcmp( cmd[0], "NOT" ) == 0 ) + { + /* Some kind of notification, not sure if it still exists + but we have to skip the payload or stuff breaks. */ + if( num_parts >= 3 ) + md->handler->msglen = atoi( cmd[2] ); + } else if( isdigit( cmd[0][0] ) ) { int num = atoi( cmd[0] ); @@ -685,6 +692,19 @@ static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int g_free( ct ); } } + else if( strcmp( cmd[0], "UBX" ) == 0 ) + { + struct xt_node *psm; + char *psm_text = NULL; + + psm = xt_from_string( msg ); + if( psm && strcmp( psm->name, "Data" ) == 0 && + ( psm = xt_find_node( psm->children, "PSM" ) ) ) + psm_text = psm->text; + + imcb_buddy_status_msg( ic, cmd[1], psm_text ); + xt_free_node( psm ); + } return( 1 ); } -- cgit v1.2.3