diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-05-25 01:04:18 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2006-05-25 01:04:18 +0200 |
commit | 601e81362bbf4e4d1e686334b35d3bdcd87314d2 (patch) | |
tree | 53ed2250bfc35b9e8da568b6f624a530d323ef32 /protocols/msn/ns.c | |
parent | 46ad029950221205d1eb6201ec2f01c7231876c2 (diff) | |
parent | fc630f9fb47690c30feaf4738727a213d633afc9 (diff) |
[merge] Wilmer
Diffstat (limited to 'protocols/msn/ns.c')
-rw-r--r-- | protocols/msn/ns.c | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index 4ced58a0..90d525ef 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -256,6 +256,9 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) if( num_parts == 5 ) { md->buddycount = atoi( cmd[3] ); + md->groupcount = atoi( cmd[4] ); + if( md->groupcount > 0 ) + md->grouplist = g_new0( char *, md->groupcount ); if( !*cmd[3] || md->buddycount == 0 ) msn_logged_in( gc ); @@ -268,18 +271,6 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) msn_logged_in( gc ); } } - else if( strcmp( cmd[0], "GTC" ) == 0 ) - { - } - else if( strcmp( cmd[0], "BLP" ) == 0 ) - { - } - else if( strcmp( cmd[0], "PRP" ) == 0 ) - { - } - else if( strcmp( cmd[0], "LSG" ) == 0 ) - { - } else if( strcmp( cmd[0], "LST" ) == 0 ) { int list; @@ -296,7 +287,13 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) if( list & 1 ) /* FL */ { - add_buddy( gc, NULL, cmd[1], cmd[2] ); + char *group = NULL; + int num; + + if( cmd[4] != NULL && sscanf( cmd[4], "%d", &num ) == 1 ) + group = md->grouplist[num]; + + add_buddy( gc, group, cmd[1], cmd[2] ); } if( list & 2 ) /* AL */ { @@ -326,11 +323,22 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) } } } - else if( strcmp( cmd[0], "BPR" ) == 0 ) - { - } - else if( strcmp( cmd[0], "CHG" ) == 0 ) + else if( strcmp( cmd[0], "LSG" ) == 0 ) { + int num; + + if( num_parts != 4 ) + { + hide_login_progress_error( gc, "Syntax error" ); + signoff( gc ); + return( 0 ); + } + + http_decode( cmd[2] ); + num = atoi( cmd[1] ); + + if( num < md->groupcount ) + md->grouplist[num] = g_strdup( cmd[2] ); } else if( strcmp( cmd[0], "CHL" ) == 0 ) { @@ -356,12 +364,6 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) return( msn_write( gc, buf, strlen( buf ) ) ); } - else if( strcmp( cmd[0], "QRY" ) == 0 ) - { - } - else if( strcmp( cmd[0], "QNG" ) == 0 ) - { - } else if( strcmp( cmd[0], "ILN" ) == 0 ) { const struct msn_away_state *st; @@ -478,9 +480,6 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) msn_buddy_ask( gc, cmd[4], cmd[5] ); } } - else if( strcmp( cmd[0], "REM" ) == 0 ) - { - } else if( strcmp( cmd[0], "OUT" ) == 0 ) { if( cmd[1] && strcmp( cmd[1], "OTH" ) == 0 ) |