comparison src/gtkconv.c @ 6695:0c5637b5462e

[gaim-migrate @ 7221] This is contact support. Really. It has a few bugs left in it, like sorting not working, and stuff like that, but it's pretty solid for the most part. I'm not in the mood to do a whole lot of typing, so just use and enjoy. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 02 Sep 2003 03:41:10 +0000
parents 314111e7b601
children e62a504c83d0
comparison
equal deleted inserted replaced
6694:2d2f04c5c7d2 6695:0c5637b5462e
454 454
455 static void 455 static void
456 add_cb(GtkWidget *widget, GaimConversation *conv) 456 add_cb(GtkWidget *widget, GaimConversation *conv)
457 { 457 {
458 GaimConnection *gc; 458 GaimConnection *gc;
459 struct buddy *b; 459 GaimBuddy *b;
460 const char *name; 460 const char *name;
461 461
462 gc = gaim_conversation_get_gc(conv); 462 gc = gaim_conversation_get_gc(conv);
463 name = gaim_conversation_get_name(conv); 463 name = gaim_conversation_get_name(conv);
464 b = gaim_find_buddy(gc->account, name); 464 b = gaim_find_buddy(gc->account, name);
732 static void 732 static void
733 menu_alias_cb(gpointer data, guint action, GtkWidget *widget) 733 menu_alias_cb(gpointer data, guint action, GtkWidget *widget)
734 { 734 {
735 GaimWindow *win = (GaimWindow *)data; 735 GaimWindow *win = (GaimWindow *)data;
736 GaimConversation *conv; 736 GaimConversation *conv;
737 struct buddy *b; 737 GaimBuddy *b;
738 738
739 conv = gaim_window_get_active_conversation(win); 739 conv = gaim_window_get_active_conversation(win);
740 740
741 b = gaim_find_buddy(gaim_conversation_get_account(conv), 741 b = gaim_find_buddy(gaim_conversation_get_account(conv),
742 gaim_conversation_get_name(conv)); 742 gaim_conversation_get_name(conv));
989 989
990 static void 990 static void
991 menu_chat_add_cb(GtkWidget *w, GaimConversation *conv) 991 menu_chat_add_cb(GtkWidget *w, GaimConversation *conv)
992 { 992 {
993 GaimConnection *gc; 993 GaimConnection *gc;
994 struct buddy *b; 994 GaimBuddy *b;
995 char *name; 995 char *name;
996 996
997 gc = gaim_conversation_get_gc(conv); 997 gc = gaim_conversation_get_gc(conv);
998 name = g_object_get_data(G_OBJECT(w), "user_data"); 998 name = g_object_get_data(G_OBJECT(w), "user_data");
999 b = gaim_find_buddy(gc->account, name); 999 b = gaim_find_buddy(gc->account, name);
1466 1466
1467 /* We deleted all the text, so turn off typing. */ 1467 /* We deleted all the text, so turn off typing. */
1468 if (gaim_im_get_type_again_timeout(im)) 1468 if (gaim_im_get_type_again_timeout(im))
1469 gaim_im_stop_type_again_timeout(im); 1469 gaim_im_stop_type_again_timeout(im);
1470 1470
1471 /* XXX The (char *) should go away! Somebody add consts to stuff! */
1472 serv_send_typing(gaim_conversation_get_gc(conv), 1471 serv_send_typing(gaim_conversation_get_gc(conv),
1473 (char *)gaim_conversation_get_name(conv), 1472 gaim_conversation_get_name(conv),
1474 GAIM_NOT_TYPING); 1473 GAIM_NOT_TYPING);
1475 } 1474 }
1476 else { 1475 else {
1477 /* We're deleting, but not all of it, so it counts as typing. */ 1476 /* We're deleting, but not all of it, so it counts as typing. */
1478 got_typing_keypress(conv, FALSE); 1477 got_typing_keypress(conv, FALSE);
2460 } 2459 }
2461 2460
2462 static GList * 2461 static GList *
2463 generate_invite_user_names(GaimConnection *gc) 2462 generate_invite_user_names(GaimConnection *gc)
2464 { 2463 {
2465 GaimBlistNode *gnode,*bnode; 2464 GaimBlistNode *gnode,*cnode,*bnode;
2466 struct group *g;
2467 struct buddy *buddy;
2468 static GList *tmp = NULL; 2465 static GList *tmp = NULL;
2469 2466
2470 if (tmp) 2467 if (tmp)
2471 g_list_free(tmp); 2468 g_list_free(tmp);
2472 2469
2474 2471
2475 if (gc != NULL) { 2472 if (gc != NULL) {
2476 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { 2473 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) {
2477 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) 2474 if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
2478 continue; 2475 continue;
2479 g = (struct group *)gnode; 2476 for(cnode = gnode->child; cnode; cnode = cnode->next) {
2480 for(bnode = gnode->child; bnode; bnode = bnode->next) { 2477 if(!GAIM_BLIST_NODE_IS_CONTACT(cnode))
2481 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
2482 continue; 2478 continue;
2483 buddy = (struct buddy *)bnode; 2479 for(bnode = cnode->child; bnode; bnode = bnode->next) {
2484 2480 GaimBuddy *buddy;
2485 if (buddy->account == gc->account && GAIM_BUDDY_IS_ONLINE(buddy)) 2481
2486 tmp = g_list_append(tmp, buddy->name); 2482 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
2483 continue;
2484
2485 buddy = (GaimBuddy *)bnode;
2486
2487 if (buddy->account == gc->account &&
2488 GAIM_BUDDY_IS_ONLINE(buddy))
2489 tmp = g_list_append(tmp, buddy->name);
2490 }
2487 } 2491 }
2488 } 2492 }
2489 } 2493 }
2490 2494
2491 return tmp; 2495 return tmp;
3635 GaimWindow *win = conv->window; 3639 GaimWindow *win = conv->window;
3636 GaimConversation *c; 3640 GaimConversation *c;
3637 3641
3638 if (sd->target == gdk_atom_intern("GAIM_BLIST_NODE", FALSE)) { 3642 if (sd->target == gdk_atom_intern("GAIM_BLIST_NODE", FALSE)) {
3639 GaimBlistNode *n = NULL; 3643 GaimBlistNode *n = NULL;
3644 GaimBuddy *b;
3640 memcpy(&n, sd->data, sizeof(n)); 3645 memcpy(&n, sd->data, sizeof(n));
3641 3646
3642 if (!GAIM_BLIST_NODE_IS_BUDDY(n)) 3647 if (GAIM_BLIST_NODE_IS_CONTACT(n))
3648 b = gaim_contact_get_priority_buddy((GaimContact*)n);
3649 else if (GAIM_BLIST_NODE_IS_BUDDY(n))
3650 b = (GaimBuddy*)n;
3651 else
3643 return; 3652 return;
3644 3653
3645 c = gaim_conversation_new(GAIM_CONV_IM, 3654 c = gaim_conversation_new(GAIM_CONV_IM,
3646 ((struct buddy *)n)->account, 3655 ((GaimBuddy *)n)->account,
3647 ((struct buddy *)n)->name); 3656 ((GaimBuddy *)n)->name);
3648 3657
3649 gaim_window_add_conversation(win, c); 3658 gaim_window_add_conversation(win, c);
3650 } 3659 }
3651 } 3660 }
3652 3661
4845 update_tab_icon(GaimConversation *conv) 4854 update_tab_icon(GaimConversation *conv)
4846 { 4855 {
4847 GaimGtkConversation *gtkconv; 4856 GaimGtkConversation *gtkconv;
4848 GaimAccount *account; 4857 GaimAccount *account;
4849 const char *name; 4858 const char *name;
4850 struct buddy *b; 4859 GaimBuddy *b;
4851 4860
4852 gtkconv = GAIM_GTK_CONVERSATION(conv); 4861 gtkconv = GAIM_GTK_CONVERSATION(conv);
4853 name = gaim_conversation_get_name(conv); 4862 name = gaim_conversation_get_name(conv);
4854 account = gaim_conversation_get_account(conv); 4863 account = gaim_conversation_get_account(conv);
4855 4864
5196 char filename[256]; 5205 char filename[256];
5197 FILE *file; 5206 FILE *file;
5198 GError *err = NULL; 5207 GError *err = NULL;
5199 gboolean animate = TRUE; 5208 gboolean animate = TRUE;
5200 5209
5201 struct buddy *buddy; 5210 GaimBuddy *buddy;
5202 5211
5203 void *data; 5212 void *data;
5204 int len, delay; 5213 int len, delay;
5205 5214
5206 GdkPixbuf *buf; 5215 GdkPixbuf *buf;