From: Christian H. <ch...@us...> - 2003-05-15 20:28:16
|
Update of /cvsroot/gaim/gaim/src/protocols/msn In directory sc8-pr-cvs1:/tmp/cvs-serv27903 Modified Files: notification.c Log Message: This should let gaim jump to the new notification server when the server tells us to. Index: notification.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/msn/notification.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- notification.c 14 May 2003 08:02:03 -0000 1.17 +++ notification.c 15 May 2003 20:28:10 -0000 1.18 @@ -1031,7 +1031,7 @@ char *c; int port; - if (strcmp(params[1], "SB")) { + if (strcmp(params[1], "SB") && strcmp(params[1], "NS")) { hide_login_progress(gc, _("Got invalid XFR")); signoff(gc); @@ -1047,25 +1047,40 @@ else port = 1863; - swboard = msn_session_find_unused_switch(session); + if (!strcmp(params[1], "SB")) { + swboard = msn_session_find_unused_switch(session); - if (swboard == NULL) { - gaim_debug(GAIM_DEBUG_ERROR, "msn", - "Received an XFR SB request when there's no unused " - "switchboards!\n"); - return FALSE; - } + if (swboard == NULL) { + gaim_debug(GAIM_DEBUG_ERROR, "msn", + "Received an XFR SB request when there's no unused " + "switchboards!\n"); + return FALSE; + } - msn_switchboard_set_auth_key(swboard, params[4]); + msn_switchboard_set_auth_key(swboard, params[4]); - if (!msn_switchboard_connect(swboard, host, port)) { - gaim_debug(GAIM_DEBUG_ERROR, "msn", - "Unable to connect to switchboard on %s, port %d\n", - host, port); + if (!msn_switchboard_connect(swboard, host, port)) { + gaim_debug(GAIM_DEBUG_ERROR, "msn", + "Unable to connect to switchboard on %s, port %d\n", + host, port); - g_free(host); + g_free(host); - return FALSE; + return FALSE; + } + } + else if (!strcmp(params[1], "NS")) { + msn_servconn_destroy(session->notification_conn); + + session->notification_conn = msn_notification_new(session, host, port); + + if (!msn_servconn_connect(session->notification_conn)) { + hide_login_progress(gc, _("Unable to transfer to " + "notification server")); + signoff(gc); + + return FALSE; + } } g_free(host); |