# HG changeset patch # User Ka-Hing Cheung # Date 1182484510 0 # Node ID c9bcf4f11e30ba0c7d5007bb864e6be152be4d51 # Parent a573a67c80a4f333861f9585c37cc355b7ad7c8a# Parent db286cc82bd13049a712ebb5ef332a0cd4d545ae propagate from branch 'im.pidgin.pidgin' (head d2f50519c5ed668dd980277afdc25d71ccb8a852) to branch 'im.pidgin.cpw.khc.msnp14' (head db21070ea9f1444ccaafe34fcc3dd308490ca743) diff -r db286cc82bd1 -r c9bcf4f11e30 ChangeLog.API --- a/ChangeLog.API Tue Jun 19 17:28:41 2007 +0000 +++ b/ChangeLog.API Fri Jun 22 03:55:10 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 diff -r db286cc82bd1 -r c9bcf4f11e30 finch/finch.c --- a/finch/finch.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/finch.c Fri Jun 22 03:55:10 2007 +0000 @@ -19,6 +19,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "finch.h" + #include "account.h" #include "conversation.h" #include "core.h" @@ -37,7 +39,6 @@ #include "whiteboard.h" #include "gntdebug.h" -#include "finch.h" #include "gntprefs.h" #include "gntui.h" #include "gntidle.h" diff -r db286cc82bd1 -r c9bcf4f11e30 finch/gntaccount.c --- a/finch/gntaccount.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/gntaccount.c Fri Jun 22 03:55:10 2007 +0000 @@ -33,6 +33,8 @@ #include #include +#include "finch.h" + #include #include #include @@ -42,7 +44,6 @@ #include "gntaccount.h" #include "gntblist.h" -#include "finch.h" #include diff -r db286cc82bd1 -r c9bcf4f11e30 finch/gntblist.c --- a/finch/gntblist.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/gntblist.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "finch.h" + #include #include #include @@ -33,7 +35,6 @@ #include #include "debug.h" -#include "finch.h" #include "gntbox.h" #include "gntcombobox.h" #include "gntentry.h" diff -r db286cc82bd1 -r c9bcf4f11e30 finch/gntconn.c --- a/finch/gntconn.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/gntconn.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "finch.h" + #include "account.h" #include "core.h" #include "connection.h" @@ -29,7 +31,6 @@ #include "request.h" #include "gntconn.h" -#include "finch.h" #define INITIAL_RECON_DELAY_MIN 8000 #define INITIAL_RECON_DELAY_MAX 60000 diff -r db286cc82bd1 -r c9bcf4f11e30 finch/gntconv.c --- a/finch/gntconv.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/gntconv.c Fri Jun 22 03:55:10 2007 +0000 @@ -24,12 +24,13 @@ */ #include +#include "finch.h" + #include #include #include #include -#include "finch.h" #include "gntaccount.h" #include "gntblist.h" #include "gntconv.h" diff -r db286cc82bd1 -r c9bcf4f11e30 finch/gntnotify.c --- a/finch/gntnotify.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/gntnotify.c Fri Jun 22 03:55:10 2007 +0000 @@ -29,10 +29,11 @@ #include #include +#include "finch.h" + #include #include "gntnotify.h" -#include "finch.h" static struct { diff -r db286cc82bd1 -r c9bcf4f11e30 finch/gntplugin.c --- a/finch/gntplugin.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/gntplugin.c Fri Jun 22 03:55:10 2007 +0000 @@ -29,10 +29,11 @@ #include #include +#include "finch.h" + #include "notify.h" #include "request.h" -#include "finch.h" #include "gntplugin.h" #include "gntrequest.h" diff -r db286cc82bd1 -r c9bcf4f11e30 finch/gntprefs.c --- a/finch/gntprefs.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/gntprefs.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,10 +22,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "finch.h" + #include #include -#include "finch.h" #include "gntprefs.h" #include "gntrequest.h" diff -r db286cc82bd1 -r c9bcf4f11e30 finch/gntstatus.c --- a/finch/gntstatus.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/gntstatus.c Fri Jun 22 03:55:10 2007 +0000 @@ -31,10 +31,11 @@ #include #include +#include "finch.h" + #include #include -#include "finch.h" #include "gntstatus.h" static struct diff -r db286cc82bd1 -r c9bcf4f11e30 finch/gntui.c --- a/finch/gntui.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/gntui.c Fri Jun 22 03:55:10 2007 +0000 @@ -19,6 +19,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "gntui.h" #include "gntaccount.h" @@ -33,7 +35,6 @@ #include "gntprefs.h" #include "gntrequest.h" #include "gntstatus.h" -#include "internal.h" #include diff -r db286cc82bd1 -r c9bcf4f11e30 finch/libgnt/gntfilesel.c --- a/finch/libgnt/gntfilesel.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/libgnt/gntfilesel.c Fri Jun 22 03:55:10 2007 +0000 @@ -46,6 +46,7 @@ static GntWindowClass *parent_class = NULL; static guint signals[SIGS] = { 0 }; static void (*orig_map)(GntWidget *widget); +static void (*orig_size_request)(GntWidget *widget); static void gnt_file_sel_destroy(GntWidget *widget) @@ -552,6 +553,19 @@ } static void +gnt_file_sel_size_request(GntWidget *widget) +{ + GntFileSel *sel; + if (widget->priv.height > 0) + return; + + sel = GNT_FILE_SEL(widget); + sel->dirs->priv.height = 16; + sel->files->priv.height = 16; + orig_size_request(widget); +} + +static void gnt_file_sel_class_init(GntFileSelClass *klass) { GntBindableClass *bindable = GNT_BINDABLE_CLASS(klass); @@ -560,6 +574,8 @@ kl->destroy = gnt_file_sel_destroy; orig_map = kl->map; kl->map = gnt_file_sel_map; + orig_size_request = kl->size_request; + kl->size_request = gnt_file_sel_size_request; signals[SIG_FILE_SELECTED] = g_signal_new("file_selected", diff -r db286cc82bd1 -r c9bcf4f11e30 finch/libgnt/gntmain.c --- a/finch/libgnt/gntmain.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/libgnt/gntmain.c Fri Jun 22 03:55:10 2007 +0000 @@ -429,10 +429,14 @@ setup_io(); +#ifdef NO_WIDECHAR + ascii_only = TRUE; +#else if (locale && (strstr(locale, "UTF") || strstr(locale, "utf"))) ascii_only = FALSE; else ascii_only = TRUE; +#endif initscr(); typeahead(-1); diff -r db286cc82bd1 -r c9bcf4f11e30 finch/libgnt/gntwm.c --- a/finch/libgnt/gntwm.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/libgnt/gntwm.c Fri Jun 22 03:55:10 2007 +0000 @@ -1464,12 +1464,39 @@ return FALSE; } +#if !GLIB_CHECK_VERSION(2,4,0) +typedef struct +{ + GntWM *wm; + GntWS *ret; + gchar *title; +} title_search; + +static void match_title_search(gpointer key, gpointer value, gpointer search) +{ + title_search *s = search; + if (s->ret) + return; + if (match_title(key, NULL, s->title)) + s->ret = g_hash_table_lookup(s->wm->title_places, key); +} +#endif + static GntWS * new_widget_find_workspace(GntWM *wm, GntWidget *widget, gchar *wid_title) { GntWS *ret; const gchar *name; +#if GLIB_CHECK_VERSION(2,4,0) ret = g_hash_table_find(wm->title_places, match_title, wid_title); +#else + title_search *s = NULL; + s = g_new0(title_search, 1); + s->wm = wm; + s->title = wid_title; + g_hash_table_foreach(wm->title_places, match_title_search, s); + ret = s->ret; +#endif if (ret) return ret; name = gnt_widget_get_name(widget); diff -r db286cc82bd1 -r c9bcf4f11e30 finch/libgnt/wms/s.c --- a/finch/libgnt/wms/s.c Tue Jun 19 17:28:41 2007 +0000 +++ b/finch/libgnt/wms/s.c Fri Jun 22 03:55:10 2007 +0000 @@ -1,6 +1,8 @@ #include #include +#include "internal.h" + #include "gnt.h" #include "gntbox.h" #include "gntmenu.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/accountopt.c --- a/libpurple/accountopt.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/accountopt.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "accountopt.h" #include "util.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/cmds.c --- a/libpurple/cmds.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/cmds.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ #include +#include "internal.h" + #include "account.h" #include "util.h" #include "cmds.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/core.c --- a/libpurple/core.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/core.c Fri Jun 22 03:55:10 2007 +0000 @@ -512,7 +512,7 @@ if ((linklen = readlink(name, buf, sizeof(buf) - 1) == -1)) { - char *name_utf8 = g_filename_to_utf8(name); + char *name_utf8 = g_filename_to_utf8(name, -1, NULL, NULL, NULL); purple_debug_error("core", "Error reading symlink %s: %s. Please report this at http://developer.pidgin.im\n", name_utf8, strerror(errno)); g_free(name_utf8); diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/debug.c diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/example/nullclient.c --- a/libpurple/example/nullclient.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/example/nullclient.c Fri Jun 22 03:55:10 2007 +0000 @@ -20,6 +20,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ + +/* XXX: we probably shouldn't include internal.h in examples */ +#include "internal.h" + #include "account.h" #include "conversation.h" #include "core.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/imgstore.c --- a/libpurple/imgstore.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/imgstore.c Fri Jun 22 03:55:10 2007 +0000 @@ -25,6 +25,8 @@ */ #include +#include "internal.h" + #include "dbus-maybe.h" #include "debug.h" #include "imgstore.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/imgstore.h --- a/libpurple/imgstore.h Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/imgstore.h Fri Jun 22 03:55:10 2007 +0000 @@ -28,7 +28,6 @@ #include -struct _PurpleStoredImage; typedef struct _PurpleStoredImage PurpleStoredImage; #ifdef __cplusplus diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/internal.h --- a/libpurple/internal.h Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/internal.h Fri Jun 22 03:55:10 2007 +0000 @@ -112,6 +112,14 @@ # include #endif +#ifndef MAXPATHLEN +# ifdef PATH_MAX +# define MAXPATHLEN PATH_MAX +# else +# define MAXPATHLEN 1024 +# endif +#endif + #ifndef HOST_NAME_MAX # define HOST_NAME_MAX 255 #endif @@ -171,6 +179,14 @@ # endif #endif +#ifndef G_GNUC_NULL_TERMINATED +# if __GNUC__ >= 4 +# define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__)) +# else +# define G_GNUC_NULL_TERMINATED +# endif +#endif + /* Safer ways to work with static buffers. When using non-static * buffers, either use g_strdup_* functions (preferred) or use * g_strlcpy/g_strlcpy directly. */ diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/mime.c --- a/libpurple/mime.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/mime.c Fri Jun 22 03:55:10 2007 +0000 @@ -29,6 +29,8 @@ #include #include +#include "internal.h" + /* this should become "util.h" if we ever get this into purple proper */ #include "debug.h" #include "mime.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/ntlm.c --- a/libpurple/ntlm.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/ntlm.c Fri Jun 22 03:55:10 2007 +0000 @@ -25,6 +25,8 @@ #include #include +#include "internal.h" + #include "util.h" #include "ntlm.h" #include "cipher.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/plugins/perl/common/Conversation.xs --- a/libpurple/plugins/perl/common/Conversation.xs Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/plugins/perl/common/Conversation.xs Fri Jun 22 03:55:10 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 diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/plugins/perl/perl-common.h --- a/libpurple/plugins/perl/perl-common.h Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/plugins/perl/perl-common.h Fri Jun 22 03:55:10 2007 +0000 @@ -9,6 +9,9 @@ #include #include +/* XXX: perl defines it's own _ but I think it's safe to undef it */ +#undef _ +#include "internal.h" #include "plugin.h" #include "value.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/gg/gg.h --- a/libpurple/protocols/gg/gg.h Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/gg/gg.h Fri Jun 22 03:55:10 2007 +0000 @@ -25,6 +25,7 @@ #define _PURPLE_GG_H #include +#include "internal.h" #include "search.h" #include "connection.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/jabber/libxmpp.c --- a/libpurple/protocols/jabber/libxmpp.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/jabber/libxmpp.c Fri Jun 22 03:55:10 2007 +0000 @@ -25,8 +25,9 @@ * share code. */ +#include "internal.h" + #include "accountopt.h" -#include "internal.h" #include "version.h" #include "iq.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/jabber/si.c --- a/libpurple/protocols/jabber/si.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/jabber/si.c Fri Jun 22 03:55:10 2007 +0000 @@ -20,9 +20,9 @@ * */ -#include "blist.h" +#include "internal.h" -#include "internal.h" +#include "blist.h" #include "cipher.h" #include "debug.h" #include "ft.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/oscar/oscar.c Fri Jun 22 03:55:10 2007 +0000 @@ -5573,7 +5573,7 @@ status = purple_presence_get_active_status(presence); id = purple_status_get_id(status); - if (!purple_presence_is_online(presence)) + if ((od != NULL) && !purple_presence_is_online(presence)) { char *gname = aim_ssi_itemlist_findparentname(od->ssi.local, b->name); if (aim_ssi_waitingforauth(od->ssi.local, gname, b->name)) diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/Makefile.am --- a/libpurple/protocols/qq/Makefile.am Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/Makefile.am Fri Jun 22 03:55:10 2007 +0000 @@ -34,8 +34,6 @@ group_info.h \ group_join.c \ group_join.h \ - group_misc.c \ - group_misc.h \ group_network.c \ group_network.h \ group_opt.c \ diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/buddy_list.c --- a/libpurple/protocols/qq/buddy_list.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/buddy_list.c Fri Jun 22 03:55:10 2007 +0000 @@ -23,8 +23,10 @@ */ #include + +#include "qq.h" + #include "debug.h" - #include "notify.h" #include "utils.h" #include "packet_parse.h" @@ -35,9 +37,8 @@ #include "char_conv.h" #include "crypt.h" #include "header_info.h" -#include "keep_alive.h" +#include "keep_alive.h" #include "send_core.h" -#include "qq.h" #include "group.h" #include "group_find.h" #include "group_internal.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/buddy_status.c --- a/libpurple/protocols/qq/buddy_status.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/buddy_status.c Fri Jun 22 03:55:10 2007 +0000 @@ -23,6 +23,7 @@ */ #include +#include "internal.h" #include "debug.h" #include "prefs.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/file_trans.c --- a/libpurple/protocols/qq/file_trans.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/file_trans.c Fri Jun 22 03:55:10 2007 +0000 @@ -26,6 +26,8 @@ #define random rand #endif +#include "internal.h" + #include "debug.h" #include "ft.h" #include "cipher.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_conv.c --- a/libpurple/protocols/qq/group_conv.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/group_conv.c Fri Jun 22 03:55:10 2007 +0000 @@ -23,11 +23,12 @@ */ #include +#include "qq.h" + #include "conversation.h" #include "buddy_status.h" #include "group_conv.h" -#include "qq.h" #include "utils.h" /* show group conversation window */ diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_find.c --- a/libpurple/protocols/qq/group_find.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/group_find.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,13 +22,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "qq.h" + #include "conversation.h" #include "debug.h" #include "util.h" #include "group_find.h" #include "group_network.h" -#include "qq.h" #include "utils.h" /* find the internal_group_id by the reply packet sequence diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_free.c --- a/libpurple/protocols/qq/group_free.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/group_free.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "debug.h" #include "buddy_status.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_im.c --- a/libpurple/protocols/qq/group_im.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/group_im.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "conversation.h" #include "debug.h" #include "notify.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_info.c --- a/libpurple/protocols/qq/group_info.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/group_info.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "conversation.h" #include "debug.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_internal.c --- a/libpurple/protocols/qq/group_internal.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/group_internal.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,13 +22,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" #include "blist.h" #include "debug.h" #include "buddy_opt.h" #include "group_free.h" #include "group_internal.h" -#include "group_misc.h" #include "utils.h" static gchar *_qq_group_set_my_status_desc(qq_group *group) diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_join.c --- a/libpurple/protocols/qq/group_join.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/group_join.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "debug.h" #include "notify.h" #include "request.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_misc.c --- a/libpurple/protocols/qq/group_misc.c Tue Jun 19 17:28:41 2007 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/** - * @file group_misc.c - * - * purple - * - * Purple is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "debug.h" - -#include "buddy_status.h" -#include "group_misc.h" -#include "utils.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_misc.h --- a/libpurple/protocols/qq/group_misc.h Tue Jun 19 17:28:41 2007 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/** - * @file group_misc.h - * - * purple - * - * Purple is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _QQ_GROUP_MISC_H_ -#define _QQ_GROUP_MISC_H_ - -#include -#include "group.h" - -#endif diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_network.c --- a/libpurple/protocols/qq/group_network.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/group_network.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "debug.h" #include "notify.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_opt.c --- a/libpurple/protocols/qq/group_opt.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/group_opt.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "qq.h" + #include "debug.h" #include "notify.h" #include "request.h" @@ -35,7 +37,6 @@ #include "group_network.h" #include "group_opt.h" #include "packet_parse.h" -#include "qq.h" #include "utils.h" /* TODO: can't we use qsort here? */ diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/group_search.c --- a/libpurple/protocols/qq/group_search.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/group_search.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "debug.h" #include "char_conv.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/header_info.c --- a/libpurple/protocols/qq/header_info.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/header_info.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "header_info.h" #define QQ_CLIENT_062E 0x062e /* GB QQ2000c build 0630 */ diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/im.c --- a/libpurple/protocols/qq/im.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/im.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "conversation.h" #include "debug.h" #include "internal.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/keep_alive.c --- a/libpurple/protocols/qq/keep_alive.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/keep_alive.c Fri Jun 22 03:55:10 2007 +0000 @@ -28,6 +28,8 @@ * Puzzlebird, Nov-Dec 2002 */ +#include "internal.h" + #include "debug.h" #include "server.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/qq.h --- a/libpurple/protocols/qq/qq.h Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/qq.h Fri Jun 22 03:55:10 2007 +0000 @@ -26,8 +26,8 @@ #define _QQ_QQ_H_ #include +#include "internal.h" #include "ft.h" -#include "internal.h" #include "proxy.h" #include "roomlist.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/send_file.c --- a/libpurple/protocols/qq/send_file.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/send_file.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "qq.h" + #include "send_file.h" #include "debug.h" #include "network.h" @@ -34,7 +36,6 @@ #include "im.h" #include "keep_alive.h" #include "packet_parse.h" -#include "qq.h" #include "send_core.h" #include "utils.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/qq/sendqueue.c --- a/libpurple/protocols/qq/sendqueue.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/qq/sendqueue.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,9 +22,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "connection.h" #include "debug.h" -#include "internal.h" #include "notify.h" #include "prefs.h" #include "request.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/yahoo/yahoo_auth.c --- a/libpurple/protocols/yahoo/yahoo_auth.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_auth.c Fri Jun 22 03:55:10 2007 +0000 @@ -7,6 +7,8 @@ * */ +#include "internal.h" + #include "yahoo.h" #include "yahoo_auth.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/yahoo/yahoo_filexfer.c --- a/libpurple/protocols/yahoo/yahoo_filexfer.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Fri Jun 22 03:55:10 2007 +0000 @@ -20,8 +20,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "prpl.h" -#include "internal.h" #include "util.h" #include "debug.h" #include "notify.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/yahoo/yahoochat.c --- a/libpurple/protocols/yahoo/yahoochat.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoochat.c Fri Jun 22 03:55:10 2007 +0000 @@ -26,6 +26,8 @@ * */ +#include "internal.h" + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -37,7 +39,6 @@ #include "conversation.h" #include "notify.h" #include "util.h" -#include "internal.h" #include "yahoo.h" #include "yahoo_packet.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/protocols/zephyr/ZVariables.c --- a/libpurple/protocols/zephyr/ZVariables.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/protocols/zephyr/ZVariables.c Fri Jun 22 03:55:10 2007 +0000 @@ -9,6 +9,7 @@ * "mit-copyright.h". */ +#include "libpurple/internal.h" #include "internal.h" #include "util.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/request.c --- a/libpurple/request.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/request.c Fri Jun 22 03:55:10 2007 +0000 @@ -22,6 +22,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "notify.h" #include "request.h" #include "debug.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/roomlist.c --- a/libpurple/roomlist.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/roomlist.c Fri Jun 22 03:55:10 2007 +0000 @@ -25,6 +25,8 @@ #include +#include "internal.h" + #include "account.h" #include "connection.h" #include "debug.h" diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/savedstatuses.c --- a/libpurple/savedstatuses.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/savedstatuses.c Fri Jun 22 03:55:10 2007 +0000 @@ -29,6 +29,7 @@ #include "notify.h" #include "savedstatuses.h" #include "dbus-maybe.h" +#include "request.h" #include "status.h" #include "util.h" #include "xmlnode.h" @@ -110,6 +111,7 @@ g_return_if_fail(substatus != NULL); g_free(substatus->message); + purple_request_close_with_handle(substatus); PURPLE_DBUS_UNREGISTER_POINTER(substatus); g_free(substatus); } @@ -128,7 +130,7 @@ status->substatuses = g_list_remove(status->substatuses, substatus); free_saved_status_sub(substatus); } - + purple_request_close_with_handle(status); PURPLE_DBUS_UNREGISTER_POINTER(status); g_free(status); } diff -r db286cc82bd1 -r c9bcf4f11e30 libpurple/whiteboard.c --- a/libpurple/whiteboard.c Tue Jun 19 17:28:41 2007 +0000 +++ b/libpurple/whiteboard.c Fri Jun 22 03:55:10 2007 +0000 @@ -23,6 +23,7 @@ #include +#include "internal.h" #include "whiteboard.h" #include "prpl.h" diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtkblist.c --- a/pidgin/gtkblist.c Tue Jun 19 17:28:41 2007 +0000 +++ b/pidgin/gtkblist.c Fri Jun 22 03:55:10 2007 +0000 @@ -151,11 +151,7 @@ if (!gtkblist) return "dim grey"; if (!dim_grey_string[0]) { - GtkStyle *style = gtk_widget_get_style(gtkblist->treeview); - snprintf(dim_grey_string, sizeof(dim_grey_string), "#%02x%02x%02x", - style->text_aa[GTK_STATE_NORMAL].red >> 8, - style->text_aa[GTK_STATE_NORMAL].green >> 8, - style->text_aa[GTK_STATE_NORMAL].blue >> 8); + snprintf(dim_grey_string, sizeof(dim_grey_string), "%s", pidgin_get_dim_grey_string(gtkblist->treeview)); } return dim_grey_string; } @@ -295,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) @@ -311,6 +322,7 @@ gtk_blist_join_chat(chat); } +#if GTK_CHECK_VERSION(2,6,0) static void gtk_blist_renderer_editing_cancelled_cb(GtkCellRenderer *renderer, PurpleBuddyList *list) { editing_blist = FALSE; @@ -355,6 +367,7 @@ } editing_blist = TRUE; } +#endif static void gtk_blist_renderer_edited_cb(GtkCellRendererText *text_rend, char *arg1, char *arg2, PurpleBuddyList *list) @@ -2092,51 +2105,6 @@ } } -static void -roundify(GdkPixbuf *pixbuf) { - int width, height, rowstride; - guchar *pixels; - - if (!gdk_pixbuf_get_has_alpha(pixbuf)) - return; - - width = gdk_pixbuf_get_width(pixbuf); - height = gdk_pixbuf_get_height(pixbuf); - rowstride = gdk_pixbuf_get_rowstride(pixbuf); - pixels = gdk_pixbuf_get_pixels(pixbuf); - - if (width < 6 || height < 6) - return; - - /* Top left */ - pixels[3] = 0; - pixels[7] = 0x80; - pixels[11] = 0xC0; - pixels[rowstride + 3] = 0x80; - pixels[rowstride * 2 + 3] = 0xC0; - - /* Top right */ - pixels[width * 4 - 1] = 0; - pixels[width * 4 - 5] = 0x80; - pixels[width * 4 - 9] = 0xC0; - pixels[rowstride + (width * 4) - 1] = 0x80; - pixels[(2 * rowstride) + (width * 4) - 1] = 0xC0; - - /* Bottom left */ - pixels[(height - 1) * rowstride + 3] = 0; - pixels[(height - 1) * rowstride + 7] = 0x80; - pixels[(height - 1) * rowstride + 11] = 0xC0; - pixels[(height - 2) * rowstride + 3] = 0x80; - pixels[(height - 3) * rowstride + 3] = 0xC0; - - /* Bottom right */ - pixels[height * rowstride - 1] = 0; - pixels[(height - 1) * rowstride - 1] = 0x80; - pixels[(height - 2) * rowstride - 1] = 0xC0; - pixels[height * rowstride - 5] = 0x80; - pixels[height * rowstride - 9] = 0xC0; -} - /* Altered from do_colorshift in gnome-panel */ static void do_alphashift (GdkPixbuf *dest, GdkPixbuf *src, int shift) @@ -2273,7 +2241,7 @@ gdk_pixbuf_fill(ret, 0x00000000); gdk_pixbuf_scale(buf, ret, (32-scale_width)/2, (32-scale_height)/2, scale_width, scale_height, (32-scale_width)/2, (32-scale_height)/2, (double)scale_width/(double)orig_width, (double)scale_height/(double)orig_height, GDK_INTERP_BILINEAR); if (pidgin_gdk_pixbuf_is_opaque(ret)) - roundify(ret); + pidgin_gdk_pixbuf_make_round(ret); } else { ret = gdk_pixbuf_scale_simple(buf,scale_width,scale_height, GDK_INTERP_BILINEAR); } @@ -3282,7 +3250,7 @@ return ret; } -gchar *pidgin_blist_get_name_markup(PurpleBuddy *b, gboolean selected) +gchar *pidgin_blist_get_name_markup(PurpleBuddy *b, gboolean selected, gboolean aliased) { const char *name; char *esc, *text = NULL; @@ -3307,15 +3275,19 @@ } /* XXX Good luck cleaning up this crap */ - - contact = (PurpleContact*)((PurpleBlistNode*)b)->parent; - if(contact) - gtkcontactnode = ((PurpleBlistNode*)contact)->ui_data; - - if(gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias) - name = contact->alias; - else - name = purple_buddy_get_alias(b); + if (aliased) { + contact = (PurpleContact*)((PurpleBlistNode*)b)->parent; + if(contact) + gtkcontactnode = ((PurpleBlistNode*)contact)->ui_data; + + if(gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias) + name = contact->alias; + else + name = purple_buddy_get_alias(b); + } else { + name = b->name; + } + esc = g_markup_escape_text(name, strlen(name)); presence = purple_buddy_get_presence(b); @@ -4463,8 +4435,10 @@ #endif "markup", NAME_COLUMN, NULL); +#if GTK_CHECK_VERSION(2,6,0) g_signal_connect(G_OBJECT(rend), "editing-started", G_CALLBACK(gtk_blist_renderer_editing_started_cb), NULL); g_signal_connect(G_OBJECT(rend), "editing-canceled", G_CALLBACK(gtk_blist_renderer_editing_cancelled_cb), list); +#endif g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), list); g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL); #if GTK_CHECK_VERSION(2,6,0) @@ -4967,7 +4941,7 @@ } emblem = pidgin_blist_get_emblem((PurpleBlistNode*) buddy); - mark = pidgin_blist_get_name_markup(buddy, selected); + mark = pidgin_blist_get_name_markup(buddy, selected, TRUE); if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time") && purple_presence_is_idle(presence) && diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtkblist.h --- a/pidgin/gtkblist.h Tue Jun 19 17:28:41 2007 +0000 +++ b/pidgin/gtkblist.h Fri Jun 22 03:55:10 2007 +0000 @@ -365,8 +365,9 @@ * * @param buddy The buddy to return markup from * @param selected Whether this buddy is selected. If TRUE, the markup will not change the color. + * @param aliased TRUE to return the appropriate alias of this buddy, FALSE to return its screenname * @return The markup for this buddy */ -gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected); +gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased); #endif /* _PIDGINBLIST_H_ */ diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Tue Jun 19 17:28:41 2007 +0000 +++ b/pidgin/gtkconv.c Fri Jun 22 03:55:10 2007 +0000 @@ -628,23 +628,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))); } } @@ -2356,7 +2343,8 @@ gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->icon), status); gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->menu_icon), status); - gtk_list_store_set(gtkconv->infopane_model, &(gtkconv->infopane_iter), + gtk_list_store_set(GTK_LIST_STORE(gtkconv->infopane_model), + &(gtkconv->infopane_iter), ICON_COLUMN, status, -1); if (status != NULL) @@ -2414,12 +2402,22 @@ gdk_pixbuf_animation_iter_advance(gtkconv->u.im->iter, NULL); buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter); - pidgin_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, - PURPLE_ICON_SCALE_DISPLAY, &scale_width, &scale_height); - - /* this code is ugly, and scares me */ - scale = gdk_pixbuf_scale_simple(buf, 32, 32, + scale_width = gdk_pixbuf_get_width(buf); + scale_height = gdk_pixbuf_get_height(buf); + if (scale_width == scale_height) { + scale_width = scale_height = 32; + } else if (scale_height > scale_width) { + scale_width = 32 * scale_width / scale_height; + scale_height = 32; + } else { + scale_height = 32 * scale_height / scale_width; + scale_width = 32; + } + + scale = gdk_pixbuf_scale_simple(buf, scale_width, scale_height, GDK_INTERP_BILINEAR); + if (pidgin_gdk_pixbuf_is_opaque(scale)) + pidgin_gdk_pixbuf_make_round(scale); gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->u.im->icon), scale); g_object_unref(G_OBJECT(scale)); @@ -4266,11 +4264,9 @@ hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); - gtk_widget_show(hbox); label = gtk_label_new(_("Topic:")); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - gtk_widget_show(label); gtkchat->topic_text = gtk_entry_new(); @@ -4282,7 +4278,6 @@ } gtk_box_pack_start(GTK_BOX(hbox), gtkchat->topic_text, TRUE, TRUE, 0); - gtk_widget_show(gtkchat->topic_text); g_signal_connect(G_OBJECT(gtkchat->topic_text), "key_press_event", G_CALLBACK(entry_key_press_cb), gtkconv); } @@ -4404,23 +4399,25 @@ gtkconv->infopane = gtk_cell_view_new(); gtkconv->infopane_model = gtk_list_store_new(NUM_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING); - gtk_cell_view_set_model(GTK_CELL_VIEW(gtkconv->infopane), gtkconv->infopane_model); + gtk_cell_view_set_model(GTK_CELL_VIEW(gtkconv->infopane), + 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); @@ -6153,13 +6150,13 @@ pidgin_themes_smiley_themeize(PIDGIN_CONVERSATION(conv)->imhtml); if ((fields & PIDGIN_CONV_COLORIZE_TITLE) || - (fields & PIDGIN_CONV_SET_TITLE)) + (fields & PIDGIN_CONV_SET_TITLE) || + (fields & PIDGIN_CONV_TOPIC)) { char *title; PurpleConvIm *im = NULL; PurpleAccount *account = purple_conversation_get_account(conv); - PurpleBuddy *buddy; - char *markup; + char *markup = NULL; AtkObject *accessibility_obj; /* I think this is a little longer than it needs to be but I'm lazy. */ char style[51]; @@ -6175,11 +6172,19 @@ else title = g_strdup(purple_conversation_get_title(conv)); - buddy = purple_find_buddy(account, conv->name); - if (buddy) - markup = pidgin_blist_get_name_markup(buddy, FALSE); - else - markup = title; + if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) { + PurpleBuddy *buddy = purple_find_buddy(account, conv->name); + if (buddy) + markup = pidgin_blist_get_name_markup(buddy, FALSE, FALSE); + else + markup = title; + } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) { + PurpleConvChat *chat = PURPLE_CONV_CHAT(conv); + markup = g_strdup_printf("%s\n%s", + purple_conversation_get_title(conv), + pidgin_get_dim_grey_string(gtkconv->infopane), + purple_conv_chat_get_topic(chat)); + } gtk_list_store_set(gtkconv->infopane_model, &(gtkconv->infopane_iter), TEXT_COLUMN, markup, -1); @@ -6443,19 +6448,36 @@ } if (gdk_pixbuf_animation_is_static_image(gtkconv->u.im->anim)) { + GdkPixbuf *stat; gtkconv->u.im->iter = NULL; - buf = gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim); + stat = gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim); + buf = gdk_pixbuf_add_alpha(stat, FALSE, 0, 0, 0); } else { + GdkPixbuf *stat; gtkconv->u.im->iter = gdk_pixbuf_animation_get_iter(gtkconv->u.im->anim, NULL); /* LEAK */ - buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter); + stat = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter); + buf = gdk_pixbuf_add_alpha(stat, FALSE, 0, 0, 0); if (gtkconv->u.im->animate) start_anim(NULL, gtkconv); } - scale = gdk_pixbuf_scale_simple(buf, 32, 32, + scale_width = gdk_pixbuf_get_width(buf); + scale_height = gdk_pixbuf_get_height(buf); + if (scale_width == scale_height) { + scale_width = scale_height = 32; + } else if (scale_height > scale_width) { + scale_width = 32 * scale_width / scale_height; + scale_height = 32; + } else { + scale_height = 32 * scale_height / scale_width; + scale_width = 32; + } + scale = gdk_pixbuf_scale_simple(buf, scale_width, scale_height, GDK_INTERP_BILINEAR); - + g_object_unref(buf); + if (pidgin_gdk_pixbuf_is_opaque(scale)) + pidgin_gdk_pixbuf_make_round(scale); gtkconv->u.im->icon_container = gtk_vbox_new(FALSE, 0); event = gtk_event_box_new(); @@ -6466,8 +6488,6 @@ gtkconv->u.im->icon = gtk_image_new_from_pixbuf(scale); gtkconv->auto_resize = TRUE; - /* Reset the size request to allow the buddy icon to resize */ - g_idle_add(reset_auto_resize_cb, gtkconv); gtk_container_add(GTK_CONTAINER(event), gtkconv->u.im->icon); gtk_widget_show(gtkconv->u.im->icon); diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtkconv.h --- a/pidgin/gtkconv.h Tue Jun 19 17:28:41 2007 +0000 +++ b/pidgin/gtkconv.h Fri Jun 22 03:55:10 2007 +0000 @@ -160,7 +160,7 @@ time_t newday; GtkWidget *infopane_hbox; GtkWidget *infopane; - GtkTreeModel *infopane_model; + GtkListStore *infopane_model; GtkTreeIter infopane_iter; }; diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtkdialogs.c diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Tue Jun 19 17:28:41 2007 +0000 +++ b/pidgin/gtkimhtml.c Fri Jun 22 03:55:10 2007 +0000 @@ -29,6 +29,7 @@ #endif #include "pidgin.h" +#include "internal.h" #include "debug.h" #include "util.h" @@ -53,19 +54,6 @@ #include #endif -#ifdef ENABLE_NLS -# include -# 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 /* GTK+ < 2.4.x hack, see pidgin.h for details. */ diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtkmain.c --- a/pidgin/gtkmain.c Tue Jun 19 17:28:41 2007 +0000 +++ b/pidgin/gtkmain.c Fri Jun 22 03:55:10 2007 +0000 @@ -496,7 +496,7 @@ "no fault of your own.\n\n" "If you can reproduce the crash, please notify the developers\n" "by reporting a bug at:\n" - "%snewticket/\n\n" + "%ssimpleticket/\n\n" "Please make sure to specify what you were doing at the time\n" "and post the backtrace from the core file. If you do not know\n" "how to get the backtrace, please read the instructions at\n" diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtkprefs.c --- a/pidgin/gtkprefs.c Tue Jun 19 17:28:41 2007 +0000 +++ b/pidgin/gtkprefs.c Fri Jun 22 03:55:10 2007 +0000 @@ -1214,9 +1214,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; } diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtksavedstatuses.c --- a/pidgin/gtksavedstatuses.c Tue Jun 19 17:28:41 2007 +0000 +++ b/pidgin/gtksavedstatuses.c Fri Jun 22 03:55:10 2007 +0000 @@ -23,8 +23,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "account.h" -#include "internal.h" #include "notify.h" #include "request.h" #include "savedstatuses.h" @@ -304,6 +305,7 @@ GList *sel_paths, *l, *sel_titles = NULL; GtkTreeModel *model = GTK_TREE_MODEL(dialog->model); char *title; + gpointer handle; selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); #if GTK_CHECK_VERSION(2,2,0) @@ -326,13 +328,16 @@ } g_list_free(sel_paths); - if (g_list_length(sel_titles) == 1) + if (g_list_length(sel_titles) == 1) { title = g_strdup_printf(_("Are you sure you want to delete %s?"), (const gchar *)sel_titles->data); - else + handle = purple_savedstatus_find(sel_titles->data); + } else { title = g_strdup(_("Are you sure you want to delete the selected saved statuses?")); + handle = dialog; + } - purple_request_action(dialog, NULL, title, NULL, 0, + purple_request_action(handle, NULL, title, NULL, 0, NULL, NULL, NULL, sel_titles, 2, _("Delete"), status_window_delete_confirm_cb, @@ -362,7 +367,7 @@ gtk_tree_selection_selected_foreach(sel, list_selected_helper, &sel_paths); #endif - for (tmp = sel_paths, num_selected = 0; tmp; tmp = sel_paths->next, num_selected++) { + for (tmp = sel_paths, num_selected = 0; tmp; tmp = tmp->next, num_selected++) { GtkTreeIter iter; char *title; diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtkstatusbox.c --- a/pidgin/gtkstatusbox.c Tue Jun 19 17:28:41 2007 +0000 +++ b/pidgin/gtkstatusbox.c Fri Jun 22 03:55:10 2007 +0000 @@ -41,10 +41,11 @@ #include +#include "internal.h" + #include "account.h" #include "buddyicon.h" #include "core.h" -#include "internal.h" #include "imgstore.h" #include "network.h" #include "request.h" @@ -1560,7 +1561,7 @@ msg = g_strdup_printf(_("Are you sure you want to delete %s?"), purple_savedstatus_get_title(saved)); - purple_request_action(pidgin_status_get_handle(), NULL, msg, NULL, 0, + purple_request_action(saved, NULL, msg, NULL, 0, NULL, NULL, NULL, data, 2, _("Delete"), tree_view_delete_current_selection_cb, @@ -1624,15 +1625,17 @@ GtkTreePath *path; if (gtk_tree_selection_get_selected(sel, NULL, &iter)) { + gboolean ret = TRUE; path = gtk_tree_model_get_path(GTK_TREE_MODEL(box->dropdown_store), &iter); if (event->keyval == GDK_Return) { treeview_activate_current_selection(box, path); } else if (event->keyval == GDK_Delete) { tree_view_delete_current_selection(box, path); - } + } else + ret = FALSE; gtk_tree_path_free (path); - return TRUE; + return ret; } } } diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtkutils.c --- a/pidgin/gtkutils.c Tue Jun 19 17:28:41 2007 +0000 +++ b/pidgin/gtkutils.c Fri Jun 22 03:55:10 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, @@ -3066,6 +3095,65 @@ return TRUE; } +void pidgin_gdk_pixbuf_make_round(GdkPixbuf *pixbuf) { + int width, height, rowstride; + guchar *pixels; + if (!gdk_pixbuf_get_has_alpha(pixbuf)) + return; + width = gdk_pixbuf_get_width(pixbuf); + height = gdk_pixbuf_get_height(pixbuf); + rowstride = gdk_pixbuf_get_rowstride(pixbuf); + pixels = gdk_pixbuf_get_pixels(pixbuf); + + if (width < 6 || height < 6) + return; + /* Top left */ + pixels[3] = 0; + pixels[7] = 0x80; + pixels[11] = 0xC0; + pixels[rowstride + 3] = 0x80; + pixels[rowstride * 2 + 3] = 0xC0; + + /* Top right */ + pixels[width * 4 - 1] = 0; + pixels[width * 4 - 5] = 0x80; + pixels[width * 4 - 9] = 0xC0; + pixels[rowstride + (width * 4) - 1] = 0x80; + pixels[(2 * rowstride) + (width * 4) - 1] = 0xC0; + + /* Bottom left */ + pixels[(height - 1) * rowstride + 3] = 0; + pixels[(height - 1) * rowstride + 7] = 0x80; + pixels[(height - 1) * rowstride + 11] = 0xC0; + pixels[(height - 2) * rowstride + 3] = 0x80; + pixels[(height - 3) * rowstride + 3] = 0xC0; + + /* Bottom right */ + pixels[height * rowstride - 1] = 0; + pixels[(height - 1) * rowstride - 1] = 0x80; + pixels[(height - 2) * rowstride - 1] = 0xC0; + pixels[height * rowstride - 5] = 0x80; + pixels[height * rowstride - 9] = 0xC0; +} + +const char *pidgin_get_dim_grey_string(GtkWidget *widget) { + static char dim_grey_string[8] = ""; + GtkStyle *style; + + if (!widget) + return "dim grey"; + + style = gtk_widget_get_style(widget); + if (!style) + return "dim grey"; + + snprintf(dim_grey_string, sizeof(dim_grey_string), "#%02x%02x%02x", + style->text_aa[GTK_STATE_NORMAL].red >> 8, + style->text_aa[GTK_STATE_NORMAL].green >> 8, + style->text_aa[GTK_STATE_NORMAL].blue >> 8); + return dim_grey_string; +} + #if !GTK_CHECK_VERSION(2,2,0) GtkTreePath * gtk_tree_path_new_from_indices (gint first_index, ...) diff -r db286cc82bd1 -r c9bcf4f11e30 pidgin/gtkutils.h --- a/pidgin/gtkutils.h Tue Jun 19 17:28:41 2007 +0000 +++ b/pidgin/gtkutils.h Fri Jun 22 03:55:10 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. * @@ -565,6 +574,22 @@ */ gboolean pidgin_gdk_pixbuf_is_opaque(GdkPixbuf *pixbuf); +/** + * Rounds the corners of a 32x32 GdkPixbuf in place + * + * @param pixbuf The buddy icon to transform + */ +void pidgin_gdk_pixbuf_make_round(GdkPixbuf *pixbuf); + +/** + * Returns an HTML-style color string for use as a dim grey + * string + * + * @param widget The widget to return dim grey for + * @return The dim grey string + */ +const char *pidgin_get_dim_grey_string(GtkWidget *widget); + #if !GTK_CHECK_VERSION(2,2,0) /** * This is copied from Gtk to support Gtk 2.0