comparison src/protocols/msn/switchboard.c @ 8499:467b01d02f9c

[gaim-migrate @ 9235] Multiple MSN chats should now work. Patch by Robert Mibus. Thanks! committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 25 Mar 2004 02:55:42 +0000
parents 3d0178c4f390
children fc27237783ee
comparison
equal deleted inserted replaced
8498:0a9b591278bc 8499:467b01d02f9c
191 GaimConversation *conv; 191 GaimConversation *conv;
192 192
193 conv = gaim_find_conversation_with_account( 193 conv = gaim_find_conversation_with_account(
194 msn_user_get_passport(swboard->user), account); 194 msn_user_get_passport(swboard->user), account);
195 195
196 swboard->chat = serv_got_joined_chat(gc, ++swboard->chat_id, 196 servconn->session->last_chat_id++;
197 swboard->chat_id = servconn->session->last_chat_id;
198 swboard->chat = serv_got_joined_chat(gc, swboard->chat_id,
197 "MSN Chat"); 199 "MSN Chat");
198 200
199 gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->chat), 201 gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->chat),
200 gaim_account_get_username(account), NULL); 202 gaim_account_get_username(account), NULL);
201 203
223 GaimConversation *conv; 225 GaimConversation *conv;
224 226
225 conv = gaim_find_conversation_with_account( 227 conv = gaim_find_conversation_with_account(
226 msn_user_get_passport(swboard->user), account); 228 msn_user_get_passport(swboard->user), account);
227 229
228 swboard->chat = serv_got_joined_chat(gc, ++swboard->chat_id, 230 servconn->session->last_chat_id++;
229 "MSN Chat"); 231 swboard->chat_id = servconn->session->last_chat_id;
232 swboard->chat = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat");
230 gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->chat), 233 gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->chat),
231 msn_user_get_passport(swboard->user), NULL); 234 msn_user_get_passport(swboard->user), NULL);
232 gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->chat), 235 gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->chat),
233 gaim_account_get_username(account), NULL); 236 gaim_account_get_username(account), NULL);
234 237
293 { 296 {
294 GaimConnection *gc = servconn->session->account->gc; 297 GaimConnection *gc = servconn->session->account->gc;
295 MsnSwitchBoard *swboard = servconn->data; 298 MsnSwitchBoard *swboard = servconn->data;
296 299
297 if (swboard->chat != NULL) 300 if (swboard->chat != NULL)
298 serv_got_chat_left(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(swboard->chat))); 301 {
302 serv_got_chat_left(gc,
303 gaim_conv_chat_get_id(GAIM_CONV_CHAT(swboard->chat)));
304 }
299 305
300 msn_switchboard_destroy(swboard); 306 msn_switchboard_destroy(swboard);
301 307
302 return FALSE; 308 return FALSE;
303 } 309 }
307 size_t param_count) 313 size_t param_count)
308 { 314 {
309 MsnSwitchBoard *swboard = servconn->data; 315 MsnSwitchBoard *swboard = servconn->data;
310 316
311 if (!msn_switchboard_send_command(swboard, "CAL", 317 if (!msn_switchboard_send_command(swboard, "CAL",
312 msn_user_get_passport(swboard->user))) { 318 msn_user_get_passport(swboard->user)))
319 {
313 msn_switchboard_destroy(swboard); 320 msn_switchboard_destroy(swboard);
314 321
315 return FALSE; 322 return FALSE;
316 } 323 }
317 324
355 g_free(pre_format); 362 g_free(pre_format);
356 g_free(post_format); 363 g_free(post_format);
357 } 364 }
358 365
359 if (swboard->chat != NULL) 366 if (swboard->chat != NULL)
360 serv_got_chat_in(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(swboard->chat)), 367 {
368 serv_got_chat_in(gc,
369 gaim_conv_chat_get_id(GAIM_CONV_CHAT(swboard->chat)),
361 servconn->msg_passport, 0, body, time(NULL)); 370 servconn->msg_passport, 0, body, time(NULL));
371 }
362 else 372 else
363 serv_got_im(gc, servconn->msg_passport, body, 0, time(NULL)); 373 serv_got_im(gc, servconn->msg_passport, body, 0, time(NULL));
364 374
365 g_free(body); 375 g_free(body);
366 376