comparison src/dialogs.c @ 9640:bc2079a32fd9

[gaim-migrate @ 10488] I warmenhoved patch 996233 from Jon Oberheide. Thanks Jon! From his description: The main purpose of this patch is to set the focus of a conversation when it is created. Currently, the focus is set when the conversation is created from: - double-clicking a buddy on the buddy list - right-clicking a buddy and clicking "IM" This patch sets the focus additionally for the following circumstances: - clicking "Buddies -> New Instant Message" - clicking "IM" buddy list button committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 02 Aug 2004 03:21:32 +0000
parents 15d09e546cee
children d49a19e8320c
comparison
equal deleted inserted replaced
9639:58625ebfe03a 9640:bc2079a32fd9
409 409
410 gtk_widget_show_all(window); 410 gtk_widget_show_all(window);
411 return TRUE; 411 return TRUE;
412 } 412 }
413 413
414 void
415 gaim_gtkdialogs_new_im(GaimAccount *account, const char *username)
416 {
417 GaimConversation *conv;
418 GaimConvWindow *win;
419
420 conv = gaim_find_conversation_with_account(username, account);
421
422 if (conv == NULL)
423 conv = gaim_conversation_new(GAIM_CONV_IM, account, username);
424
425 win = gaim_conversation_get_window(conv);
426
427 gaim_conv_window_raise(win);
428 gaim_conv_window_switch_conversation(win, gaim_conversation_get_index(conv));
429 }
430
414 static void 431 static void
415 new_im_cb(gpointer data, GaimRequestFields *fields) 432 new_im_cb(gpointer data, GaimRequestFields *fields)
416 { 433 {
434 GaimAccount *account;
417 const char *username; 435 const char *username;
418 GaimAccount *account; 436
419 GaimConversation *conv; 437 account = gaim_request_fields_get_account(fields, "account");
420
421 username = gaim_request_fields_get_string(fields, "screenname"); 438 username = gaim_request_fields_get_string(fields, "screenname");
422 account = gaim_request_fields_get_account(fields, "account"); 439
423 440 gaim_gtkdialogs_new_im(account, username);
424 conv = gaim_find_conversation_with_account(username, account);
425
426 if (conv == NULL)
427 conv = gaim_conversation_new(GAIM_CONV_IM, account, username);
428 else
429 gaim_conv_window_raise(gaim_conversation_get_window(conv));
430 } 441 }
431 442
432 void 443 void
433 show_im_dialog(void) 444 show_im_dialog(void)
434 { 445 {