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/sb.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/sb.c')
-rw-r--r-- | protocols/msn/sb.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index 14465c67..c8e97433 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -307,6 +307,7 @@ gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond ) { struct msn_switchboard *sb = data; struct im_connection *ic; + struct msn_data *md; char buf[1024]; /* Are we still alive? */ @@ -314,6 +315,7 @@ gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond ) return FALSE; ic = sb->ic; + md = ic->proto_data; if( source != sb->fd ) { @@ -331,9 +333,9 @@ gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond ) sb->handler->exec_message = msn_sb_message; if( sb->session == MSN_SB_NEW ) - g_snprintf( buf, sizeof( buf ), "USR %d %s %s\r\n", ++sb->trId, ic->acc->user, sb->key ); + g_snprintf( buf, sizeof( buf ), "USR %d %s;{%s} %s\r\n", ++sb->trId, ic->acc->user, md->uuid, sb->key ); else - g_snprintf( buf, sizeof( buf ), "ANS %d %s %s %d\r\n", ++sb->trId, ic->acc->user, sb->key, sb->session ); + g_snprintf( buf, sizeof( buf ), "ANS %d %s;{%s} %s %d\r\n", ++sb->trId, ic->acc->user, md->uuid, sb->key, sb->session ); if( msn_sb_write( sb, "%s", buf ) ) sb->inp = b_input_add( sb->fd, B_EV_IO_READ, msn_sb_callback, sb ); @@ -461,7 +463,12 @@ static int msn_sb_command( struct msn_handler_data *handler, char **cmd, int num sb->who = NULL; } - imcb_chat_add_buddy( sb->chat, cmd[4] ); + /* For as much as I understand this MPOP stuff now, a + switchboard has two (or more) roster entries per + participant. One "bare JID" and one JID;UUID. Ignore + the latter. */ + if( !strchr( cmd[4], ';' ) ) + imcb_chat_add_buddy( sb->chat, cmd[4] ); if( num == tot ) { @@ -506,6 +513,10 @@ static int msn_sb_command( struct msn_handler_data *handler, char **cmd, int num return( 0 ); } + /* See IRO above. Handle "bare JIDs" only. */ + if( strchr( cmd[1], ';' ) ) + return 1; + if( sb->who && g_strcasecmp( cmd[1], sb->who ) == 0 ) { /* The user we wanted to talk to is finally there, let's send the queued messages then. */ @@ -540,6 +551,10 @@ static int msn_sb_command( struct msn_handler_data *handler, char **cmd, int num return( st ); } + else if( strcmp( cmd[1], ic->acc->user ) == 0 ) + { + /* Well, gee thanks. Thanks for letting me know I've arrived.. */ + } else if( sb->who ) { debug( "Converting chat with %s to a groupchat because %s joined the session.", sb->who, cmd[1] ); |