comparison src/protocols/msn/session.c @ 8583:fc27237783ee

[gaim-migrate @ 9333] Added Felipe Contreras's patch to reorganize and clean up the MSN protocol plugin. Thanks, and once again, apologies for the what must have seemed a never-ending delay. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 05 Apr 2004 07:11:24 +0000
parents 467b01d02f9c
children 060171053a32
comparison
equal deleted inserted replaced
8582:d7c85220c685 8583:fc27237783ee
19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 21 */
22 #include "msn.h" 22 #include "msn.h"
23 #include "session.h" 23 #include "session.h"
24 #include "dispatch.h"
25 #include "notification.h" 24 #include "notification.h"
26 25
27 MsnSession * 26 MsnSession *
28 msn_session_new(GaimAccount *account, const char *server, int port) 27 msn_session_new(GaimAccount *account, const char *server, int port)
29 { 28 {
106 105
107 session->connected = TRUE; 106 session->connected = TRUE;
108 107
109 if (session->http_method) 108 if (session->http_method)
110 { 109 {
111 session->notification_conn = 110 session->notification_conn = msn_notification_new(session);
112 msn_notification_new(session, "gateway.messenger.hotmail.com", 80); 111
113 112 if (msn_notification_connect(session->notification_conn,
114 if (msn_servconn_connect(session->notification_conn)) 113 "gateway.messenger.hotmail.com", 80))
114 {
115 return TRUE; 115 return TRUE;
116 }
116 } 117 }
117 else 118 else
118 { 119 {
119 session->dispatch_conn = msn_dispatch_new(session, 120 session->notification_conn = msn_notification_new(session);
120 session->dispatch_server, 121
121 session->dispatch_port); 122 if (msn_notification_connect(session->notification_conn,
122 123 session->dispatch_server,
123 if (msn_servconn_connect(session->dispatch_conn)) 124 session->dispatch_port))
125 {
124 return TRUE; 126 return TRUE;
127 }
125 } 128 }
126 129
127 return FALSE; 130 return FALSE;
128 } 131 }
129 132
130 void 133 void
131 msn_session_disconnect(MsnSession *session) 134 msn_session_disconnect(MsnSession *session)
132 { 135 {
133 g_return_if_fail(session != NULL); 136 g_return_if_fail(session != NULL);
134 g_return_if_fail(session->connected); 137 g_return_if_fail(session->connected);
135
136 if (session->dispatch_conn != NULL) {
137 msn_servconn_destroy(session->dispatch_conn);
138 session->dispatch_conn = NULL;
139 }
140 138
141 while (session->switches != NULL) { 139 while (session->switches != NULL) {
142 MsnSwitchBoard *board = (MsnSwitchBoard *)session->switches->data; 140 MsnSwitchBoard *board = (MsnSwitchBoard *)session->switches->data;
143 141
144 msn_switchboard_destroy(board); 142 msn_switchboard_destroy(board);