Mercurial > pidgin
comparison src/gtkconv.c @ 7961:aca39f227ea0
[gaim-migrate @ 8638]
if anyone reading this is not familliar with the concept of a "teleshot", IM me immediately
Happy Birthday Jon
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Wed, 31 Dec 2003 07:03:18 +0000 |
parents | 1b8261f374ea |
children | 6fca0d9cc98b |
comparison
equal
deleted
inserted
replaced
7960:0371ed7ed3ad | 7961:aca39f227ea0 |
---|---|
968 | 968 |
969 gtkconv->make_sound = | 969 gtkconv->make_sound = |
970 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)); | 970 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)); |
971 } | 971 } |
972 | 972 |
973 void | 973 static void |
974 im_cb(GtkWidget *widget, GaimConversation *conv) | 974 chat_do_im(GaimConversation *conv, const char *who) |
975 { | 975 { |
976 GaimPluginProtocolInfo *prpl_info = NULL; | |
977 char *real_who; | |
976 GaimConversation *conv2; | 978 GaimConversation *conv2; |
979 GaimAccount *account; | |
980 | |
981 account = gaim_conversation_get_account(conv); | |
982 | |
983 if(account && account->gc) | |
984 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl); | |
985 | |
986 if(prpl_info && prpl_info->get_cb_real_name) | |
987 real_who = prpl_info->get_cb_real_name(account->gc, | |
988 gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)), who); | |
989 else | |
990 real_who = g_strdup(who); | |
991 | |
992 if(!real_who) | |
993 return; | |
994 | |
995 conv2 = gaim_find_conversation_with_account(real_who, account); | |
996 | |
997 if (conv2 != NULL) | |
998 gaim_conv_window_show(gaim_conversation_get_window(conv2)); | |
999 else | |
1000 conv2 = gaim_conversation_new(GAIM_CONV_IM, account, real_who); | |
1001 | |
1002 g_free(real_who); | |
1003 } | |
1004 | |
1005 | |
1006 static void | |
1007 chat_im_button_cb(GtkWidget *widget, GaimConversation *conv) | |
1008 { | |
977 GaimGtkConversation *gtkconv; | 1009 GaimGtkConversation *gtkconv; |
978 GaimGtkChatPane *gtkchat; | 1010 GaimGtkChatPane *gtkchat; |
979 GaimAccount *account; | |
980 GtkTreeIter iter; | 1011 GtkTreeIter iter; |
981 GtkTreeModel *model; | 1012 GtkTreeModel *model; |
982 GtkTreeSelection *sel; | 1013 GtkTreeSelection *sel; |
983 const char *name; | 1014 const char *name; |
984 | 1015 |
991 if (gtk_tree_selection_get_selected(sel, NULL, &iter)) | 1022 if (gtk_tree_selection_get_selected(sel, NULL, &iter)) |
992 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 1, &name, -1); | 1023 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 1, &name, -1); |
993 else | 1024 else |
994 return; | 1025 return; |
995 | 1026 |
996 account = gaim_conversation_get_account(conv); | 1027 chat_do_im(conv, name); |
997 | |
998 conv2 = gaim_find_conversation_with_account(name, account); | |
999 | |
1000 if (conv2 != NULL) | |
1001 gaim_conv_window_raise(gaim_conversation_get_window(conv2)); | |
1002 else | |
1003 conv2 = gaim_conversation_new(GAIM_CONV_IM, account, name); | |
1004 } | 1028 } |
1005 | 1029 |
1006 static void | 1030 static void |
1007 ignore_cb(GtkWidget *w, GaimConversation *conv) | 1031 ignore_cb(GtkWidget *w, GaimConversation *conv) |
1008 { | 1032 { |
1035 gaim_conv_chat_unignore(chat, name); | 1059 gaim_conv_chat_unignore(chat, name); |
1036 else | 1060 else |
1037 gaim_conv_chat_ignore(chat, name); | 1061 gaim_conv_chat_ignore(chat, name); |
1038 | 1062 |
1039 add_chat_buddy_common(conv, name, pos); | 1063 add_chat_buddy_common(conv, name, pos); |
1040 } | |
1041 | |
1042 static void | |
1043 chat_do_im(GaimConversation *conv, const char *who) | |
1044 { | |
1045 GaimPluginProtocolInfo *prpl_info = NULL; | |
1046 char *real_who; | |
1047 GaimConversation *conv2; | |
1048 GaimAccount *account; | |
1049 | |
1050 account = gaim_conversation_get_account(conv); | |
1051 | |
1052 if(account && account->gc) | |
1053 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl); | |
1054 | |
1055 if(prpl_info && prpl_info->get_cb_real_name) | |
1056 real_who = prpl_info->get_cb_real_name(account->gc, | |
1057 gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)), who); | |
1058 else | |
1059 real_who = g_strdup(who); | |
1060 | |
1061 if(!real_who) | |
1062 return; | |
1063 | |
1064 conv2 = gaim_find_conversation_with_account(real_who, account); | |
1065 | |
1066 if (conv2 != NULL) | |
1067 gaim_conv_window_show(gaim_conversation_get_window(conv2)); | |
1068 else | |
1069 conv2 = gaim_conversation_new(GAIM_CONV_IM, account, real_who); | |
1070 | |
1071 g_free(real_who); | |
1072 } | 1064 } |
1073 | 1065 |
1074 static void | 1066 static void |
1075 menu_chat_im_cb(GtkWidget *w, GaimConversation *conv) | 1067 menu_chat_im_cb(GtkWidget *w, GaimConversation *conv) |
1076 { | 1068 { |
3629 GAIM_BUTTON_VERTICAL); | 3621 GAIM_BUTTON_VERTICAL); |
3630 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | 3622 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
3631 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); | 3623 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
3632 gtk_tooltips_set_tip(gtkconv->tooltips, button, _("IM the user"), NULL); | 3624 gtk_tooltips_set_tip(gtkconv->tooltips, button, _("IM the user"), NULL); |
3633 g_signal_connect(G_OBJECT(button), "clicked", | 3625 g_signal_connect(G_OBJECT(button), "clicked", |
3634 G_CALLBACK(im_cb), conv); | 3626 G_CALLBACK(chat_im_button_cb), conv); |
3635 | 3627 |
3636 gtk_widget_show(button); | 3628 gtk_widget_show(button); |
3637 | 3629 |
3638 /* Ignore */ | 3630 /* Ignore */ |
3639 button = gaim_pixbuf_button_from_stock(NULL, GAIM_STOCK_IGNORE, | 3631 button = gaim_pixbuf_button_from_stock(NULL, GAIM_STOCK_IGNORE, |