Mercurial > pidgin
changeset 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 | 0371ed7ed3ad |
children | cc77bd88cd72 |
files | src/gtkconv.c src/gtkimhtml.c |
diffstat | 2 files changed, 36 insertions(+), 45 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkconv.c Wed Dec 31 04:37:12 2003 +0000 +++ b/src/gtkconv.c Wed Dec 31 07:03:18 2003 +0000 @@ -970,13 +970,44 @@ gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)); } -void -im_cb(GtkWidget *widget, GaimConversation *conv) +static void +chat_do_im(GaimConversation *conv, const char *who) { + GaimPluginProtocolInfo *prpl_info = NULL; + char *real_who; GaimConversation *conv2; + GaimAccount *account; + + account = gaim_conversation_get_account(conv); + + if(account && account->gc) + prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl); + + if(prpl_info && prpl_info->get_cb_real_name) + real_who = prpl_info->get_cb_real_name(account->gc, + gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)), who); + else + real_who = g_strdup(who); + + if(!real_who) + return; + + conv2 = gaim_find_conversation_with_account(real_who, account); + + if (conv2 != NULL) + gaim_conv_window_show(gaim_conversation_get_window(conv2)); + else + conv2 = gaim_conversation_new(GAIM_CONV_IM, account, real_who); + + g_free(real_who); +} + + +static void +chat_im_button_cb(GtkWidget *widget, GaimConversation *conv) +{ GaimGtkConversation *gtkconv; GaimGtkChatPane *gtkchat; - GaimAccount *account; GtkTreeIter iter; GtkTreeModel *model; GtkTreeSelection *sel; @@ -993,14 +1024,7 @@ else return; - account = gaim_conversation_get_account(conv); - - conv2 = gaim_find_conversation_with_account(name, account); - - if (conv2 != NULL) - gaim_conv_window_raise(gaim_conversation_get_window(conv2)); - else - conv2 = gaim_conversation_new(GAIM_CONV_IM, account, name); + chat_do_im(conv, name); } static void @@ -1040,38 +1064,6 @@ } static void -chat_do_im(GaimConversation *conv, const char *who) -{ - GaimPluginProtocolInfo *prpl_info = NULL; - char *real_who; - GaimConversation *conv2; - GaimAccount *account; - - account = gaim_conversation_get_account(conv); - - if(account && account->gc) - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl); - - if(prpl_info && prpl_info->get_cb_real_name) - real_who = prpl_info->get_cb_real_name(account->gc, - gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)), who); - else - real_who = g_strdup(who); - - if(!real_who) - return; - - conv2 = gaim_find_conversation_with_account(real_who, account); - - if (conv2 != NULL) - gaim_conv_window_show(gaim_conversation_get_window(conv2)); - else - conv2 = gaim_conversation_new(GAIM_CONV_IM, account, real_who); - - g_free(real_who); -} - -static void menu_chat_im_cb(GtkWidget *w, GaimConversation *conv) { const char *who = g_object_get_data(G_OBJECT(w), "user_data"); @@ -3631,7 +3623,7 @@ gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); gtk_tooltips_set_tip(gtkconv->tooltips, button, _("IM the user"), NULL); g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(im_cb), conv); + G_CALLBACK(chat_im_button_cb), conv); gtk_widget_show(button);
--- a/src/gtkimhtml.c Wed Dec 31 04:37:12 2003 +0000 +++ b/src/gtkimhtml.c Wed Dec 31 07:03:18 2003 +0000 @@ -2527,7 +2527,6 @@ } gtk_text_iter_forward_char(&iter); } - closers = g_list_reverse(closers); while (closers) { GtkIMHtmlFormatSpan *span = (GtkIMHtmlFormatSpan*)closers->data; str = g_string_append(str, span->end_tag);