Mercurial > pidgin.yaz
changeset 25517:d28015a513a9
propagate from branch 'im.pidgin.pidgin' (head d2f50519c5ed668dd980277afdc25d71ccb8a852)
to branch 'im.pidgin.pidgin.yaz' (head f4fc3560d48d281deb0356c4e850871efd9c3c24)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 22 Jun 2007 11:22:20 +0000 |
parents | a573a67c80a4 (diff) 708198aadad8 (current diff) |
children | db41905e7cc4 |
files | pidgin/gtkconv.c pidgin/gtkimhtml.c pidgin/gtkprefs.c pidgin/gtkutils.c pidgin/gtkutils.h |
diffstat | 8 files changed, 69 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog.API Thu Jun 21 06:04:16 2007 +0000 +++ b/ChangeLog.API Fri Jun 22 11:22:20 2007 +0000 @@ -66,8 +66,8 @@ Added: * gtk_imhtml_setup_entry * pidgin_create_window - * pidgin_retrieve_user_info, shows immediate feedback when getting - information about a user. + * pidgin_retrieve_user_info and pidgin_retrieve_user_info_in_chat, + shows immediate feedback when getting information about a user. * gtk_imhtml_animation_new Can be used for inserting an animated image into an IMHTML. * pidgin_menu_position_func_helper
--- a/libpurple/plugins/perl/common/Conversation.xs Thu Jun 21 06:04:16 2007 +0000 +++ b/libpurple/plugins/perl/common/Conversation.xs Fri Jun 22 11:22:20 2007 +0000 @@ -62,6 +62,7 @@ const_iv(RAW), const_iv(IMAGES), const_iv(NOTIFY), + const_iv(NO_LINKIFY), }; static const constiv cbflags_const_iv[] = { #undef const_iv
--- a/pidgin/gtkblist.c Thu Jun 21 06:04:16 2007 +0000 +++ b/pidgin/gtkblist.c Fri Jun 22 11:22:20 2007 +0000 @@ -291,15 +291,30 @@ static void gtk_blist_join_chat(PurpleChat *chat) { PurpleConversation *conv; - - conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, - purple_chat_get_name(chat), + PurplePluginProtocolInfo *prpl_info; + const char *name; + char *chat_name; + + prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(chat->account))); + + if (prpl_info && prpl_info->get_chat_name) + chat_name = prpl_info->get_chat_name(chat->components); + else + chat_name = NULL; + + if (chat_name) + name = chat_name; + else + name = purple_chat_get_name(chat); + + conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, name, chat->account); if (conv != NULL) purple_conversation_present(conv); serv_join_chat(chat->account->gc, chat->components); + g_free(chat_name); } static void gtk_blist_menu_join_cb(GtkWidget *w, PurpleChat *chat)
--- a/pidgin/gtkconv.c Thu Jun 21 06:04:16 2007 +0000 +++ b/pidgin/gtkconv.c Fri Jun 22 11:22:20 2007 +0000 @@ -632,23 +632,10 @@ static void chat_do_info(PidginConversation *gtkconv, const char *who) { PurpleConversation *conv = gtkconv->active_conv; - PurplePluginProtocolInfo *prpl_info = NULL; PurpleConnection *gc; if ((gc = purple_conversation_get_gc(conv))) { - prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); - - /* - * If there are special needs for getting info on users in - * buddy chat "rooms"... - */ - if (prpl_info->get_cb_info != NULL) - { - prpl_info->get_cb_info(gc, - purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)), who); - } - else - pidgin_retrieve_user_info(gc, who); + pidgin_retrieve_user_info_in_chat(gc, who, purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv))); } } @@ -4445,20 +4432,21 @@ GTK_TREE_MODEL(gtkconv->infopane_model)); gtk_list_store_append(gtkconv->infopane_model, &(gtkconv->infopane_iter)); gtk_box_pack_start(GTK_BOX(gtkconv->infopane_hbox), gtkconv->infopane, TRUE, TRUE, 0); - path = gtk_tree_path_new_from_string("0"); - gtk_cell_view_set_displayed_row(GTK_CELL_VIEW(gtkconv->infopane), path); + path = gtk_tree_path_new_from_string("0"); + gtk_cell_view_set_displayed_row(GTK_CELL_VIEW(gtkconv->infopane), path); + gtk_tree_path_free(path); gtk_widget_set_size_request(gtkconv->infopane, -1, 32); gtk_widget_show(gtkconv->infopane); rend = gtk_cell_renderer_pixbuf_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(gtkconv->infopane), rend, FALSE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(gtkconv->infopane), rend, "pixbuf", ICON_COLUMN, NULL); - g_object_set(rend, "xalign", 0.0, "xpad", 6, "ypad", 0, NULL); + g_object_set(rend, "xalign", 0.0, "xpad", 6, "ypad", 0, NULL); rend = gtk_cell_renderer_text_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(gtkconv->infopane), rend, TRUE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(gtkconv->infopane), rend, "markup", TEXT_COLUMN, NULL); - g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL); + g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL); #if GTK_CHECK_VERSION(2, 6, 0) g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
--- a/pidgin/gtkimhtml.c Thu Jun 21 06:04:16 2007 +0000 +++ b/pidgin/gtkimhtml.c Fri Jun 22 11:22:20 2007 +0000 @@ -54,19 +54,6 @@ #include <windows.h> #endif -#ifdef ENABLE_NLS -# include <libintl.h> -# define _(x) gettext(x) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define N_(String) (String) -# define _(x) (x) -#endif - #include <pango/pango-font.h> /* GTK+ < 2.4.x hack, see pidgin.h for details. */
--- a/pidgin/gtkprefs.c Thu Jun 21 06:04:16 2007 +0000 +++ b/pidgin/gtkprefs.c Fri Jun 22 11:22:20 2007 +0000 @@ -1217,9 +1217,10 @@ } gtk_widget_show_all(ret); - if (proxy_info == NULL || + /* Only hide table if not running gnome otherwise we hide the IP address table! */ + if (!purple_running_gnome() && (proxy_info == NULL || purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_NONE || - purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_ENVVAR) + purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_ENVVAR)) gtk_widget_hide(table); return ret; }
--- a/pidgin/gtkutils.c Thu Jun 21 06:04:16 2007 +0000 +++ b/pidgin/gtkutils.c Fri Jun 22 11:22:20 2007 +0000 @@ -913,15 +913,44 @@ g_free(filename); } -void pidgin_retrieve_user_info(PurpleConnection *conn, const char *name) +static void +show_retrieveing_info(PurpleConnection *conn, const char *name) { PurpleNotifyUserInfo *info = purple_notify_user_info_new(); purple_notify_user_info_add_pair(info, _("Information"), _("Retrieving...")); purple_notify_userinfo(conn, name, info, NULL, NULL); purple_notify_user_info_destroy(info); +} + +void pidgin_retrieve_user_info(PurpleConnection *conn, const char *name) +{ + show_retrieveing_info(conn, name); serv_get_info(conn, name); } +void pidgin_retrieve_user_info_in_chat(PurpleConnection *conn, const char *name, int chat) +{ + char *who = NULL; + PurplePluginProtocolInfo *prpl_info = NULL; + + if (chat < 0) { + pidgin_retrieve_user_info(conn, name); + return; + } + + prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(conn->prpl); + if (prpl_info == NULL || prpl_info->get_cb_info == NULL) { + pidgin_retrieve_user_info(conn, name); + return; + } + + if (prpl_info->get_cb_real_name) + who = prpl_info->get_cb_real_name(conn, chat, name); + show_retrieveing_info(conn, who ? who : name); + prpl_info->get_cb_info(conn, chat, name); + g_free(who); +} + gboolean pidgin_parse_x_im_contact(const char *msg, gboolean all_accounts, PurpleAccount **ret_account, char **ret_protocol,
--- a/pidgin/gtkutils.h Thu Jun 21 06:04:16 2007 +0000 +++ b/pidgin/gtkutils.h Fri Jun 22 11:22:20 2007 +0000 @@ -329,6 +329,15 @@ void pidgin_retrieve_user_info(PurpleConnection *conn, const char *name); /** + * Get information about a user in a chat. Show immediate feedback. + * + * @param conn The connection to get information from. + * @param name The user to get information about. + * @param chatid The chat id. + */ +void pidgin_retrieve_user_info_in_chat(PurpleConnection *conn, const char *name, int chatid); + +/** * Parses an application/x-im-contact MIME message and returns the * data inside. *