Mercurial > pidgin.yaz
changeset 25232:7183d12b96ed
propagate from branch 'im.pidgin.pidgin' (head 311b4db51b575e1baa7f78d751ff926475edecc3)
to branch 'im.pidgin.cpw.malu.xmpp.ibb_ft' (head 2547f95c32d530b4f5c2d0cb5e65860482dc8138)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Thu, 13 Nov 2008 19:50:53 +0000 |
parents | 6ef1197c2db6 (current diff) f18f37a62971 (diff) |
children | 7d2f51772351 |
files | libpurple/protocols/jabber/Makefile.am pidgin/pidginstock-artwork.c |
diffstat | 109 files changed, 1049 insertions(+), 1245 deletions(-) [+] |
line wrap: on
line diff
--- a/.mtn-ignore Wed Oct 29 21:38:33 2008 +0000 +++ b/.mtn-ignore Thu Nov 13 19:50:53 2008 +0000 @@ -13,6 +13,7 @@ intltool-.* Doxyfile(\.mingw)?$ aclocal.m4 +autogen.args compile config.cache config.guess @@ -40,6 +41,7 @@ pidgin/pixmaps/emotes/none/theme pidgin/plugins/musicmessaging/music-messaging-bindings.c pidgin/plugins/perl/common/Makefile.PL$ +pidgin/plugins/perl/common/Makefile.old pidgin/win32/pidgin_dll_rc.rc$ pidgin/win32/pidgin_exe_rc.rc$ install-sh @@ -50,6 +52,7 @@ libpurple/gconf/purple.schemas$ libpurple/plugins/dbus-example-bindings.c libpurple/plugins/perl/common/Makefile.PL$ +libpurple/plugins/perl/common/Makefile.old libpurple/plugins/perl/common/const-c.inc libpurple/plugins/perl/common/const-xs.inc libpurple/plugins/perl/common/lib
--- a/COPYRIGHT Wed Oct 29 21:38:33 2008 +0000 +++ b/COPYRIGHT Thu Nov 13 19:50:53 2008 +0000 @@ -145,6 +145,7 @@ Evgueni V. Gavrilov Ignacy Gawedzki Georgi Georgiev +Brian Geppert Thomas Gibson-Robinson Ike Gingerich Gustavo Giráldez @@ -287,6 +288,7 @@ Christopher O'Brien (siege) Peter O'Gorman Jon Oberheide +Marcos GarcÃa Ochoa Yusuke Odate Ruediger Oertel Gudmundur Bjarni Olafsson @@ -305,6 +307,7 @@ Ted Percival Eduardo Pérez Matt Perry +Diego Pettenò Nathan Peterson Sebastián E. Peyrott Celso Pinto @@ -461,6 +464,7 @@ Dan Willemsen Justin Williams (Jaywalker) Jason Willis +Alex Willmer Matt Wilson Dan Winship Scott Wolchok
--- a/ChangeLog Wed Oct 29 21:38:33 2008 +0000 +++ b/ChangeLog Thu Nov 13 19:50:53 2008 +0000 @@ -7,6 +7,21 @@ "Microsoft Internet Authority" certificates. People that use --with-system-ssl-certs and GnuTLS need to include these in the system certs directory. + * Corrected maximum message lengths for Yahoo! + + Pidgin: + * On GTK+ 2.14 and higher, we're using the gtk-tooltip-delay setting + instead of our own (hidden) tooltip_delay pref. If you had + previously changed that pref, add a line like this to + ~/.purple/gtkrc-2.0 (where 500 is the timeout (in ms) you want): + gtk-tooltip-timeout = 500 + To completely disable tooltips (e.g. if you had an old tooltip_delay + of zero), add this to ~/.purple/gtkrc-2.0: + gtk-enable-tooltips = 0 + + Finch: + * Allow binding meta+arrow keys for actions. + version 2.5.2 (10/19/2008): libpurple:
--- a/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -30,7 +30,12 @@ distcheck-hook: libpurple/plugins/perl/common/Purple.pm pidgin/plugins/perl/common/Pidgin.pm # cp libpurple/plugins/perl/common/Gaim.pm $(distdir)/libpurple/plugins/perl/common -version-check: +commit-check: + (cd po ; intltool-update -m 2>&1 | grep -v '^mismatched quotes.*\.py$$' | sed "s|current directory|po directory|" | grep . ; if [ $$? = 0 ] ; then exit 1 ; else exit 0 ; fi) + LC_ALL=C sort -c -t/ -u po/POTFILES.in + LC_ALL=C sort -c -t/ -u po/POTFILES.skip + +version-check: commit-check # We don't want to release development versions. test x`echo $(PACKAGE_VERSION) | grep dev` = x
--- a/autogen.sh Wed Oct 29 21:38:33 2008 +0000 +++ b/autogen.sh Thu Nov 13 19:50:53 2008 +0000 @@ -37,7 +37,7 @@ # INTLTOOLIZE_FLAGS - command line arguments to pass to intltoolize # LIBTOOLIZE_FLAGS - command line arguments to pass to libtoolize # -# Other helpfull notes: +# Other helpful notes: # If you're using a different c compiler, you can override the environment # variable in 'autogen.args'. For example, say you're using distcc, just add # the following to 'autogen.args': @@ -48,6 +48,8 @@ ############################################################################### PACKAGE="Pidgin" ARGS_FILE="autogen.args" +export CFLAGS +export LDFLAGS libtoolize="libtoolize" case $(uname -s) in @@ -115,7 +117,7 @@ if [ -f ${ARGS_FILE} ] ; then echo "found." printf "%s" "sourcing ${ARGS_FILE}: " - . ${ARGS_FILE} + . "`dirname "$0"`"/${ARGS_FILE} echo "done." else echo "not found." @@ -125,8 +127,8 @@ # Check for our required helpers ############################################################################### check "$libtoolize"; LIBTOOLIZE=${BIN}; -check "glib-gettextize"; GLIB_GETTEXTIZE=${BIN}; -check "intltoolize"; INTLTOOLIZE=${BIN}; +check "glib-gettextize"; GLIB_GETTEXTIZE=${BIN}; +check "intltoolize"; INTLTOOLIZE=${BIN}; check "aclocal"; ACLOCAL=${BIN}; check "autoheader"; AUTOHEADER=${BIN}; check "automake"; AUTOMAKE=${BIN};
--- a/configure.ac Wed Oct 29 21:38:33 2008 +0000 +++ b/configure.ac Thu Nov 13 19:50:53 2008 +0000 @@ -1010,23 +1010,23 @@ extern_init= load_proto= for i in $STATIC_PRPLS ; do - dnl Ugly special case for "libsilcpurple.a": + dnl Ugly special case for "libsilcpurple.la": dnl ... and Ugly special case for multi-protocol oscar if test \( "x$i" = "xoscar" -o "x$i" = "xaim" -o "x$i" = "xicq" \) -a "x$static_oscar" != "xyes"; then - STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/oscar/liboscar.a" + STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/oscar/liboscar.la" extern_init="$extern_init extern gboolean purple_init_aim_plugin();" extern_init="$extern_init extern gboolean purple_init_icq_plugin();" load_proto="$load_proto purple_init_aim_plugin();" load_proto="$load_proto purple_init_icq_plugin();" else if test "x$i" = "xsilc"; then - STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib${i}purple.a" + STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib${i}purple.la" elif test "x$i" = "xsilc10"; then - STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/libsilcpurple.a" + STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/libsilcpurple.la" elif test "x$i" = "xmsnp9"; then - STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/libmsn.a" + STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/libmsn.la" else - STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib$i.a" + STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib$i.la" fi extern_init="$extern_init extern gboolean purple_init_${i}_plugin();" load_proto="$load_proto purple_init_${i}_plugin();" @@ -1143,6 +1143,7 @@ AC_ARG_ENABLE(fortify, [AC_HELP_STRING([--disable-fortify], [compile without FORTIFY_SOURCE support])], , enable_fortify=yes) +DEBUG_CFLAGS="$DEBUG_CFLAGS -DPURPLE_DISABLE_DEPRECATED -DPIDGIN_DISABLE_DEPRECATED -DFINCH_DISABLE_DEPRECATED -DGNT_DISABLE_DEPRECATED" if test "x$GCC" = "xyes"; then dnl We enable -Wall later. dnl If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags.
--- a/doc/TCL-HOWTO.dox Wed Oct 29 21:38:33 2008 +0000 +++ b/doc/TCL-HOWTO.dox Thu Nov 13 19:50:53 2008 +0000 @@ -4,11 +4,11 @@ NOTA BENE: This documentation is badly out of date for 2.x. -The Gaim Tcl interface provides a Tcl API for many useful gaim -functions. Like the perl API, the Tcl API does not provide -access to every corner of gaim exposed by the @e C interface. It does, -however, provide a very powerful interface to many of Gaim's functions -through a simple to learn and extend scripting language. +The libpurple Tcl interface provides a Tcl API for many useful libpurple +functions. Like the perl API, the Tcl API does not provide access to +every corner of libpurple exposed by the @e C interface. It does, +however, provide a very powerful interface to many of libpurple's +functions through a simple to learn and extend scripting language. If you are not familiar with Tcl, you will probably find it somewhat different from what you are used to. Despite being somewhat unique @@ -19,7 +19,7 @@ @section start Getting Started -The only requirement placed on a Gaim Tcl script by Gaim is the +The only requirement placed on a purple Tcl script by libpurple is the existence of a procedure called @c plugin_init. This procedure has some limitations placed upon it; it will be parsed and evaluated before the rest of the Tcl script, so it cannot reference any other variables @@ -42,56 +42,57 @@ @endcode The rest of the script will generally be registration to recieve -notification of various Gaim signals (more about this below) and -definitions of procedures to be executed when those signals occur. +notification of various purple (or Pidgin, or finch, or ...) signals +(more about this below) and definitions of procedures to be executed +when those signals occur. @section details Interpreter Details -Gaim initializes and drives the Tcl event loop (similar to Tk), +libpurple initializes and drives the Tcl event loop (similar to Tk), meaning that commands like @c fileevent and @c after are available and do not require @c vwait etc. The @c vwait actually seems to be somewhat broken due to a bug somewhere in the Tcl/Glib event loop glue, and it should not be used for now. -The gaim-specific functions are provided in a statically-linked -package called @c gaim; this means that if you spawn a child -interpreter and wish to use the gaim-specific functions, you will need -to execute <tt>load {} gaim</tt> in that interpreter. +The purple-specific functions are provided in a statically-linked +package called @c purple; this means that if you spawn a child +interpreter and wish to use the purple-specific functions, you will need +to execute <tt>load {} purple</tt> in that interpreter. -@section internals Gaim Internal Procedures and Variables +@section internals purple Internal Procedures and Variables -All of the information provided for your use by Gaim will be in the @c -::gaim namespace. This means that in order to access it you will either -have to import the gaim namespace (e.g. via the command <tt>namespace -import gaim::*</tt>) or reference it explicitly. The following +All of the information provided for your use by purple will be in the @c +::purple namespace. This means that in order to access it you will either +have to import the purple namespace (e.g. via the command <tt>namespace +import purple::*</tt>) or reference it explicitly. The following descriptions will reference it explicitly for clarity. @li Variables @code -gaim::version +purple::version @endcode - This contains the version of the gaim process which loaded the + This contains the version of the libpurple library which loaded the script. @li Commands @code -gaim::account alias account -gaim::account connect account -gaim::account connection account -gaim::account disconnect account -gaim::account find username protocol -gaim::account handle -gaim::account isconnected account -gaim::account list ?option? -gaim::account protocol account -gaim::account username account +purple::account alias account +purple::account connect account +purple::account connection account +purple::account disconnect account +purple::account find username protocol +purple::account handle +purple::account isconnected account +purple::account list ?option? +purple::account protocol account +purple::account username account @endcode - The @c gaim::account command consists of a set of subcommands - pertaining to gaim accounts. + The @c purple::account command consists of a set of subcommands + pertaining to purple accounts. @c alias returns the alias for the account @c account. If there is no alias for the given account, it returns the empty string. @@ -101,24 +102,24 @@ the @c gc for the account. @c connection returns the @c gc of the given account if it is connected, - or 0 if it is not. This @c gc is the gc used by gaim::connection and + or 0 if it is not. This @c gc is the gc used by purple::connection and other functions. @c disconnect disconnects the given @c account if it is connected, or does nothing if it is. @c find finds an account by its @c username and @c protocol (as returned by - <tt>gaim::account username</tt> and <tt>gaim::account protocol</tt>) and + <tt>purple::account username</tt> and <tt>purple::account protocol</tt>) and returns the account if found, or 0 otherwise. @c handle returns the instance handle required to connect to account - signals. (See <tt>gaim::signal connect</tt>). + signals. (See <tt>purple::signal connect</tt>). The @c isconnected query returns true if the given account is connected and false otherwise. The @c list subcommand returns a list of all of the accounts known to - Gaim. The elements of this lists are accounts appropriate for the + libpurple. The elements of this lists are accounts appropriate for the @c account argument of the other subcommands. The @c -all option (default) returns all accounts, while the @c -online option returns only those accounts which are online. @@ -130,13 +131,13 @@ @c account. @code -gaim::buddy alias buddy -gaim::buddy handle -gaim::buddy info ( buddy | account username ) -gaim::buddy list +purple::buddy alias buddy +purple::buddy handle +purple::buddy info ( buddy | account username ) +purple::buddy list @endcode - @c gaim::buddy is a set of commands for retrieving information about + @c purple::buddy is a set of commands for retrieving information about buddies and manipulating the buddy list. For the purposes of Tcl, a "buddy" is currently a list of several elements, the first of which being the type. The currently recognized types are "group", @@ -157,73 +158,73 @@ exists, or the empty string if it does not. @c handle returns the blist handle for the purposes of connecting - signals to buddy list events. (See <tt>gaim::signal connect</tt>). + signals to buddy list events. (See <tt>purple::signal connect</tt>). - @c info causes gaim to display the info dialog for the given buddy. - Since it is possible to request user info for a buddy not in your - buddy list, you may also specify a buddy by his or her username and - the account through which you wish to retrieve info. + @c info causes the purple-using UI to display the info dialog for the + given buddy. Since it is possible to request user info for a buddy + not in your buddy list, you may also specify a buddy by his or her + username and the account through which you wish to retrieve info. @c list returns a list of @c group structures, filled out with buddies and chats as described above. @code -gaim::connection account gc -gaim::connection displayname gc -gaim::connection handle -gaim::connection list +purple::connection account gc +purple::connection displayname gc +purple::connection handle +purple::connection list @endcode - @c gaim::connection is a collection of subcommands pertaining to + @c purple::connection is a collection of subcommands pertaining to account connections. - @c account returns the Gaim account associated with @c gc. This - account is the same account used by @c gaim::account and other + @c account returns the purple account associated with @c gc. This + account is the same account used by @c purple::account and other commands. @c displayname returns the display name (duh) of @c gc as reported by - <tt>gaim_connection_get_display_name(gc)</tt>. + <tt>purple_connection_get_display_name(gc)</tt>. - @c handle returns the gaim connections instance handle. (See - <tt>gaim::signal connect</tt>). + @c handle returns the purple connections instance handle. (See + <tt>purple::signal connect</tt>). @c list returns a list of all known connections. The elements of this list are appropriate as @c gc arguments to the other - @c gaim::connection subcommands or other commands requiring a gc. + @c purple::connection subcommands or other commands requiring a gc. @code -gaim::conv_send account who text +purple::conv_send account who text @endcode - @c gaim::conv is simply a convenience wrapper for @c gaim::send_im and - <tt>gaim::conversation write</tt>. It sends the IM, determines the from - and to arguments for <tt>gaim::conversation write</tt>, and prints the text + @c purple::conv is simply a convenience wrapper for @c purple::send_im and + <tt>purple::conversation write</tt>. It sends the IM, determines the from + and to arguments for <tt>purple::conversation write</tt>, and prints the text sent to the conversation as one would expect. For the curious, you - may view the source for it by typing <tt>info body gaim::conv_send</tt> at - a Gaim Commander prompt. + may view the source for it by typing <tt>info body purple::conv_send</tt> at + a Purple Commander prompt. - Note that an error in either @c gaim::send_im or <tt>gaim::conversation + Note that an error in either @c purple::send_im or <tt>purple::conversation write</tt> will not be caught by this procedure, and will be propagated to the caller. @code -gaim::conversation find ?-account account? name -gaim::conversation handle -gaim::conversation list -gaim::conversation new ?-chat? ?-im? account name -gaim::conversation write conversation style from to text +purple::conversation find ?-account account? name +purple::conversation handle +purple::conversation list +purple::conversation new ?-chat? ?-im? account name +purple::conversation write conversation style from to text @endcode - @c gaim::conversation provides an API for dealing with conversations. - Given that Gaim is an instant messenger program, you'll probably - spend a lot of time here. + @c purple::conversation provides an API for dealing with + conversations. Given that libpurple clients are instant messenger + programs, you'll probably spend a lot of time here. The command @c find attempts to find an existing conversation with username @c name. If the @c -account option is given, it refines its search to include only conversations on that account. @c handle returns the conversations instance handle for the purposes - of signal connection. (See <tt>gaim::signal connect</tt>). + of signal connection. (See <tt>purple::signal connect</tt>). @c list returns a list of all currently open conversations. @@ -235,56 +236,56 @@ @c write is used to write to the specified conversation. The @c style argument specifies how the text should be printed -- as text coming - from the gaim user (style @c send), being sent to the gaim user + from the purple user (style @c send), being sent to the purple user (style @c recv), or as a system message (such as "so-and-so has signed off", style @c system). From is the name to whom the text should be attributed -- you probably want to check for aliases here, lest you confuse the user. @c text is the text to print. @code -gaim::core handle -gaim::core quit +purple::core handle +purple::core quit @endcode - This command exposes functionality provided by the gaim core API. + This command exposes functionality provided by the purple core API. - <tt>gaim::core handle</tt> returns a handle to the gaim core for signal - connection. (See <tt>gaim::signal connect</tt>). + <tt>purple::core handle</tt> returns a handle to the purple core for signal + connection. (See <tt>purple::signal connect</tt>). - @c quit exits gaim cleanly, and should be used in preference to the - tcl @c exit command. (Note that @c exit has not been removed, - however.) + @c quit exits the libpurple client cleanly, and should be used in + preference to the tcl @c exit command. (Note that @c exit has not + been removed, however.) @code -gaim::debug level category message +purple::debug level category message @endcode - Equivalent to the C gaim_debug function, this command outputs - debugging information to the gaim debug window (or stdout if gaim is - invoked with -d|--debug). The valid levels are, in increasing level - of severity, @c -misc, @c -info, @c -warning, and, or @c -error. @c - category is a short (a few characters ... for instance, "tcl" or "tcl - plugin") "topic" type name for this message, and @c message is the text - of the message. In the style of Tcl @e puts (and differing from - @e gaim_debug), no trailing \\n is required. (However, embedded newlines - may be generated with \\n). + Equivalent to the C purple_debug function, this command outputs + debugging information to the libpurple UI's debug window (or, + typically, stdout if that UI is invoked with -d|--debug). The valid + levels are, in increasing level of severity, @c -misc, @c -info, @c + -warning, and, or @c -error. @c category is a short (a few characters + ... for instance, "tcl" or "tcl plugin") "topic" type name for this + message, and @c message is the text of the message. In the style of + Tcl @e puts (and differing from @e purple_debug), no trailing \\n is + required. (However, embedded newlines may be generated with \\n). @code -gaim::notify ?type? title primary secondary +purple::notify ?type? title primary secondary @endcode - Also a direct equivalent to a C function, gaim_notify, this command - causes gaim to present the provided notification information to the - user via some appropriate UI method. The @c type argument, if - present, must be one of @c -error, @c -warning, or @c -info. The following - three arguments' absolute meanings may vary with the Gaim UI being - used (presently only a Gtk2 UI is available), but @c title should - generally be the title of the window, and @c primary and @c secondary - text within that window; in the Gtk2 UI, @c primary is slightly - larger than @c secondary and displayed in a @b boldface font. + Also a direct equivalent to a C function, purple_notify, this command + causes libpurple to present the provided notification information to + the user via some appropriate UI method. The @c type argument, if + present, must be one of @c -error, @c -warning, or @c -info. The + following three arguments' absolute meanings may vary with the purple + UI being used, but @c title should generally be the title of the + window, and @c primary and @c secondary text within that window; in + the Pidgin UI, @c primary is slightly larger than @c secondary and + displayed in a @b boldface font. @code -gaim::send_im gc who text +purple::send_im gc who text @endcode This sends an IM in the fashion of serv_send_im. @c gc is the GC of @@ -293,31 +294,31 @@ and @c text is the text of the message. @code -gaim::signal connect instance signal args proc -gaim::signal disconnect instance signal +purple::signal connect instance signal args proc +purple::signal disconnect instance signal @endcode - @c gaim::signal is a set of subcommands for dealing with gaim signals - (known as "events" prior to gaim 0.68). + @c purple::signal is a set of subcommands for dealing with purple + signals. The @c connect subcommand registers the procedure @c proc as a handler for the signal @c signal on the instance @c instance. @c instance should be an instance handle as returned by one of the @c handle - commands from the various parts of gaim. @c args and @ proc are as in - the Tcl @e proc command; note that the number of arguments in @c args - must match the number of arguments emitted by the signal exactly, + commands from the various parts of libpurple. @c args and @ proc are + as in the Tcl @e proc command; note that the number of arguments in @c + args must match the number of arguments emitted by the signal exactly, although you need not use them all. The procedure @c proc may be either a simple command or a procedure in curly brackets. Note that only one procedure may be associated with each signal; an attempt to - connect a second procedure to the same signal will remove the - existing binding and replace it with the new procedure. - <tt>gaim::signal connect</tt> returns 0 on success and 1 on failure. + connect a second procedure to the same signal will remove the existing + binding and replace it with the new procedure. <tt>purple::signal + connect</tt> returns 0 on success and 1 on failure. @c disconnect removes any existing signal handler for the named signal and instance. @code -gaim::unload +purple::unload @endcode This unloads the current plugin. Note that preferences will not be @@ -338,9 +339,9 @@ might look like this: @code -gaim::signal connect [gaim::conversation handle] receiving-im-msg { +purple::signal connect [purple::conversation handle] receiving-im-msg { if {[ string match "*shizzle*" $event::buffer ]} { - gaim::notify -info "tcl plugin" "Fo' shizzle" \ + purple::notify -info "tcl plugin" "Fo' shizzle" \ "$event::sender is down with the shizzle" } } @@ -348,7 +349,7 @@ Note that for some signals (notably @c receiving-im-msg, @c sending-im-msg, and their chat counterparts), changes to the event arguments will -change the message itself from Gaim's vantage. For those signals +change the message itself from libpurple's vantage. For those signals whose return value is meaningful, returning a value from the Tcl event will return that value as it would in C.
--- a/finch/libgnt/gntkeys.c Wed Oct 29 21:38:33 2008 +0000 +++ b/finch/libgnt/gntkeys.c Thu Nov 13 19:50:53 2008 +0000 @@ -102,7 +102,12 @@ #define INSERT_COMB(k, code) do { \ snprintf(key, sizeof(key), "%s%s%s", controls[c], alts[a], k); \ INSERT_KEY(key, code); \ - } while (0); + } while (0) +#define INSERT_COMB_CODE(k, c1, c2) do { \ + char __[32]; \ + snprintf(__, sizeof(__), "%s%s", c1, c2); \ + INSERT_COMB(k, __); \ + } while (0) /* Lower-case alphabets */ for (a = 0, c = 0; controls[c]; c++, a = 0) { @@ -124,6 +129,10 @@ } if (c == 0) { INSERT_COMB("tab", "\033\t"); + INSERT_COMB_CODE("up", "\033", GNT_KEY_UP); + INSERT_COMB_CODE("down", "\033", GNT_KEY_DOWN); + INSERT_COMB_CODE("left", "\033", GNT_KEY_LEFT); + INSERT_COMB_CODE("right", "\033", GNT_KEY_RIGHT); } } } @@ -144,6 +153,8 @@ void gnt_keys_refine(char *text) { + while (*text == 27 && *(text + 1) == 27) + text++; if (*text == 27 && *(text + 1) == '[' && (*(text + 2) >= 'A' && *(text + 2) <= 'D')) { /* Apparently this is necessary for urxvt and screen and xterm */
--- a/libpurple/account.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/account.c Thu Nov 13 19:50:53 2008 +0000 @@ -1035,7 +1035,7 @@ purple_debug_info("account", "Registering account %s\n", purple_account_get_username(account)); - purple_connection_new(account, TRUE, purple_account_get_password(account)); + _purple_connection_new(account, TRUE, purple_account_get_password(account)); } void @@ -1046,7 +1046,7 @@ purple_debug_info("account", "Unregistering account %s\n", purple_account_get_username(account)); - purple_connection_new_unregister(account, purple_account_get_password(account), cb, user_data); + _purple_connection_new_unregister(account, purple_account_get_password(account), cb, user_data); } static void @@ -1069,7 +1069,7 @@ purple_account_set_password(account, entry); - purple_connection_new(account, FALSE, entry); + _purple_connection_new(account, FALSE, entry); } static void @@ -1155,7 +1155,7 @@ !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) purple_account_request_password(account, G_CALLBACK(request_password_ok_cb), G_CALLBACK(request_password_cancel_cb), account); else - purple_connection_new(account, FALSE, password); + _purple_connection_new(account, FALSE, password); } void @@ -1171,7 +1171,7 @@ account->disconnecting = TRUE; gc = purple_account_get_connection(account); - purple_connection_destroy(gc); + _purple_connection_destroy(gc); if (!purple_account_get_remember_password(account)) purple_account_set_password(account, NULL); purple_account_set_connection(account, NULL);
--- a/libpurple/blist.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/blist.c Thu Nov 13 19:50:53 2008 +0000 @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA * */ +#define _PURPLE_BLIST_C_ + #include "internal.h" #include "blist.h" #include "conversation.h" @@ -41,7 +43,6 @@ static guint save_timer = 0; static gboolean blist_loaded = FALSE; - /********************************************************************* * Private utility functions * *********************************************************************/ @@ -446,7 +447,7 @@ purple_blist_get_last_child((PurpleBlistNode*)group)); if ((alias = xmlnode_get_attrib(cnode, "alias"))) { - purple_contact_set_alias(contact, alias); + purple_blist_alias_contact(contact, alias); } for (x = cnode->child; x; x = x->next) { @@ -835,13 +836,11 @@ ops->update(purplebuddylist, node); } -#ifndef PURPLE_DISABLE_DEPRECATED void purple_blist_update_buddy_icon(PurpleBuddy *buddy) { purple_blist_update_node_icon((PurpleBlistNode *)buddy); } -#endif /* * TODO: Maybe remove the call to this from server.c and call it
--- a/libpurple/blist.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/blist.h Thu Nov 13 19:50:53 2008 +0000 @@ -75,11 +75,11 @@ } PurpleBlistNodeFlags; -#define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (((PurpleBlistNode*)(b))->flags & (f)) +#define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (purple_blist_node_get_flags((PurpleBlistNode*)(b)) & (f)) #define PURPLE_BLIST_NODE_SHOULD_SAVE(b) (! PURPLE_BLIST_NODE_HAS_FLAG(b, PURPLE_BLIST_NODE_FLAG_NO_SAVE)) -#define PURPLE_BLIST_NODE_NAME(n) ((n)->type == PURPLE_BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \ - (n)->type == PURPLE_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL) +#define PURPLE_BLIST_NODE_NAME(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \ + purple_blist_node_get_type(n) == PURPLE_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL) #include "account.h" #include "buddyicon.h" @@ -89,6 +89,8 @@ /* Data Structures */ /**************************************************************************/ +#if !(defined PURPLE_HIDE_STRUCTS) || (defined _PURPLE_BLIST_C_) + /** * A Buddy list node. This can represent a group, a buddy, or anything else. * This is a base class for struct buddy and struct group and for anything @@ -154,6 +156,8 @@ PurpleAccount *account; /**< The account this chat is attached to */ }; +#endif /* PURPLE_HIDE_STRUCTS && PURPLE_BLIST_STRUCTS */ + /** * The Buddy List @@ -331,7 +335,7 @@ */ void purple_blist_update_node_icon(PurpleBlistNode *node); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_) /** * Updates a buddy's icon. * @@ -557,7 +561,7 @@ */ PurpleBuddy *purple_contact_get_priority_buddy(PurpleContact *contact); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_) /** * Sets the alias for a contact. *
--- a/libpurple/buddyicon.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/buddyicon.c Thu Nov 13 19:50:53 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PURPLE_BUDDYICON_C_ + #include "internal.h" #include "buddyicon.h" #include "conversation.h" @@ -954,7 +956,6 @@ return purple_buddy_icons_node_set_custom_icon(node, data, len); } -#ifndef PURPLE_DISABLE_DEPRECATED gboolean purple_buddy_icons_has_custom_icon(PurpleContact *contact) { @@ -973,7 +974,6 @@ { return purple_buddy_icons_node_set_custom_icon((PurpleBlistNode*)contact, icon_data, icon_len); } -#endif void _purple_buddy_icon_set_old_icons_dir(const char *dirname)
--- a/libpurple/buddyicon.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/buddyicon.h Thu Nov 13 19:50:53 2008 +0000 @@ -337,7 +337,7 @@ purple_buddy_icons_node_set_custom_icon_from_file(PurpleBlistNode *node, const gchar *filename); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BUDDYICON_C_) /** * PurpleContact version of purple_buddy_icons_node_has_custom_icon. *
--- a/libpurple/connection.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/connection.c Thu Nov 13 19:50:53 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PURPLE_CONNECTION_C_ + #include "internal.h" #include "account.h" #include "blist.h" @@ -99,6 +101,12 @@ void purple_connection_new(PurpleAccount *account, gboolean regist, const char *password) { + _purple_connection_new(account, regist, password); +} + +void +_purple_connection_new(PurpleAccount *account, gboolean regist, const char *password) +{ PurpleConnection *gc; PurplePlugin *prpl; PurplePluginProtocolInfo *prpl_info; @@ -170,9 +178,14 @@ prpl_info->login(account); } } +void +purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data) +{ + _purple_connection_new_unregister(account, password, cb, user_data); +} void -purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data) +_purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data) { /* Lots of copy/pasted code to avoid API changes. You might want to integrate that into the previous function when posssible. */ PurpleConnection *gc; @@ -230,6 +243,12 @@ void purple_connection_destroy(PurpleConnection *gc) { + _purple_connection_destroy(gc); +} + +void +_purple_connection_destroy(PurpleConnection *gc) +{ PurpleAccount *account; GSList *buddies; PurplePluginProtocolInfo *prpl_info = NULL;
--- a/libpurple/connection.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/connection.h Thu Nov 13 19:50:53 2008 +0000 @@ -268,7 +268,7 @@ /**************************************************************************/ /*@{*/ -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_) /** * This function should only be called by purple_account_connect() * in account.c. If you're trying to sign on an account, use that @@ -292,7 +292,7 @@ const char *password); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_) /** * This function should only be called by purple_account_unregister() * in account.c. @@ -310,7 +310,7 @@ void purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_) /** * Disconnects and destroys a PurpleConnection. *
--- a/libpurple/dbus-server.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/dbus-server.c Thu Nov 13 19:50:53 2008 +0000 @@ -29,6 +29,10 @@ #include <stdlib.h> #include <string.h> +/* Allow the code below to see deprecated functions, so we can continue to + * export them via DBus. */ +#undef PURPLE_DISABLE_DEPRECATED + #include "account.h" #include "blist.h" #include "conversation.h"
--- a/libpurple/internal.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/internal.h Thu Nov 13 19:50:53 2008 +0000 @@ -231,6 +231,12 @@ #define PURPLE_WEBSITE "http://pidgin.im/" #define PURPLE_DEVEL_WEBSITE "http://developer.pidgin.im/" + +/* INTERNAL FUNCTIONS */ + +#include "account.h" +#include "connection.h" + /* This is for the accounts code to notify the buddy icon code that * it's done loading. We may want to replace this with a signal. */ void @@ -247,4 +253,48 @@ void _purple_buddy_icon_set_old_icons_dir(const char *dirname); +/** + * Creates a connection to the specified account and either connects + * or attempts to register a new account. If you are logging in, + * the connection uses the current active status for this account. + * So if you want to sign on as "away," for example, you need to + * have called purple_account_set_status(account, "away"). + * (And this will call purple_account_connect() automatically). + * + * @note This function should only be called by purple_account_connect() + * in account.c. If you're trying to sign on an account, use that + * function instead. + * + * @param account The account the connection should be connecting to. + * @param regist Whether we are registering a new account or just + * trying to do a normal signon. + * @param password The password to use. + */ +void _purple_connection_new(PurpleAccount *account, gboolean regist, + const char *password); +/** + * Tries to unregister the account on the server. If the account is not + * connected, also creates a new connection. + * + * @note This function should only be called by purple_account_unregister() + * in account.c. + * + * @param account The account to unregister + * @param password The password to use. + * @param cb Optional callback to be called when unregistration is complete + * @param user_data user data to pass to the callback + */ +void _purple_connection_new_unregister(PurpleAccount *account, const char *password, + PurpleAccountUnregistrationCb cb, void *user_data); +/** + * Disconnects and destroys a PurpleConnection. + * + * @note This function should only be called by purple_account_disconnect() + * in account.c. If you're trying to sign off an account, use that + * function instead. + * + * @param gc The purple connection to destroy. + */ +void _purple_connection_destroy(PurpleConnection *gc); + #endif /* _PURPLE_INTERNAL_H_ */
--- a/libpurple/network.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/network.h Thu Nov 13 19:50:53 2008 +0000 @@ -106,7 +106,6 @@ */ const char *purple_network_get_my_ip(int fd); -#ifndef PURPLE_DISABLE_DEPRECATED /** * Should calls to purple_network_listen() and purple_network_listen_range() * map the port externally using NAT-PMP or UPnP? @@ -118,7 +117,6 @@ * @since 2.3.0 */ void purple_network_listen_map_external(gboolean map_external); -#endif /** * Attempts to open a listening port ONLY on the specified port number. @@ -203,11 +201,9 @@ unsigned short purple_network_get_port_from_fd(int fd); /** - * Detects if there is an available Internet connection. Note that this call - * could block for the amount of time specified in inet_detect_timeout, so - * using it in a UI thread may cause uncomfortableness + * Detects if there is an available network connection. * - * @return TRUE if the Internet is available + * @return TRUE if the network is available */ gboolean purple_network_is_available(void);
--- a/libpurple/notify.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/notify.c Thu Nov 13 19:50:53 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PURPLE_NOTIFY_C_ + #include "internal.h" #include "dbus-maybe.h" #include "notify.h"
--- a/libpurple/notify.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/notify.h Thu Nov 13 19:50:53 2008 +0000 @@ -289,7 +289,7 @@ */ void purple_notify_searchresults_row_add(PurpleNotifySearchResults *results, GList *row); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_) /** * Returns a number of the rows in the search results object. * @@ -310,7 +310,7 @@ guint purple_notify_searchresults_get_rows_count(PurpleNotifySearchResults *results); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_) /** * Returns a number of the columns in the search results object. * @@ -331,7 +331,7 @@ guint purple_notify_searchresults_get_columns_count(PurpleNotifySearchResults *results); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_) /** * Returns a row of the results from the search results object. * @@ -354,7 +354,7 @@ unsigned int row_id); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_) /** * Returns a title of the search results object's column. *
--- a/libpurple/plugin.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugin.c Thu Nov 13 19:50:53 2008 +0000 @@ -19,6 +19,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PURPLE_PLUGIN_C_ + #include "internal.h" #include "accountopt.h"
--- a/libpurple/plugin.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugin.h Thu Nov 13 19:50:53 2008 +0000 @@ -533,7 +533,7 @@ */ gboolean purple_plugins_enabled(void); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Registers a function that will be called when probing is finished. * @@ -544,7 +544,7 @@ void purple_plugins_register_probe_notify_cb(void (*func)(void *), void *data); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Unregisters a function that would be called when probing is finished. * @@ -554,7 +554,7 @@ void purple_plugins_unregister_probe_notify_cb(void (*func)(void *)); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Registers a function that will be called when a plugin is loaded. * @@ -566,7 +566,7 @@ void *data); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Unregisters a function that would be called when a plugin is loaded. * @@ -576,7 +576,7 @@ void purple_plugins_unregister_load_notify_cb(void (*func)(PurplePlugin *, void *)); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Registers a function that will be called when a plugin is unloaded. * @@ -588,7 +588,7 @@ void *data); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Unregisters a function that would be called when a plugin is unloaded. *
--- a/libpurple/plugins/autoaccept.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugins/autoaccept.c Thu Nov 13 19:50:53 2008 +0000 @@ -104,7 +104,7 @@ return; } - node = node->parent; + node = purple_blist_node_get_parent(node); g_return_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(node)); pref = purple_prefs_get_string(PREF_PATH); @@ -179,7 +179,7 @@ save_cb(PurpleBlistNode *node, int choice) { if (PURPLE_BLIST_NODE_IS_BUDDY(node)) - node = node->parent; + node = purple_blist_node_get_parent(node); g_return_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(node)); purple_blist_node_set_int(node, "autoaccept", choice); } @@ -190,7 +190,7 @@ char *message; if (PURPLE_BLIST_NODE_IS_BUDDY(node)) - node = node->parent; + node = purple_blist_node_get_parent(node); g_return_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(node)); message = g_strdup_printf(_("When a file-transfer request arrives from %s"),
--- a/libpurple/plugins/log_reader.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugins/log_reader.c Thu Nov 13 19:50:53 2008 +0000 @@ -661,8 +661,10 @@ username = g_strdup(purple_normalize(account, account->username)); } - if (buddy) - savedfilename = purple_blist_node_get_string(&buddy->node, "log_reader_msn_log_filename"); + if (buddy) { + savedfilename = purple_blist_node_get_string((PurpleBlistNode *)buddy, + "log_reader_msn_log_filename"); + } if (savedfilename) { /* As a special case, we allow the null string to kill the parsing @@ -822,7 +824,8 @@ * detected for both buddies. */ if (buddy && logfile) { - purple_blist_node_set_string(&buddy->node, "log_reader_msn_log_filename", logfile); + PurpleBlistNode *node = (PurpleBlistNode *)buddy; + purple_blist_node_set_string(node, "log_reader_msn_log_filename", logfile); g_free(logfile); } @@ -981,8 +984,8 @@ gboolean from_name_matches; gboolean to_name_matches; - if (buddy && buddy->alias) - their_name = buddy->alias; + if (buddy) + their_name = purple_buddy_get_alias(buddy); if (log->account->alias) { @@ -1018,13 +1021,14 @@ } else if (to_name_matches) { name_guessed = NAME_GUESS_THEM; } else { - if (buddy && buddy->alias) { - char *alias = g_strdup(buddy->alias); + if (buddy) { + const char *server_alias = NULL; + char *alias = g_strdup(purple_buddy_get_alias(buddy)); + char *temp; /* "Truncate" the string at the first non-alphanumeric * character. The idea is to relax the comparison. */ - char *temp; for (temp = alias; *temp ; temp++) { if (!isalnum(*temp)) { *temp = '\0'; @@ -1056,9 +1060,9 @@ } } else if (to_name_matches) { name_guessed = NAME_GUESS_ME; - } else if (buddy->server_alias) { + } else if ((server_alias = purple_buddy_get_server_alias(buddy))) { friendly_name_length = - strlen(buddy->server_alias); + strlen(server_alias); /* Try to guess which user is them. * The first step is to determine if either of @@ -1068,13 +1072,13 @@ */ from_name_matches = (purple_str_has_prefix( from_name, - buddy->server_alias) && + server_alias) && !isalnum(*(from_name + friendly_name_length))); to_name_matches = to_name && ( (purple_str_has_prefix( - to_name, buddy->server_alias) && + to_name, server_alias) && !isalnum(*(to_name + friendly_name_length)))); @@ -1565,18 +1569,30 @@ g_string_append(formatted, "</b>"); footer = NULL; } else if (strstr(line, " signed off ")) { - if (buddy != NULL && buddy->alias) + const char *alias = NULL; + + if (buddy != NULL) + alias = purple_buddy_get_alias(buddy); + + if (alias != NULL) { g_string_append_printf(formatted, - _("%s has signed off."), buddy->alias); - else + _("%s has signed off."), alias); + } else { g_string_append_printf(formatted, _("%s has signed off."), log->name); + } line = ""; } else if (strstr(line, " signed on ")) { - if (buddy != NULL && buddy->alias) - g_string_append(formatted, buddy->alias); + const char *alias = NULL; + + if (buddy != NULL) + alias = purple_buddy_get_alias(buddy); + + if (alias != NULL) + g_string_append(formatted, alias); else g_string_append(formatted, log->name); + line = " logged in."; } else if (purple_str_has_prefix(line, "One or more messages may have been undeliverable.")) { @@ -1631,11 +1647,15 @@ footer = "</span></b>"; } } else if (purple_str_has_prefix(line, data->their_nickname)) { - if (buddy != NULL && buddy->alias) { - line += strlen(data->their_nickname) + 2; - g_string_append_printf(formatted, - "<span style=\"color: #A82F2F;\">" - "<b>%s</b></span>: ", buddy->alias); + if (buddy != NULL) { + const char *alias = purple_buddy_get_alias(buddy); + + if (alias != NULL) { + line += strlen(data->their_nickname) + 2; + g_string_append_printf(formatted, + "<span style=\"color: #A82F2F;\">" + "<b>%s</b></span>: ", alias); + } } } else { const char *line2 = strstr(line, ":"); @@ -2001,10 +2021,14 @@ g_string_append(formatted, "</font> "); if (is_in_message) { - if (buddy_name != NULL && buddy != NULL && buddy->alias) { + const char *alias = NULL; + + if (buddy_name != NULL && buddy != NULL && + (alias = purple_buddy_get_alias(buddy))) + { g_string_append_printf(formatted, "<span style=\"color: #A82F2F;\">" - "<b>%s</b></span>: ", buddy->alias); + "<b>%s</b></span>: ", alias); } } else { const char *acct_name;
--- a/libpurple/plugins/perl/common/BuddyList.xs Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugins/perl/common/BuddyList.xs Thu Nov 13 19:50:53 2008 +0000 @@ -1,3 +1,4 @@ +#undef PURPLE_DISABLE_DEPRECATED #include "module.h" #include "../perl-handlers.h"
--- a/libpurple/plugins/perl/common/Notify.xs Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugins/perl/common/Notify.xs Thu Nov 13 19:50:53 2008 +0000 @@ -6,7 +6,7 @@ BOOT: { HV *type_stash = gv_stashpv("Purple::Notify::Type", 1); - HV *msg_type_stash = gv_stashpv("Purple::Notify:Msg", 1); + HV *msg_type_stash = gv_stashpv("Purple::Notify::Msg", 1); HV *user_info_stash = gv_stashpv("Purple::NotifyUserInfo::Type", 1); static const constiv *civ, type_const_iv[] = {
--- a/libpurple/plugins/perl/common/module.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugins/perl/common/module.h Thu Nov 13 19:50:53 2008 +0000 @@ -1,4 +1,6 @@ - +/* Allow the Perl code to see deprecated functions, so we can continue to + * export them to Perl plugins. */ +#undef PURPLE_DISABLE_DEPRECATED typedef struct group *Purple__Group;
--- a/libpurple/plugins/signals-test.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugins/signals-test.c Thu Nov 13 19:50:53 2008 +0000 @@ -116,8 +116,9 @@ PurpleStatus *status, void *data) { purple_debug_misc("signals test", "buddy-status-changed (%s %s to %s)\n", - buddy->name, purple_status_get_id(old_status), - purple_status_get_id(status)); + purple_buddy_get_name(buddy), + purple_status_get_id(old_status), + purple_status_get_id(status)); } static void @@ -125,25 +126,29 @@ void *data) { purple_debug_misc("signals test", "buddy-idle-changed (%s %s)\n", - buddy->name, old_idle ? "unidled" : "idled"); + purple_buddy_get_name(buddy), + old_idle ? "unidled" : "idled"); } static void buddy_signed_on_cb(PurpleBuddy *buddy, void *data) { - purple_debug_misc("signals test", "buddy-signed-on (%s)\n", buddy->name); + purple_debug_misc("signals test", "buddy-signed-on (%s)\n", + purple_buddy_get_name(buddy)); } static void buddy_signed_off_cb(PurpleBuddy *buddy, void *data) { - purple_debug_misc("signals test", "buddy-signed-off (%s)\n", buddy->name); + purple_debug_misc("signals test", "buddy-signed-off (%s)\n", + purple_buddy_get_name(buddy)); } static void buddy_added_cb(PurpleBuddy *buddy, void *data) { - purple_debug_misc("signals test", "buddy_added_cb (%s)\n", purple_buddy_get_name(buddy)); + purple_debug_misc("signals test", "buddy_added_cb (%s)\n", + purple_buddy_get_name(buddy)); } static void @@ -160,17 +165,27 @@ PurpleChat *c = (PurpleChat *)node; PurpleGroup *g = (PurpleGroup *)node; - if (PURPLE_BLIST_NODE_IS_CONTACT(node)) - purple_debug_misc("signals test", "blist-node-aliased (Contact: %s, %s)\n", p->alias, old_alias); - else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) - purple_debug_misc("signals test", "blist-node-aliased (Buddy: %s, %s)\n", b->name, old_alias); - else if (PURPLE_BLIST_NODE_IS_CHAT(node)) - purple_debug_misc("signals test", "blist-node-aliased (Chat: %s, %s)\n", c->alias, old_alias); - else if (PURPLE_BLIST_NODE_IS_GROUP(node)) - purple_debug_misc("signals test", "blist-node-aliased (Group: %s, %s)\n", g->name, old_alias); - else - purple_debug_misc("signals test", "blist-node-aliased (UNKNOWN: %d, %s)\n", node->type, old_alias); - + if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { + purple_debug_misc("signals test", + "blist-node-aliased (Contact: %s, %s)\n", + purple_contact_get_alias(p), old_alias); + } else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { + purple_debug_misc("signals test", + "blist-node-aliased (Buddy: %s, %s)\n", + purple_buddy_get_name(b), old_alias); + } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { + purple_debug_misc("signals test", + "blist-node-aliased (Chat: %s, %s)\n", + purple_chat_get_name(c), old_alias); + } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { + purple_debug_misc("signals test", + "blist-node-aliased (Group: %s, %s)\n", + purple_group_get_name(g), old_alias); + } else { + purple_debug_misc("signals test", + "blist-node-aliased (UNKNOWN: %d, %s)\n", + purple_blist_node_get_type(node), old_alias); + } } static void @@ -181,17 +196,27 @@ PurpleChat *c = (PurpleChat *)node; PurpleGroup *g = (PurpleGroup *)node; - if (PURPLE_BLIST_NODE_IS_CONTACT(node)) - purple_debug_misc("signals test", "blist-node-extended-menu (Contact: %s)\n", p->alias); - else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) - purple_debug_misc("signals test", "blist-node-extended-menu (Buddy: %s)\n", b->name); - else if (PURPLE_BLIST_NODE_IS_CHAT(node)) - purple_debug_misc("signals test", "blist-node-extended-menu (Chat: %s)\n", c->alias); - else if (PURPLE_BLIST_NODE_IS_GROUP(node)) - purple_debug_misc("signals test", "blist-node-extended-menu (Group: %s)\n", g->name); - else - purple_debug_misc("signals test", "blist-node-extended-menu (UNKNOWN: %d)\n", node->type); - + if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { + purple_debug_misc("signals test", + "blist-node-extended-menu (Contact: %s)\n", + purple_contact_get_alias(p)); + } else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { + purple_debug_misc("signals test", + "blist-node-extended-menu (Buddy: %s)\n", + purple_buddy_get_name(b)); + } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { + purple_debug_misc("signals test", + "blist-node-extended-menu (Chat: %s)\n", + purple_chat_get_name(c)); + } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { + purple_debug_misc("signals test", + "blist-node-extended-menu (Group: %s)\n", + purple_group_get_name(g)); + } else { + purple_debug_misc("signals test", + "blist-node-extended-menu (UNKNOWN: %d)\n", + purple_blist_node_get_type(node)); + } }
--- a/libpurple/plugins/ssl/ssl-nss.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugins/ssl/ssl-nss.c Thu Nov 13 19:50:53 2008 +0000 @@ -757,7 +757,7 @@ crt_dat = X509_NSS_DATA(crt); g_return_val_if_fail(crt_dat, NULL); - return g_strdup(crt_dat->subjectName); + return g_strdup(crt_dat->issuerName); } static gchar *
--- a/libpurple/plugins/statenotify.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugins/statenotify.c Thu Nov 13 19:50:53 2008 +0000 @@ -15,13 +15,18 @@ static void write_status(PurpleBuddy *buddy, const char *message) { + PurpleAccount *account = NULL; PurpleConversation *conv; const char *who; char buf[256]; char *escaped; + const gchar *buddy_name = NULL; + + account = purple_buddy_get_account(buddy); + buddy_name = purple_buddy_get_name(buddy); conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, - buddy->name, buddy->account); + buddy_name, account); if (conv == NULL) return;
--- a/libpurple/plugins/tcl/tcl_cmds.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugins/tcl/tcl_cmds.c Thu Nov 13 19:50:53 2008 +0000 @@ -414,7 +414,7 @@ Tcl_Obj *list, *tclgroup, *tclgrouplist, *tclcontact, *tclcontactlist, *tclbud, **elems, *result; const char *cmds[] = { "alias", "handle", "info", "list", NULL }; enum { CMD_BUDDY_ALIAS, CMD_BUDDY_HANDLE, CMD_BUDDY_INFO, CMD_BUDDY_LIST } cmd; - PurpleBuddyList *blist; + PurpleBlistNodeType type; PurpleBlistNode *node, *gnode, *bnode; PurpleAccount *account; PurpleBuddy *bud; @@ -438,10 +438,11 @@ return error; if ((node = tcl_list_to_buddy(interp, count, elems)) == NULL) return TCL_ERROR; - if (node->type == PURPLE_BLIST_CHAT_NODE) + type = purple_blist_node_get_type(node); + if (type == PURPLE_BLIST_CHAT_NODE) Tcl_SetObjResult(interp, - Tcl_NewStringObj(((PurpleChat *)node)->alias, -1)); - else if (node->type == PURPLE_BLIST_BUDDY_NODE) + Tcl_NewStringObj(purple_chat_get_name((PurpleChat *)node), -1)); + else if (type == PURPLE_BLIST_BUDDY_NODE) Tcl_SetObjResult(interp, Tcl_NewStringObj((char *)purple_buddy_get_alias((PurpleBuddy *)node), -1)); return TCL_OK; @@ -494,15 +495,17 @@ } } list = Tcl_NewListObj(0, NULL); - blist = purple_get_blist(); - for (gnode = blist->root; gnode != NULL; gnode = gnode->next) { + for (gnode = purple_blist_get_root(); gnode != NULL; gnode = purple_blist_node_get_sibling_next(gnode)) { tclgroup = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(interp, tclgroup, Tcl_NewStringObj("group", -1)); Tcl_ListObjAppendElement(interp, tclgroup, - Tcl_NewStringObj(((PurpleGroup *)gnode)->name, -1)); + Tcl_NewStringObj(purple_group_get_name((PurpleGroup *)gnode), -1)); tclgrouplist = Tcl_NewListObj(0, NULL); - for (node = gnode->child; node != NULL; node = node->next) { - switch (node->type) { + for (node = purple_blist_node_get_first_child(gnode); node != NULL; node = purple_blist_node_get_sibling_next(node)) { + PurpleAccount *account; + + type = purple_blist_node_get_type(node); + switch (type) { case PURPLE_BLIST_CONTACT_NODE: tclcontact = Tcl_NewListObj(0, NULL); Tcl_IncrRefCount(tclcontact); @@ -510,17 +513,18 @@ tclcontactlist = Tcl_NewListObj(0, NULL); Tcl_IncrRefCount(tclcontactlist); count = 0; - for (bnode = node->child; bnode != NULL; bnode = bnode ->next) { - if (bnode->type != PURPLE_BLIST_BUDDY_NODE) + for (bnode = purple_blist_node_get_first_child(node); bnode != NULL; bnode = purple_blist_node_get_sibling_next(bnode)) { + if (purple_blist_node_get_type(bnode) != PURPLE_BLIST_BUDDY_NODE) continue; bud = (PurpleBuddy *)bnode; - if (!all && !purple_account_is_connected(bud->account)) + account = purple_buddy_get_account(bud); + if (!all && !purple_account_is_connected(account)) continue; count++; tclbud = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj("buddy", -1)); - Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj(bud->name, -1)); - Tcl_ListObjAppendElement(interp, tclbud, purple_tcl_ref_new(PurpleTclRefAccount, bud->account)); + Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj(purple_buddy_get_name(bud), -1)); + Tcl_ListObjAppendElement(interp, tclbud, purple_tcl_ref_new(PurpleTclRefAccount, account)); Tcl_ListObjAppendElement(interp, tclcontactlist, tclbud); } if (count) { @@ -532,16 +536,17 @@ break; case PURPLE_BLIST_CHAT_NODE: cnode = (PurpleChat *)node; - if (!all && !purple_account_is_connected(cnode->account)) + account = purple_chat_get_account(cnode); + if (!all && !purple_account_is_connected(account)) continue; tclbud = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj("chat", -1)); - Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj(cnode->alias, -1)); - Tcl_ListObjAppendElement(interp, tclbud, purple_tcl_ref_new(PurpleTclRefAccount, cnode->account)); + Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj(purple_chat_get_name(cnode), -1)); + Tcl_ListObjAppendElement(interp, tclbud, purple_tcl_ref_new(PurpleTclRefAccount, account)); Tcl_ListObjAppendElement(interp, tclgrouplist, tclbud); break; default: - purple_debug(PURPLE_DEBUG_WARNING, "tcl", "Unexpected buddy type %d", node->type); + purple_debug(PURPLE_DEBUG_WARNING, "tcl", "Unexpected buddy type %d", type); continue; } }
--- a/libpurple/plugins/tcl/tcl_signals.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/plugins/tcl/tcl_signals.c Thu Nov 13 19:50:53 2008 +0000 @@ -292,13 +292,13 @@ node = *va_arg(args, PurpleBlistNode **); else node = va_arg(args, PurpleBlistNode *); - switch (node->type) { + switch (purple_blist_node_get_type(node)) { case PURPLE_BLIST_GROUP_NODE: arg = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(handler->interp, arg, Tcl_NewStringObj("group", -1)); Tcl_ListObjAppendElement(handler->interp, arg, - Tcl_NewStringObj(((PurpleGroup *)node)->name, -1)); + Tcl_NewStringObj(purple_group_get_name((PurpleGroup *)node), -1)); break; case PURPLE_BLIST_CONTACT_NODE: /* g_string_printf(val, "contact {%s}", Contact Name? ); */ @@ -309,20 +309,20 @@ Tcl_ListObjAppendElement(handler->interp, arg, Tcl_NewStringObj("buddy", -1)); Tcl_ListObjAppendElement(handler->interp, arg, - Tcl_NewStringObj(((PurpleBuddy *)node)->name, -1)); + Tcl_NewStringObj(purple_buddy_get_name((PurpleBuddy *)node), -1)); Tcl_ListObjAppendElement(handler->interp, arg, purple_tcl_ref_new(PurpleTclRefAccount, - ((PurpleBuddy *)node)->account)); + purple_buddy_get_account((PurpleBuddy *)node))); break; case PURPLE_BLIST_CHAT_NODE: arg = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(handler->interp, arg, Tcl_NewStringObj("chat", -1)); Tcl_ListObjAppendElement(handler->interp, arg, - Tcl_NewStringObj(((PurpleChat *)node)->alias, -1)); + Tcl_NewStringObj(purple_chat_get_name((PurpleChat *)node), -1)); Tcl_ListObjAppendElement(handler->interp, arg, purple_tcl_ref_new(PurpleTclRefAccount, - ((PurpleChat *)node)->account)); + purple_chat_get_account((PurpleChat *)node))); break; case PURPLE_BLIST_OTHER_NODE: arg = Tcl_NewStringObj("other", -1);
--- a/libpurple/protocols/bonjour/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/bonjour/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -30,10 +30,10 @@ if STATIC_BONJOUR st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libbonjour.a -libbonjour_a_SOURCES = $(BONJOURSOURCES) -libbonjour_a_CFLAGS = $(AM_CFLAGS) -libbonjour_a_LIBADD = $(AVAHI_LIBS) +noinst_LTLIBRARIES = libbonjour.la +libbonjour_la_SOURCES = $(BONJOURSOURCES) +libbonjour_la_CFLAGS = $(AM_CFLAGS) +libbonjour_la_LIBADD = $(AVAHI_LIBS) else @@ -44,12 +44,10 @@ endif - AM_CPPFLAGS = \ -I$(top_srcdir)/libpurple \ -I$(top_builddir)/libpurple \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) \ $(LIBXML_CFLAGS) \ - $(AVAHI_CFLAGS) - + $(AVAHI_CFLAGS) \ No newline at end of file
--- a/libpurple/protocols/bonjour/bonjour.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/bonjour/bonjour.c Thu Nov 13 19:50:53 2008 +0000 @@ -59,18 +59,18 @@ return; /* Go through and remove all buddies that belong to this account */ - for (cnode = ((PurpleBlistNode *) bonjour_group)->child; cnode; cnode = cnodenext) { - cnodenext = cnode->next; + for (cnode = purple_blist_node_get_first_child((PurpleBlistNode *) bonjour_group); cnode; cnode = cnodenext) { + cnodenext = purple_blist_node_get_sibling_next(cnode); if (!PURPLE_BLIST_NODE_IS_CONTACT(cnode)) continue; - for (bnode = cnode->child; bnode; bnode = bnodenext) { - bnodenext = bnode->next; + for (bnode = purple_blist_node_get_first_child(cnode); bnode; bnode = bnodenext) { + bnodenext = purple_blist_node_get_sibling_next(bnode); if (!PURPLE_BLIST_NODE_IS_BUDDY(bnode)) continue; buddy = (PurpleBuddy *) bnode; - if (buddy->account != account) + if (purple_buddy_get_account(buddy) != account) continue; - purple_prpl_got_user_status(account, buddy->name, "offline", NULL); + purple_prpl_got_user_status(account, purple_buddy_get_name(buddy), "offline", NULL); purple_account_remove_buddy(account, buddy, NULL); purple_blist_remove_buddy(buddy); }
--- a/libpurple/protocols/bonjour/buddy.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/bonjour/buddy.c Thu Nov 13 19:50:53 2008 +0000 @@ -127,7 +127,7 @@ { PurpleGroup *group; PurpleAccount *account = bonjour_buddy->account; - const char *status_id, *old_hash, *new_hash; + const char *status_id, *old_hash, *new_hash, *name; /* Translate between the Bonjour status and the Purple status */ if (bonjour_buddy->status != NULL && g_ascii_strcasecmp("dnd", bonjour_buddy->status) == 0) @@ -158,10 +158,11 @@ } buddy->proto_data = bonjour_buddy; + name = purple_buddy_get_name(buddy); /* Create the alias for the buddy using the first and the last name */ if (bonjour_buddy->nick) - serv_got_alias(purple_account_get_connection(account), buddy->name, bonjour_buddy->nick); + serv_got_alias(purple_account_get_connection(account), name, bonjour_buddy->nick); else { gchar *alias = NULL; const char *first, *last; @@ -172,18 +173,18 @@ (first && *first ? first : ""), (first && *first && last && *last ? " " : ""), (last && *last ? last : "")); - serv_got_alias(purple_account_get_connection(account), buddy->name, alias); + serv_got_alias(purple_account_get_connection(account), name, alias); g_free(alias); } /* Set the user's status */ if (bonjour_buddy->msg != NULL) - purple_prpl_got_user_status(account, buddy->name, status_id, + purple_prpl_got_user_status(account, name, status_id, "message", bonjour_buddy->msg, NULL); else - purple_prpl_got_user_status(account, buddy->name, status_id, NULL); + purple_prpl_got_user_status(account, name, status_id, NULL); - purple_prpl_got_user_idle(account, buddy->name, FALSE, 0); + purple_prpl_got_user_idle(account, name, FALSE, 0); /* TODO: Because we don't save Bonjour buddies in blist.xml, * we will always have to look up the buddy icon at login time. @@ -198,7 +199,7 @@ * as what we looked up. */ bonjour_dns_sd_retrieve_buddy_icon(bonjour_buddy); } else if (!new_hash) - purple_buddy_icons_set_for_user(account, buddy->name, NULL, 0, NULL); + purple_buddy_icons_set_for_user(account, name, NULL, 0, NULL); } /**
--- a/libpurple/protocols/bonjour/jabber.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/bonjour/jabber.c Thu Nov 13 19:50:53 2008 +0000 @@ -142,7 +142,7 @@ _jabber_parse_and_write_message_to_ui(xmlnode *message_node, PurpleBuddy *pb) { xmlnode *body_node, *html_node, *events_node; - PurpleConnection *gc = pb->account->gc; + PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(pb)); gchar *body = NULL; gboolean composing_event = FALSE; @@ -225,7 +225,7 @@ } /* Send the message to the UI */ - serv_got_im(gc, pb->name, body, 0, time(NULL)); + serv_got_im(gc, purple_buddy_get_name(pb), body, 0, time(NULL)); g_free(body); }
--- a/libpurple/protocols/gg/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/gg/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -52,19 +52,15 @@ if STATIC_GG st = -DPURPLE_STATIC_PRPL $(GADU_CFLAGS) -noinst_LIBRARIES = libgg.a -pkg_LTLIBRARIES = - -libgg_a_SOURCES = $(GGSOURCES) -libgg_a_CFLAGS = $(AM_CFLAGS) -libgg_a_LIBADD = $(GADU_LIBS) +noinst_LTLIBRARIES = libgg.la +libgg_la_SOURCES = $(GGSOURCES) +libgg_la_CFLAGS = $(AM_CFLAGS) +libgg_la_LIBADD = $(GADU_LIBS) else st = $(GADU_CFLAGS) pkg_LTLIBRARIES = libgg.la -noinst_LIBRARIES = - libgg_la_SOURCES = $(GGSOURCES) libgg_la_LIBADD = $(GLIB_LIBS) $(GADU_LIBS)
--- a/libpurple/protocols/gg/gg.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/gg/gg.c Thu Nov 13 19:50:53 2008 +0000 @@ -421,7 +421,7 @@ */ /* Need to disconnect or actually log in. For now, we disconnect. */ - purple_connection_destroy(gc); + purple_account_disconnect(account); exit_err: if(account->registration_cb) @@ -446,7 +446,7 @@ GGPInfo *info = gc->proto_data; GGPToken *token = info->token; - purple_connection_destroy(gc); + purple_account_disconnect(gc->account); g_free(token->id); g_free(token->data);
--- a/libpurple/protocols/irc/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/irc/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,8 +1,15 @@ -EXTRA_DIST = Makefile.mingw +EXTRA_DIST = \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) -IRCSOURCES = irc.c parse.c cmds.c msgs.c irc.h dcc_send.c +IRCSOURCES = \ + cmds.c \ + dcc_send.c \ + irc.c \ + irc.h \ + msgs.c \ + parse.c AM_CFLAGS = $(st) @@ -11,18 +18,14 @@ if STATIC_IRC st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libirc.a -pkg_LTLIBRARIES = - -libirc_a_SOURCES = $(IRCSOURCES) -libirc_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libirc.la +libirc_la_SOURCES = $(IRCSOURCES) +libirc_la_CFLAGS = $(AM_CFLAGS) else st = -pkg_LTLIBRARIES = libirc.la -noinst_LIBRARIES = - +pkg_LTLIBRARIES = libirc.la libirc_la_SOURCES = $(IRCSOURCES) libirc_la_LIBADD = $(GLIB_LIBS)
--- a/libpurple/protocols/irc/irc.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/irc/irc.c Thu Nov 13 19:50:53 2008 +0000 @@ -62,8 +62,6 @@ PurplePlugin *_irc_plugin = NULL; -static const char *status_chars = "@+%&"; - static void irc_view_motd(PurplePluginAction *action) { PurpleConnection *gc = (PurpleConnection *) action->context; @@ -518,10 +516,7 @@ char *plain; const char *args[2]; - if (strchr(status_chars, *who) != NULL) - args[0] = who + 1; - else - args[0] = who; + args[0] = irc_nick_skip_mode(irc, who); purple_markup_html_to_xhtml(what, NULL, &plain); args[1] = plain;
--- a/libpurple/protocols/irc/irc.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/irc/irc.h Thu Nov 13 19:50:53 2008 +0000 @@ -109,6 +109,8 @@ char *irc_mirc2html(const char *string); char *irc_mirc2txt(const char *string); +const char *irc_nick_skip_mode(struct irc_conn *irc, const char *string); + gboolean irc_ischannel(const char *string); void irc_register_commands(void);
--- a/libpurple/protocols/irc/parse.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/irc/parse.c Thu Nov 13 19:50:53 2008 +0000 @@ -497,6 +497,19 @@ return result; } +const char *irc_nick_skip_mode(struct irc_conn *irc, const char *nick) +{ + static const char *default_modes = "@+%&"; + const char *mode_chars; + + mode_chars = irc->mode_chars ? irc->mode_chars : default_modes; + + while (strchr(mode_chars, *nick) != NULL) + nick++; + + return nick; +} + gboolean irc_ischannel(const char *string) { return (string[0] == '#' || string[0] == '&');
--- a/libpurple/protocols/jabber/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/jabber/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ - Makefile.mingw \ - win32/posix.uname.c \ - win32/utsname.h + Makefile.mingw \ + win32/posix.uname.c \ + win32/utsname.h pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -61,20 +61,16 @@ if STATIC_JABBER st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libjabber.a -pkg_LTLIBRARIES = - -libjabber_a_SOURCES = $(JABBERSOURCES) libxmpp.c -libjabber_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libjabber.la +libjabber_la_SOURCES = $(JABBERSOURCES) libxmpp.c +libjabber_la_CFLAGS = $(AM_CFLAGS) else st = -pkg_LTLIBRARIES = libjabber.la libxmpp.la -noinst_LIBRARIES = - +pkg_LTLIBRARIES = libjabber.la libxmpp.la libjabber_la_SOURCES = $(JABBERSOURCES) -libjabber_la_LIBADD = $(GLIB_LIBS) $(SASL_LIBS) $(LIBXML_LIBS) +libjabber_la_LIBADD = $(GLIB_LIBS) $(SASL_LIBS) $(LIBXML_LIBS) libxmpp_la_SOURCES = libxmpp.c libxmpp_la_LIBADD = libjabber.la
--- a/libpurple/protocols/jabber/buddy.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/jabber/buddy.c Thu Nov 13 19:50:53 2008 +0000 @@ -2510,12 +2510,13 @@ } for (iter = jbr->caps->features ; iter ; iter = g_list_next(iter)) { - purple_debug_info("jabber", "Found cap: %s\n", (char *)iter->data); if (strcmp(iter->data, cap) == 0) { + purple_debug_info("jabber", "Found cap: %s\n", (char *)iter->data); return TRUE; } } + purple_debug_info("jabber", "Cap %s not found\n", cap); return FALSE; }
--- a/libpurple/protocols/msn/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ - directconn.c \ - directconn.h \ - Makefile.mingw + directconn.c \ + directconn.h \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -74,9 +74,9 @@ if STATIC_MSN st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libmsn.a -libmsn_a_SOURCES = $(MSNSOURCES) -libmsn_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libmsn.la +libmsn_la_SOURCES = $(MSNSOURCES) +libmsn_la_CFLAGS = $(AM_CFLAGS) else
--- a/libpurple/protocols/msn/httpconn.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/httpconn.c Thu Nov 13 19:50:53 2008 +0000 @@ -64,7 +64,6 @@ const char *body_start; char *tmp; size_t body_len = 0; - gboolean wasted = FALSE; g_return_val_if_fail(httpconn != NULL, FALSE); g_return_val_if_fail(buf != NULL, FALSE); @@ -158,8 +157,9 @@ } } - body = g_malloc0(body_len + 1); + body = g_malloc(body_len + 1); memcpy(body, body_start, body_len); + body[body_len] = '\0'; #ifdef MSN_DEBUG_HTTP purple_debug_misc("msn", "Incoming HTTP buffer (header): {%s\r\n}\n", @@ -217,15 +217,10 @@ g_free(tmp); - if ((session_action != NULL) && (strcmp(session_action, "close") == 0)) - wasted = TRUE; - - g_free(session_action); - t = strchr(full_session_id, '.'); session_id = g_strndup(full_session_id, t - full_session_id); - if (!wasted) + if (session_action == NULL || strcmp(session_action, "close") != 0) { g_free(httpconn->full_session_id); httpconn->full_session_id = full_session_id; @@ -254,6 +249,8 @@ g_free(session_id); g_free(gw_ip); } + + g_free(session_action); } g_free(header); @@ -723,7 +720,7 @@ httpconn->inpa = purple_input_add(httpconn->fd, PURPLE_INPUT_READ, read_cb, data); - httpconn->timer = purple_timeout_add(2000, msn_httpconn_poll, httpconn); + httpconn->timer = purple_timeout_add_seconds(2, msn_httpconn_poll, httpconn); msn_httpconn_process_queue(httpconn); }
--- a/libpurple/protocols/msn/msg.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/msg.c Thu Nov 13 19:50:53 2008 +0000 @@ -192,8 +192,9 @@ if (body_len > 0) { msg->body_len = len - (tmp - body); - msg->body = g_malloc0(msg->body_len + 1); + msg->body = g_malloc(msg->body_len + 1); memcpy(msg->body, tmp, msg->body_len); + msg->body[msg->body_len] = '\0'; tmp += body_len; } } @@ -209,8 +210,9 @@ char **elems, **cur, **tokens; g_return_if_fail(payload != NULL); - tmp_base = tmp = g_malloc0(payload_len + 1); + tmp_base = tmp = g_malloc(payload_len + 1); memcpy(tmp_base, payload, payload_len); + tmp_base[payload_len] = '\0'; /* Parse the attributes. */ end = strstr(tmp, body_dem); @@ -308,8 +310,9 @@ if (body_len > 0) { msg->body_len = body_len; g_free(msg->body); - msg->body = g_malloc0(msg->body_len + 1); + msg->body = g_malloc(msg->body_len + 1); memcpy(msg->body, tmp, msg->body_len); + msg->body[msg->body_len] = '\0'; tmp += body_len; } @@ -325,8 +328,9 @@ if (payload_len - (tmp - tmp_base) > 0) { msg->body_len = payload_len - (tmp - tmp_base); g_free(msg->body); - msg->body = g_malloc0(msg->body_len + 1); + msg->body = g_malloc(msg->body_len + 1); memcpy(msg->body, tmp, msg->body_len); + msg->body[msg->body_len] = '\0'; } } @@ -523,8 +527,9 @@ if (data != NULL && len > 0) { - msg->body = g_malloc0(len + 1); + msg->body = g_malloc(len + 1); memcpy(msg->body, data, len); + msg->body[len] = '\0'; msg->body_len = len; } else
--- a/libpurple/protocols/msn/notification.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/notification.c Thu Nov 13 19:50:53 2008 +0000 @@ -578,7 +578,7 @@ g_snprintf(fmt_str, sizeof(fmt_str), "%d", MSN_NETWORK_PASSPORT); /*mobile*/ - //type_str = g_strdup_printf("4"); + /*type_str = g_strdup_printf("4");*/ xmlnode_set_attrib(c_node, "t", fmt_str); xmlnode_insert_child(d_node, c_node);
--- a/libpurple/protocols/msn/servconn.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/servconn.c Thu Nov 13 19:50:53 2008 +0000 @@ -239,15 +239,7 @@ servconn->connect_data = purple_proxy_connect(NULL, session->account, host, port, connect_cb, servconn); - if (servconn->connect_data != NULL) - { - servconn->processing = TRUE; - return TRUE; - } - else - { - return FALSE; - } + return (servconn->connect_data != NULL); } void
--- a/libpurple/protocols/msn/session.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/session.c Thu Nov 13 19:50:53 2008 +0000 @@ -118,12 +118,7 @@ g_return_val_if_reached(FALSE); } - if (msn_notification_connect(session->notification, host, port)) - { - return TRUE; - } - - return FALSE; + return msn_notification_connect(session->notification, host, port); } void @@ -460,8 +455,10 @@ gc = purple_account_get_connection(account); img = purple_buddy_icons_find_account_icon(session->account); + /* TODO: Do we really want to call this if img is NULL? */ msn_user_set_buddy_icon(session->user, img); - purple_imgstore_unref(img); + if (img != NULL) + purple_imgstore_unref(img); session->logged_in = TRUE;
--- a/libpurple/protocols/msn/slp.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/slp.c Thu Nov 13 19:50:53 2008 +0000 @@ -33,7 +33,7 @@ #include "smiley.h" /* ms to delay between sending buddy icon requests to the server. */ -#define BUDDY_ICON_DELAY 20000 +#define BUDDY_ICON_DELAY 20 /*debug SLP*/ #define MSN_DEBUG_UD @@ -97,7 +97,7 @@ content); g_free(content); - msn_slplink_unleash(slpcall->slplink); + msn_slplink_send_queued_slpmsgs(slpcall->slplink); } void @@ -115,7 +115,7 @@ { if (slpcall->started) { - msn_slp_call_close(slpcall); + msn_slpcall_close(slpcall); } else { @@ -126,9 +126,9 @@ content); g_free(content); - msn_slplink_unleash(slpcall->slplink); + msn_slplink_send_queued_slpmsgs(slpcall->slplink); - msn_slp_call_destroy(slpcall); + msn_slpcall_destroy(slpcall); } } } @@ -219,7 +219,7 @@ msn_slplink_queue_slpmsg(slplink, slpmsg); - msn_slp_call_session_init(slpcall); + msn_slpcall_session_init(slpcall); } static void @@ -385,6 +385,7 @@ send_bye(MsnSlpCall *slpcall, const char *type) { MsnSlpLink *slplink; + PurpleAccount *account; MsnSlpMessage *slpmsg; char *header; @@ -392,8 +393,10 @@ g_return_if_fail(slplink != NULL); + account = slplink->session->account; + header = g_strdup_printf("BYE MSNMSGR:%s MSNSLP/1.0", - slplink->local_user); + purple_account_get_username(account)); slpmsg = msn_slpmsg_sip_new(slpcall, 0, header, "A0D624A6-6C0C-4283-A9E0-BC97B4B46D32", @@ -585,10 +588,10 @@ } else { - msn_slp_call_session_init(slpcall); + msn_slpcall_session_init(slpcall); } #else - msn_slp_call_session_init(slpcall); + msn_slpcall_session_init(slpcall); #endif } else if (!strcmp(type, "application/x-msnmsgr-transreqbody")) @@ -643,7 +646,7 @@ char *content; char *content_type; - slpcall = msn_slp_call_new(slplink); + slpcall = msn_slpcall_new(slplink); /* From: <msnmsgr:buddy@hotmail.com> */ #if 0 @@ -708,7 +711,7 @@ slpcall->wasted = TRUE; - /* msn_slp_call_destroy(slpcall); */ + /* msn_slpcall_destroy(slpcall); */ return slpcall; } @@ -732,7 +735,7 @@ if (slpcall != NULL) slpcall->wasted = TRUE; - /* msn_slp_call_destroy(slpcall); */ + /* msn_slpcall_destroy(slpcall); */ } else slpcall = NULL; @@ -1054,8 +1057,8 @@ purple_timeout_remove(userlist->buddy_icon_request_timer); } - /* Wait BUDDY_ICON_DELAY ms before freeing our window slot and requesting the next icon. */ - userlist->buddy_icon_request_timer = purple_timeout_add(BUDDY_ICON_DELAY, + /* Wait BUDDY_ICON_DELAY s before freeing our window slot and requesting the next icon. */ + userlist->buddy_icon_request_timer = purple_timeout_add_seconds(BUDDY_ICON_DELAY, msn_release_buddy_icon_request_timeout, userlist); }
--- a/libpurple/protocols/msn/slpcall.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/slpcall.c Thu Nov 13 19:50:53 2008 +0000 @@ -33,8 +33,30 @@ * Main **************************************************************************/ +static gboolean +msn_slpcall_timeout(gpointer data) +{ + MsnSlpCall *slpcall; + + slpcall = data; + +#ifdef MSN_DEBUG_SLPCALL + purple_debug_info("msn", "slpcall_timeout: slpcall(%p)\n", slpcall); +#endif + + if (!slpcall->pending && !slpcall->progress) + { + msn_slpcall_destroy(slpcall); + return FALSE; + } + + slpcall->progress = FALSE; + + return TRUE; +} + MsnSlpCall * -msn_slp_call_new(MsnSlpLink *slplink) +msn_slpcall_new(MsnSlpLink *slplink) { MsnSlpCall *slpcall; @@ -50,16 +72,15 @@ msn_slplink_add_slpcall(slplink, slpcall); - slpcall->timer = purple_timeout_add(MSN_SLPCALL_TIMEOUT, msn_slp_call_timeout, slpcall); + slpcall->timer = purple_timeout_add_seconds(MSN_SLPCALL_TIMEOUT, msn_slpcall_timeout, slpcall); return slpcall; } void -msn_slp_call_destroy(MsnSlpCall *slpcall) +msn_slpcall_destroy(MsnSlpCall *slpcall) { GList *e; - MsnSession *session; #ifdef MSN_DEBUG_SLPCALL purple_debug_info("msn", "slpcall_destroy: slpcall(%p)\n", slpcall); @@ -86,18 +107,16 @@ } } - session = slpcall->slplink->session; - - msn_slplink_remove_slpcall(slpcall->slplink, slpcall); - if (slpcall->end_cb != NULL) - slpcall->end_cb(slpcall, session); + slpcall->end_cb(slpcall, slpcall->slplink->session); if (slpcall->xfer != NULL) { slpcall->xfer->data = NULL; purple_xfer_unref(slpcall->xfer); } + msn_slplink_remove_slpcall(slpcall->slplink, slpcall); + g_free(slpcall->id); g_free(slpcall->branch); g_free(slpcall->data_info); @@ -106,7 +125,7 @@ } void -msn_slp_call_init(MsnSlpCall *slpcall, MsnSlpCallType type) +msn_slpcall_init(MsnSlpCall *slpcall, MsnSlpCallType type) { slpcall->session_id = rand() % 0xFFFFFF00 + 4; slpcall->id = rand_guid(); @@ -114,7 +133,7 @@ } void -msn_slp_call_session_init(MsnSlpCall *slpcall) +msn_slpcall_session_init(MsnSlpCall *slpcall) { if (slpcall->session_init_cb) slpcall->session_init_cb(slpcall); @@ -123,7 +142,7 @@ } void -msn_slp_call_invite(MsnSlpCall *slpcall, const char *euf_guid, +msn_slpcall_invite(MsnSlpCall *slpcall, const char *euf_guid, int app_id, const char *context) { MsnSlpLink *slplink; @@ -166,36 +185,14 @@ } void -msn_slp_call_close(MsnSlpCall *slpcall) +msn_slpcall_close(MsnSlpCall *slpcall) { g_return_if_fail(slpcall != NULL); g_return_if_fail(slpcall->slplink != NULL); send_bye(slpcall, "application/x-msnmsgr-sessionclosebody"); - msn_slplink_unleash(slpcall->slplink); - msn_slp_call_destroy(slpcall); -} - -gboolean -msn_slp_call_timeout(gpointer data) -{ - MsnSlpCall *slpcall; - - slpcall = data; - -#ifdef MSN_DEBUG_SLPCALL - purple_debug_info("msn", "slpcall_timeout: slpcall(%p)\n", slpcall); -#endif - - if (!slpcall->pending && !slpcall->progress) - { - msn_slp_call_destroy(slpcall); - return FALSE; - } - - slpcall->progress = FALSE; - - return TRUE; + msn_slplink_send_queued_slpmsgs(slpcall->slplink); + msn_slpcall_destroy(slpcall); } MsnSlpCall * @@ -237,7 +234,7 @@ slpcall = slplink->directconn->initial_call; if (slpcall != NULL) - msn_slp_call_session_init(slpcall); + msn_slpcall_session_init(slpcall); } #endif
--- a/libpurple/protocols/msn/slpcall.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/slpcall.h Thu Nov 13 19:50:53 2008 +0000 @@ -32,7 +32,7 @@ #include "slplink.h" /* The official client seems to timeout slp calls after 5 minutes */ -#define MSN_SLPCALL_TIMEOUT 300000 +#define MSN_SLPCALL_TIMEOUT 300 typedef enum { @@ -43,7 +43,7 @@ struct _MsnSlpCall { - /* MsnSession *session; */ + /* Our parent slplink */ MsnSlpLink *slplink; MsnSlpCallType type; @@ -76,16 +76,15 @@ MsnSlpCb cb; void (*end_cb)(MsnSlpCall *slpcall, MsnSession *session); - int timer; + guint timer; }; -MsnSlpCall *msn_slp_call_new(MsnSlpLink *slplink); -void msn_slp_call_init(MsnSlpCall *slpcall, MsnSlpCallType type); -void msn_slp_call_session_init(MsnSlpCall *slpcall); -void msn_slp_call_destroy(MsnSlpCall *slpcall); -void msn_slp_call_invite(MsnSlpCall *slpcall, const char *euf_guid, +MsnSlpCall *msn_slpcall_new(MsnSlpLink *slplink); +void msn_slpcall_init(MsnSlpCall *slpcall, MsnSlpCallType type); +void msn_slpcall_session_init(MsnSlpCall *slpcall); +void msn_slpcall_destroy(MsnSlpCall *slpcall); +void msn_slpcall_invite(MsnSlpCall *slpcall, const char *euf_guid, int app_id, const char *context); -void msn_slp_call_close(MsnSlpCall *slpcall); -gboolean msn_slp_call_timeout(gpointer data); +void msn_slpcall_close(MsnSlpCall *slpcall); #endif /* _MSN_SLPCALL_H_ */
--- a/libpurple/protocols/msn/slplink.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/slplink.c Thu Nov 13 19:50:53 2008 +0000 @@ -27,8 +27,6 @@ #include "switchboard.h" #include "slp.h" -void msn_slplink_send_msgpart(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); - #ifdef MSN_DEBUG_SLP_FILES static int m_sc = 0; static int m_rc = 0; @@ -74,7 +72,6 @@ slplink->session = session; slplink->slp_seq_id = rand() % 0xFFFFFF00 + 4; - slplink->local_user = g_strdup(msn_user_get_passport(session->user)); slplink->remote_user = g_strdup(username); slplink->slp_msg_queue = g_queue_new(); @@ -107,14 +104,13 @@ #endif while (slplink->slp_calls != NULL) - msn_slp_call_destroy(slplink->slp_calls->data); + msn_slpcall_destroy(slplink->slp_calls->data); g_queue_free(slplink->slp_msg_queue); session->slplinks = g_list_remove(session->slplinks, slplink); - g_free(slplink->local_user); g_free(slplink->remote_user); g_free(slplink); @@ -168,19 +164,11 @@ { slplink->slp_calls = g_list_remove(slplink->slp_calls, slpcall); - /* The slplink has no slpcalls in it. If no one is using it, we might - * destroy the switchboard, but we should be careful not to use the slplink - * again. */ - if (slplink->slp_calls == NULL) - { - if (slplink->swboard != NULL) - { - if (msn_switchboard_release(slplink->swboard, MSN_SB_FLAG_FT)) - /* I'm not sure this is the best thing to do, but it's better - * than nothing. */ - slpcall->slplink = NULL; - } - } + /* The slplink has no slpcalls in it, release it from MSN_SB_FLAG_FT. + * If nothing else is using it then this might cause swboard to be + * destroyed. */ + if (slplink->slp_calls == NULL && slplink->swboard != NULL) + msn_switchboard_release(slplink->swboard, MSN_SB_FLAG_FT); } MsnSlpCall * @@ -220,7 +208,7 @@ return NULL; } -void +static void msn_slplink_send_msg(MsnSlpLink *slplink, MsnMessage *msg) { #if 0 @@ -236,8 +224,7 @@ slplink->swboard = msn_session_get_swboard(slplink->session, slplink->remote_user, MSN_SB_FLAG_FT); - if (slplink->swboard == NULL) - return; + g_return_if_fail(slplink->swboard != NULL); /* If swboard is destroyed we will be too */ slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink); @@ -247,54 +234,7 @@ } } -/* We have received the message ack */ static void -msg_ack(MsnMessage *msg, void *data) -{ - MsnSlpMessage *slpmsg; - long long real_size; - - slpmsg = data; - - real_size = (slpmsg->flags == 0x2) ? 0 : slpmsg->size; - - slpmsg->offset += msg->msnslp_header.length; - - if (slpmsg->offset < real_size) - { - msn_slplink_send_msgpart(slpmsg->slplink, slpmsg); - } - else - { - /* The whole message has been sent */ - if (slpmsg->flags == 0x20 || slpmsg->flags == 0x1000030) - { - if (slpmsg->slpcall != NULL) - { - if (slpmsg->slpcall->cb) - slpmsg->slpcall->cb(slpmsg->slpcall, - NULL, 0); - } - } - } - - slpmsg->msgs = g_list_remove(slpmsg->msgs, msg); -} - -/* We have received the message nak. */ -static void -msg_nak(MsnMessage *msg, void *data) -{ - MsnSlpMessage *slpmsg; - - slpmsg = data; - - msn_slplink_send_msgpart(slpmsg->slplink, slpmsg); - - slpmsg->msgs = g_list_remove(slpmsg->msgs, msg); -} - -void msn_slplink_send_msgpart(MsnSlpLink *slplink, MsnSlpMessage *slpmsg) { MsnMessage *msg; @@ -356,7 +296,54 @@ /* slpmsg->offset += len; */ } -void +/* We have received the message ack */ +static void +msg_ack(MsnMessage *msg, void *data) +{ + MsnSlpMessage *slpmsg; + long long real_size; + + slpmsg = data; + + real_size = (slpmsg->flags == 0x2) ? 0 : slpmsg->size; + + slpmsg->offset += msg->msnslp_header.length; + + if (slpmsg->offset < real_size) + { + msn_slplink_send_msgpart(slpmsg->slplink, slpmsg); + } + else + { + /* The whole message has been sent */ + if (slpmsg->flags == 0x20 || slpmsg->flags == 0x1000030) + { + if (slpmsg->slpcall != NULL) + { + if (slpmsg->slpcall->cb) + slpmsg->slpcall->cb(slpmsg->slpcall, + NULL, 0); + } + } + } + + slpmsg->msgs = g_list_remove(slpmsg->msgs, msg); +} + +/* We have received the message nak. */ +static void +msg_nak(MsnMessage *msg, void *data) +{ + MsnSlpMessage *slpmsg; + + slpmsg = data; + + msn_slplink_send_msgpart(slpmsg->slplink, slpmsg); + + slpmsg->msgs = g_list_remove(slpmsg->msgs, msg); +} + +static void msn_slplink_release_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg) { MsnMessage *msg; @@ -413,7 +400,7 @@ { slpmsg->id = slplink->slp_seq_id++; - g_queue_push_head(slplink->slp_msg_queue, slpmsg); + g_queue_push_tail(slplink->slp_msg_queue, slpmsg); } void @@ -425,19 +412,18 @@ } void -msn_slplink_unleash(MsnSlpLink *slplink) +msn_slplink_send_queued_slpmsgs(MsnSlpLink *slplink) { MsnSlpMessage *slpmsg; - /* Send the queued msgs in the order they came. */ - - while ((slpmsg = g_queue_pop_tail(slplink->slp_msg_queue)) != NULL) + /* Send the queued msgs in the order they were created */ + while ((slpmsg = g_queue_pop_head(slplink->slp_msg_queue)) != NULL) { msn_slplink_release_slpmsg(slplink, slpmsg); } } -void +static void msn_slplink_send_ack(MsnSlpLink *slplink, MsnMessage *msg) { MsnSlpMessage *slpmsg; @@ -481,6 +467,22 @@ msn_slplink_send_slpmsg(slpcall->slplink, slpmsg); } +static MsnSlpMessage * +msn_slplink_message_find(MsnSlpLink *slplink, long session_id, long id) +{ + GList *e; + + for (e = slplink->slp_msgs; e != NULL; e = e->next) + { + MsnSlpMessage *slpmsg = e->data; + + if ((slpmsg->session_id == session_id) && (slpmsg->id == id)) + return slpmsg; + } + + return NULL; +} + void msn_slplink_process_msg(MsnSlpLink *slplink, MsnMessage *msg) { @@ -632,32 +634,16 @@ /* Release all the messages and send the ACK */ msn_slplink_send_ack(slplink, msg); - msn_slplink_unleash(slplink); + msn_slplink_send_queued_slpmsgs(slplink); } msn_slpmsg_destroy(slpmsg); if (slpcall != NULL && slpcall->wasted) - msn_slp_call_destroy(slpcall); + msn_slpcall_destroy(slpcall); } } -MsnSlpMessage * -msn_slplink_message_find(MsnSlpLink *slplink, long session_id, long id) -{ - GList *e; - - for (e = slplink->slp_msgs; e != NULL; e = e->next) - { - MsnSlpMessage *slpmsg = e->data; - - if ((slpmsg->session_id == session_id) && (slpmsg->id == id)) - return slpmsg; - } - - return NULL; -} - typedef struct { guint32 length; @@ -743,8 +729,8 @@ g_return_if_fail(slplink != NULL); g_return_if_fail(fp != NULL); - slpcall = msn_slp_call_new(slplink); - msn_slp_call_init(slpcall, MSN_SLPCALL_DC); + slpcall = msn_slpcall_new(slplink); + msn_slpcall_init(slpcall, MSN_SLPCALL_DC); slpcall->session_init_cb = send_file_cb; slpcall->end_cb = msn_xfer_end_cb; @@ -761,7 +747,7 @@ context = gen_context(fn, fp); - msn_slp_call_invite(slpcall, MSN_FT_GUID, 2, context); + msn_slpcall_invite(slpcall, MSN_FT_GUID, 2, context); g_free(context); } @@ -784,14 +770,14 @@ msnobj_base64 = purple_base64_encode((const guchar *)msnobj_data, strlen(msnobj_data)); g_free(msnobj_data); - slpcall = msn_slp_call_new(slplink); - msn_slp_call_init(slpcall, MSN_SLPCALL_ANY); + slpcall = msn_slpcall_new(slplink); + msn_slpcall_init(slpcall, MSN_SLPCALL_ANY); slpcall->data_info = g_strdup(info); slpcall->cb = cb; slpcall->end_cb = end_cb; - msn_slp_call_invite(slpcall, MSN_OBJ_GUID, 1, msnobj_base64); + msn_slpcall_invite(slpcall, MSN_OBJ_GUID, 1, msnobj_base64); g_free(msnobj_base64); }
--- a/libpurple/protocols/msn/slplink.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/slplink.h Thu Nov 13 19:50:53 2008 +0000 @@ -45,7 +45,6 @@ MsnSession *session; MsnSwitchBoard *swboard; - char *local_user; char *remote_user; int slp_seq_id; @@ -78,19 +77,11 @@ MsnSlpCall *msn_slplink_find_slp_call(MsnSlpLink *slplink, const char *id); MsnSlpCall *msn_slplink_find_slp_call_with_session_id(MsnSlpLink *slplink, long id); -void msn_slplink_send_msg(MsnSlpLink *slplink, MsnMessage *msg); -void msn_slplink_release_slpmsg(MsnSlpLink *slplink, - MsnSlpMessage *slpmsg); void msn_slplink_queue_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); void msn_slplink_send_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); -void msn_slplink_unleash(MsnSlpLink *slplink); -void msn_slplink_send_ack(MsnSlpLink *slplink, MsnMessage *msg); +void msn_slplink_send_queued_slpmsgs(MsnSlpLink *slplink); void msn_slplink_process_msg(MsnSlpLink *slplink, MsnMessage *msg); -MsnSlpMessage *msn_slplink_message_find(MsnSlpLink *slplink, long session_id, long id); -void msn_slplink_append_slp_msg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); -void msn_slplink_remove_slp_msg(MsnSlpLink *slplink, - MsnSlpMessage *slpmsg); void msn_slplink_request_ft(MsnSlpLink *slplink, PurpleXfer *xfer); void msn_slplink_request_object(MsnSlpLink *slplink,
--- a/libpurple/protocols/msn/slpmsg.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/slpmsg.c Thu Nov 13 19:50:53 2008 +0000 @@ -169,6 +169,7 @@ const char *content_type, const char *content) { MsnSlpLink *slplink; + PurpleAccount *account; MsnSlpMessage *slpmsg; char *body; gsize body_len; @@ -178,6 +179,7 @@ g_return_val_if_fail(header != NULL, NULL); slplink = slpcall->slplink; + account = slplink->session->account; /* Let's remember that "content" should end with a 0x00 */ @@ -196,7 +198,7 @@ "\r\n", header, slplink->remote_user, - slplink->local_user, + purple_account_get_username(account), branch, cseq, slpcall->id,
--- a/libpurple/protocols/msn/soap.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/soap.c Thu Nov 13 19:50:53 2008 +0000 @@ -134,7 +134,7 @@ } if (session->soap_cleanup_handle == 0) - session->soap_cleanup_handle = purple_timeout_add(SOAP_TIMEOUT * 1000, + session->soap_cleanup_handle = purple_timeout_add_seconds(SOAP_TIMEOUT, msn_soap_cleanup_for_session, session); if (conn == NULL) {
--- a/libpurple/protocols/msn/switchboard.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/switchboard.c Thu Nov 13 19:50:53 2008 +0000 @@ -1315,10 +1315,10 @@ } } -gboolean +void msn_switchboard_release(MsnSwitchBoard *swboard, MsnSBFlag flag) { - g_return_val_if_fail(swboard != NULL, FALSE); + g_return_if_fail(swboard != NULL); swboard->flag &= ~flag; @@ -1328,12 +1328,8 @@ swboard->conv = NULL; if (swboard->flag == 0) - { + /* Nothing else is using this switchboard, so close it */ msn_switchboard_close(swboard); - return TRUE; - } - - return FALSE; } /**************************************************************************
--- a/libpurple/protocols/msn/switchboard.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/switchboard.h Thu Nov 13 19:50:53 2008 +0000 @@ -224,10 +224,8 @@ * * @param swboard The switchboard to release. * @param flag The flag that states the function. - * - * @return @c TRUE if the switchboard was closed, @c FALSE otherwise. */ -gboolean msn_switchboard_release(MsnSwitchBoard *swboard, MsnSBFlag flag); +void msn_switchboard_release(MsnSwitchBoard *swboard, MsnSBFlag flag); /** * Returns whether or not we currently can send a message through this
--- a/libpurple/protocols/msn/transaction.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msn/transaction.c Thu Nov 13 19:50:53 2008 +0000 @@ -211,7 +211,7 @@ purple_timeout_remove(trans->timer); } trans->timeout_cb = cb; - trans->timer = purple_timeout_add(60000, transaction_timeout, trans); + trans->timer = purple_timeout_add_seconds(60, transaction_timeout, trans); } void
--- a/libpurple/protocols/msnp9/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/msnp9/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,5 +1,5 @@ EXTRA_DIST = \ - Makefile.mingw + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -70,9 +70,9 @@ if STATIC_MSN st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libmsn.a -libmsn_a_SOURCES = $(MSNP9SOURCES) -libmsn_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libmsn.la +libmsn_la_SOURCES = $(MSNP9SOURCES) +libmsn_la_CFLAGS = $(AM_CFLAGS) else
--- a/libpurple/protocols/myspace/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/myspace/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,4 +1,5 @@ -EXTRA_DIST = Makefile.mingw +EXTRA_DIST = \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -23,9 +24,9 @@ if STATIC_MYSPACE st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libmyspace.a -libmyspace_a_SOURCES = $(MSIMSOURCES) -libmyspace_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libmyspace.la +libmyspace_la_SOURCES = $(MSIMSOURCES) +libmyspace_la_CFLAGS = $(AM_CFLAGS) else
--- a/libpurple/protocols/novell/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/novell/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,5 +1,5 @@ EXTRA_DIST = \ - Makefile.mingw + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -33,18 +33,14 @@ if STATIC_NOVELL st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libnovell.a -pkg_LTLIBRARIES = - -libnovell_a_SOURCES = $(NOVELLSOURCES) -libnovell_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libnovell.la +libnovell_la_SOURCES = $(NOVELLSOURCES) +libnovell_la_CFLAGS = $(AM_CFLAGS) else st = -pkg_LTLIBRARIES = libnovell.la -noinst_LIBRARIES = - +pkg_LTLIBRARIES = libnovell.la libnovell_la_SOURCES = $(NOVELLSOURCES) libnovell_la_LIBADD = $(GLIB_LIBS)
--- a/libpurple/protocols/null/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/null/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,4 +1,6 @@ -EXTRA_DIST = README Makefile.mingw +EXTRA_DIST = \ + Makefile.mingw \ + README pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -10,7 +12,7 @@ # nullprpl isn't built by default. when it is built, it's dynamically linked. st = -pkg_LTLIBRARIES = libnull.la +pkg_LTLIBRARIES = libnull.la libnull_la_SOURCES = $(NULLSOURCES) libnull_la_LIBADD = $(GLIB_LIBS)
--- a/libpurple/protocols/oscar/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/oscar/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ - COPYING \ - AUTHORS \ - Makefile.mingw + COPYING \ + AUTHORS \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -52,10 +52,9 @@ if STATIC_OSCAR st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = liboscar.a - -liboscar_a_SOURCES = $(OSCARSOURCES) libaim.c libicq.c -liboscar_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = liboscar.la +liboscar_la_SOURCES = $(OSCARSOURCES) libaim.c libicq.c +liboscar_la_CFLAGS = $(AM_CFLAGS) else @@ -64,11 +63,11 @@ liboscar_la_SOURCES = $(OSCARSOURCES) liboscar_la_LIBADD = $(GLIB_LIBS) -libaim_la_SOURCES = libaim.c -libaim_la_LIBADD = liboscar.la +libaim_la_SOURCES = libaim.c +libaim_la_LIBADD = liboscar.la -libicq_la_SOURCES = libicq.c -libicq_la_LIBADD = liboscar.la +libicq_la_SOURCES = libicq.c +libicq_la_LIBADD = liboscar.la endif
--- a/libpurple/protocols/oscar/oscar.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/oscar/oscar.c Thu Nov 13 19:50:53 2008 +0000 @@ -6091,10 +6091,11 @@ gc = purple_account_get_connection(buddy->account); od = gc->proto_data; - data = g_new(struct name_data, 1); - if (!(g = purple_buddy_get_group(buddy))) return; + + data = g_new(struct name_data, 1); + comment = aim_ssi_getcomment(od->ssi.local, g->name, buddy->name); comment_utf8 = comment ? oscar_utf8_try_convert(gc->account, comment) : NULL;
--- a/libpurple/protocols/qq/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/qq/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,5 +1,5 @@ EXTRA_DIST = \ - Makefile.mingw + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -53,17 +53,12 @@ libqq_la_LDFLAGS = -module -avoid-version -CURRENT_REVISION=$(shell \ - awk 'BEGIN {"grep node .hg_archival.txt" | getline rev; \ - rev=substr(rev,7,6); \ - print rev}') - if STATIC_QQ st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libqq.a -libqq_a_SOURCES = $(QQSOURCES) -libqq_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libqq.la +libqq_la_SOURCES = $(QQSOURCES) +libqq_la_CFLAGS = $(AM_CFLAGS) else @@ -79,5 +74,4 @@ -I$(top_builddir)/libpurple \ -DQQ_BUDDY_ICON_DIR=\"$(datadir)/pixmaps/purple/buddy_icons/qq\" \ $(DEBUG_CFLAGS) \ - $(GLIB_CFLAGS) \ - -DOPENQ_VERSION=\"$(CURRENT_REVISION)\" + $(GLIB_CFLAGS)
--- a/libpurple/protocols/qq/Makefile.mingw Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/qq/Makefile.mingw Thu Nov 13 19:50:53 2008 +0000 @@ -6,10 +6,6 @@ PIDGIN_TREE_TOP := ../../.. include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak -CURRENT_REVISION=$(shell \ - awk 'BEGIN {"grep node .hg_archival.txt" | getline rev; \ - rev=substr(rev,7,6); \ - print rev}') TARGET = libqq TYPE = PLUGIN @@ -19,7 +15,6 @@ DLL_INSTALL_DIR = $(PURPLE_INSTALL_DIR) else ifeq ($(TYPE),PLUGIN) - DEFINES += -DOPENQ_VERSION=\"$(CURRENT_REVISION)\" DLL_INSTALL_DIR = $(PURPLE_INSTALL_PLUGINS_DIR) endif endif
--- a/libpurple/protocols/qq/buddy_info.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/qq/buddy_info.c Thu Nov 13 19:50:53 2008 +0000 @@ -69,9 +69,9 @@ }; static const gchar *genders_zh[] = { - N_("-"), - N_("\xc4\xd0"), - N_("\xc5\xae"), + "-", + "\xc4\xd0", + "\xc5\xae", }; #define QQ_FACES 134
--- a/libpurple/protocols/qq/im.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/qq/im.c Thu Nov 13 19:50:53 2008 +0000 @@ -341,7 +341,7 @@ if(im_text.fragmentCount == 0) im_text.fragmentCount = 1; - // Filter tail space + /* Filter tail space */ if(im_text.fragmentIndex == im_text.fragmentCount -1) { gint real_len = text_len; @@ -349,7 +349,7 @@ real_len --; text_len = real_len; - // Null string instaed of space + /* Null string instead of space */ im_text.msg[text_len] = 0; }
--- a/libpurple/protocols/sametime/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/sametime/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,21 +1,22 @@ - -EXTRA_DIST = Makefile.mingw - +EXTRA_DIST = \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) - noinst_HEADERS = sametime.h SAMETIMESOURCES = sametime.c +AM_CFLAGS = \ + $(st) \ + -DG_LOG_DOMAIN=\"sametime\" if STATIC_SAMETIME st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libsametime.a -libsametime_a_SOURCES = $(SAMETIMESOURCES) -libsametime_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libsametime.la +libsametime_la_SOURCES = $(SAMETIMESOURCES) +libsametime_la_CFLAGS = $(AM_CFLAGS) else @@ -23,22 +24,15 @@ pkg_LTLIBRARIES = libsametime.la libsametime_la_SOURCES = $(SAMETIMESOURCES) - endif - libsametime_la_LDFLAGS = -module -avoid-version libsametime_la_LIBADD = $(GLIB_LIBS) $(MEANWHILE_LIBS) - -AM_CFLAGS = \ - $(GLIB_CFLAGS) $(MEANWHILE_CFLAGS) \ - $(DEBUG_CFLAGS) \ +AM_CPPFLAGS = \ -I$(top_srcdir)/libpurple \ - -I$(top_builddir)/libpurple - + -I$(top_builddir)/libpurple \ + $(DEBUG_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(MEANWHILE_CFLAGS) -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"sametime\" \ - $(st) -
--- a/libpurple/protocols/sametime/sametime.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/sametime/sametime.c Thu Nov 13 19:50:53 2008 +0000 @@ -4490,27 +4490,25 @@ PurpleBuddy *buddy, PurpleGroup *group) { - struct mwPurplePluginData *pd; + struct mwPurplePluginData *pd = gc->proto_data; struct mwServiceResolve *srvc; GList *query; enum mwResolveFlag flags; guint32 req; - BuddyAddData *data; - data = g_new0(BuddyAddData, 1); - data->buddy = buddy; - data->group = group; - - pd = gc->proto_data; - srvc = pd->srvc_resolve; - /* catch external buddies. They won't be in the resolve service */ if(buddy_is_external(buddy)) { buddy_add(pd, buddy); return; } + data = g_new0(BuddyAddData, 1); + data->buddy = buddy; + data->group = group; + + srvc = pd->srvc_resolve; + query = g_list_prepend(NULL, buddy->name); flags = mwResolveFlag_FIRST | mwResolveFlag_USERS;
--- a/libpurple/protocols/silc/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/silc/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,8 +1,21 @@ -EXTRA_DIST = README TODO Makefile.mingw +EXTRA_DIST = \ + Makefile.mingw \ + README \ + TODO pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) -SILCSOURCES = silc.c silcpurple.h buddy.c chat.c ft.c ops.c pk.c util.c wb.c wb.h +SILCSOURCES = \ + buddy.c \ + chat.c \ + ft.c \ + ops.c \ + pk.c \ + silc.c \ + silcpurple.h \ + util.c \ + wb.c \ + wb.h AM_CFLAGS = $(st) @@ -11,19 +24,15 @@ if STATIC_SILC st = -DPURPLE_STATIC_PRPL $(SILC_CFLAGS) -noinst_LIBRARIES = libsilcpurple.a -pkg_LTLIBRARIES = - -libsilcpurple_a_SOURCES = $(SILCSOURCES) -libsilcpurple_a_CFLAGS = $(AM_CFLAGS) -libsilcpurple_a_LIBADD = $(SILC_LIBS) +noinst_LTLIBRARIES = libsilcpurple.la +libsilcpurple_la_SOURCES = $(SILCSOURCES) +libsilcpurple_la_CFLAGS = $(AM_CFLAGS) +libsilcpurple_la_LIBADD = $(SILC_LIBS) else st = $(SILC_CFLAGS) -pkg_LTLIBRARIES = libsilcpurple.la -noinst_LIBRARIES = - +pkg_LTLIBRARIES = libsilcpurple.la libsilcpurple_la_SOURCES = $(SILCSOURCES) libsilcpurple_la_LIBADD = $(GLIB_LIBS) $(SILC_LIBS) @@ -32,5 +41,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/libpurple \ -I$(top_builddir)/libpurple \ + $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ - $(DEBUG_CFLAGS) + $(SILC_CFLAGS)
--- a/libpurple/protocols/silc10/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/silc10/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,4 +1,7 @@ -EXTRA_DIST = README TODO Makefile.mingw +EXTRA_DIST = \ + Makefile.mingw \ + README \ + TODO pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -11,19 +14,15 @@ if STATIC_SILC st = -DPURPLE_STATIC_PRPL $(SILC_CFLAGS) -noinst_LIBRARIES = libsilcpurple.a -pkg_LTLIBRARIES = - -libsilcpurple_a_SOURCES = $(SILCSOURCES) -libsilcpurple_a_CFLAGS = $(AM_CFLAGS) -libsilcpurple_a_LIBADD = $(SILC_LIBS) +noinst_LTLIBRARIES = libsilcpurple.la +libsilcpurple_la_SOURCES = $(SILCSOURCES) +libsilcpurple_la_CFLAGS = $(AM_CFLAGS) +libsilcpurple_la_LIBADD = $(SILC_LIBS) else st = $(SILC_CFLAGS) -pkg_LTLIBRARIES = libsilcpurple.la -noinst_LIBRARIES = - +pkg_LTLIBRARIES = libsilcpurple.la libsilcpurple_la_SOURCES = $(SILCSOURCES) libsilcpurple_la_LIBADD = $(GLIB_LIBS) $(SILC_LIBS) @@ -32,5 +31,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/libpurple \ -I$(top_builddir)/libpurple \ + $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ - $(DEBUG_CFLAGS) + $(SILC_CFLAGS)
--- a/libpurple/protocols/simple/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/simple/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,5 +1,5 @@ EXTRA_DIST = \ - Makefile.mingw + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -9,21 +9,21 @@ sipmsg.c \ sipmsg.h -AM_CFLAGS = $(st) +AM_CFLAGS = $(st) libsimple_la_LDFLAGS = -module -avoid-version if STATIC_MSN st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libsimple.a -libsimple_a_SOURCES = $(SIMPLESOURCES) -libsimple_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libsimple.la +libsimple_la_SOURCES = $(SIMPLESOURCES) +libsimple_la_CFLAGS = $(AM_CFLAGS) else st = -pkg_LTLIBRARIES = libsimple.la +pkg_LTLIBRARIES = libsimple.la libsimple_la_SOURCES = $(SIMPLESOURCES) libsimple_la_LIBADD = $(GLIB_LIBS)
--- a/libpurple/protocols/simple/sipmsg.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/simple/sipmsg.c Thu Nov 13 19:50:53 2008 +0000 @@ -56,14 +56,17 @@ struct sipmsg *sipmsg_parse_header(const gchar *header) { struct sipmsg *msg = g_new0(struct sipmsg,1); - gchar **lines = g_strsplit(header,"\r\n",0); - gchar **parts; - gchar *dummy; - gchar *dummy2; - gchar *tmp; + gchar **parts, **lines = g_strsplit(header,"\r\n",0); + gchar *dummy, *dummy2, *tmp; const gchar *tmp2; - int i=1; - if(!lines[0]) return NULL; + int i = 1; + + if(!lines[0]) { + g_strfreev(lines); + g_free(msg); + return NULL; + } + parts = g_strsplit(lines[0], " ", 3); if(!parts[0] || !parts[1] || !parts[2]) { g_strfreev(parts); @@ -71,6 +74,7 @@ g_free(msg); return NULL; } + if(strstr(parts[0],"SIP")) { /* numeric response */ msg->method = g_strdup(parts[2]); msg->response = strtol(parts[1],NULL,10); @@ -80,6 +84,7 @@ msg->response = 0; } g_strfreev(parts); + for(i=1; lines[i] && strlen(lines[i])>2; i++) { parts = g_strsplit(lines[i], ":", 2); if(!parts[0] || !parts[1]) { @@ -104,9 +109,11 @@ g_strfreev(parts); } g_strfreev(lines); + tmp2 = sipmsg_find_header(msg, "Content-Length"); if (tmp2 != NULL) msg->bodylen = strtol(tmp2, NULL, 10); + if(msg->response) { tmp2 = sipmsg_find_header(msg, "CSeq"); if(!tmp2) { @@ -118,6 +125,7 @@ g_strfreev(parts); } } + return msg; }
--- a/libpurple/protocols/toc/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/toc/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,6 +1,6 @@ EXTRA_DIST = \ - PROTOCOL \ - Makefile.mingw + PROTOCOL \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -13,9 +13,9 @@ if STATIC_TOC st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libtoc.a -libtoc_a_SOURCES = $(TOCSOURCES) -libtoc_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libtoc.la +libtoc_la_SOURCES = $(TOCSOURCES) +libtoc_la_CFLAGS = $(AM_CFLAGS) else
--- a/libpurple/protocols/yahoo/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/yahoo/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -1,5 +1,5 @@ EXTRA_DIST = \ - Makefile.mingw + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -36,9 +36,9 @@ if STATIC_YAHOO st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libyahoo.a -libyahoo_a_SOURCES = $(YAHOOSOURCES) -libyahoo_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libyahoo.la +libyahoo_la_SOURCES = $(YAHOOSOURCES) +libyahoo_la_CFLAGS = $(AM_CFLAGS) else @@ -53,4 +53,4 @@ -I$(top_srcdir)/libpurple \ -I$(top_builddir)/libpurple \ $(GLIB_CFLAGS) \ - $(DEBUG_CFLAGS) + $(DEBUG_CFLAGS) \ No newline at end of file
--- a/libpurple/protocols/yahoo/yahoo.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Thu Nov 13 19:50:53 2008 +0000 @@ -3619,8 +3619,26 @@ PurpleWhiteboard *wb; int ret = 1; YahooFriend *f = NULL; + gsize lenb = 0; + glong lenc = 0; msg2 = yahoo_string_encode(gc, msg, &utf8); + + if(msg2) { + lenb = strlen(msg2); + lenc = g_utf8_strlen(msg2, -1); + + if(lenb > YAHOO_MAX_MESSAGE_LENGTH_BYTES || lenc > YAHOO_MAX_MESSAGE_LENGTH_CHARS) { + purple_debug_info("yahoo", "Message too big. Length is %" G_GSIZE_FORMAT + " bytes, %ld characters. Max is %d bytes, %d chars." + " Message is '%s'.\n", lenb, lenc, YAHOO_MAX_MESSAGE_LENGTH_BYTES, + YAHOO_MAX_MESSAGE_LENGTH_CHARS, msg2); + yahoo_packet_free(pkt); + g_free(msg); + g_free(msg2); + return -E2BIG; + } + } yahoo_packet_hash(pkt, "ss", 1, purple_connection_get_display_name(gc), 5, who); if ((f = yahoo_friend_find(gc, who)) && f->protocol)
--- a/libpurple/protocols/yahoo/yahoo.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.h Thu Nov 13 19:50:53 2008 +0000 @@ -182,6 +182,21 @@ #define YAHOO_MAX_STATUS_MESSAGE_LENGTH (255) +/* + * Current Maximum Length for Instant Messages + * + * This was found by experiment. + * + * The YMSG protocol allows a message of up to 948 bytes, but the official client + * limits to 800 characters. According to experiments I conducted, it seems that + * the discrepancy is to allow some leeway for messages with mixed single- and + * multi-byte characters, as I was able to send messages of 840 and 932 bytes + * by using some multibyte characters (some random Chinese or Japanese characters, + * to be precise). - rekkanoryo + */ +#define YAHOO_MAX_MESSAGE_LENGTH_BYTES 948 +#define YAHOO_MAX_MESSAGE_LENGTH_CHARS 800 + /* sometimes i wish prpls could #include things from other prpls. then i could just * use the routines from libfaim and not have to admit to knowing how they work. */ #define yahoo_put16(buf, data) ( \
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Thu Nov 13 19:50:53 2008 +0000 @@ -262,7 +262,7 @@ content_length = YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt); - pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, yd->jp, &pkt_buf); + pkt_buf_len = yahoo_packet_build(pkt, 4, FALSE, yd->jp, &pkt_buf); yahoo_packet_free(pkt); host = purple_account_get_string(account, "xfer_host", YAHOO_XFER_HOST);
--- a/libpurple/protocols/zephyr/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/protocols/zephyr/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -62,7 +62,6 @@ zephyr_err.c \ zephyr_err.h \ zephyr_internal.h \ - \ zephyr.c ZEPHYRSOURCESEXT = zephyr.c @@ -78,10 +77,10 @@ if STATIC_ZEPHYR st = -DPURPLE_STATIC_PRPL -Dlint -noinst_LIBRARIES = libzephyr.a -libzephyr_a_SOURCES = $(ZEPHYRSOURCES) -libzephyr_a_CFLAGS = $(AM_CFLAGS) -libzephyr_a_LIBADD = $(ZEPHYRLIBS) +noinst_LTLIBRARIES = libzephyr.la +libzephyr_la_SOURCES = $(ZEPHYRSOURCES) +libzephyr_la_CFLAGS = $(AM_CFLAGS) +libzephyr_la_LIBADD = $(ZEPHYRLIBS) else @@ -90,7 +89,7 @@ if EXTERNAL_LIBZEPHYR libzephyr_la_SOURCES = $(ZEPHYRSOURCESEXT) -libzephyr_la_LIBADD = $(GLIB_LIBS) $(ZEPHYRLIBSEXT) +libzephyr_la_LIBADD = $(GLIB_LIBS) $(ZEPHYRLIBSEXT) else libzephyr_la_SOURCES = $(ZEPHYRSOURCES) libzephyr_la_LIBADD = $(GLIB_LIBS) $(ZEPHYRLIBS)
--- a/libpurple/sslconn.c Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/sslconn.c Thu Nov 13 19:50:53 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PURPLE_SSLCONN_C_ + #include "internal.h" #include "certificate.h"
--- a/libpurple/sslconn.h Wed Oct 29 21:38:33 2008 +0000 +++ b/libpurple/sslconn.h Thu Nov 13 19:50:53 2008 +0000 @@ -185,7 +185,7 @@ PurpleSslErrorFunction error_func, void *data); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_SSLCONN_C_) /** * Makes a SSL connection using an already open file descriptor. *
--- a/pidgin/Makefile.am Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/Makefile.am Thu Nov 13 19:50:53 2008 +0000 @@ -188,6 +188,7 @@ pidgin_LDFLAGS = -export-dynamic pidgin_LDADD = \ @LIBOBJS@ \ + $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(GSTREAMER_LIBS) \ $(XSS_LIBS) \
--- a/pidgin/gtkaccount.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkaccount.c Thu Nov 13 19:50:53 2008 +0000 @@ -562,7 +562,8 @@ /* Set the fields. */ if (dialog->account != NULL) { - if (purple_account_get_password(dialog->account)) + if (purple_account_get_password(dialog->account) && + purple_account_get_remember_password(dialog->account)) gtk_entry_set_text(GTK_ENTRY(dialog->password_entry), purple_account_get_password(dialog->account)); @@ -2148,9 +2149,9 @@ "<span size='larger' weight='bold'>Welcome to %s!</span>\n\n" "You have no IM accounts configured. To start connecting with %s " - "press the <b>Add</b> button below and configure your first " + "press the <b>Add...</b> button below and configure your first " "account. If you want %s to connect to multiple IM accounts, " - "press <b>Add</b> again to configure them all.\n\n" + "press <b>Add...</b> again to configure them all.\n\n" "You can come back to this window to add, edit, or remove " "accounts from <b>Accounts->Manage Accounts</b> in the Buddy " @@ -2284,7 +2285,7 @@ gtk_widget_show(sw); /* Add button */ - pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_ADD, G_CALLBACK(add_account_cb), dialog); + pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_ADD, G_CALLBACK(add_account_cb), dialog); /* Modify button */ button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_MODIFY, G_CALLBACK(modify_account_cb), dialog);
--- a/pidgin/gtkblist.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkblist.c Thu Nov 13 19:50:53 2008 +0000 @@ -6951,7 +6951,7 @@ pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Group:"), data->sg, data->group_combo, TRUE, NULL); data->autojoin = gtk_check_button_new_with_mnemonic(_("Auto_join when account becomes online.")); - data->persistent = gtk_check_button_new_with_mnemonic(_("_Hide chat when the window is closed.")); + data->persistent = gtk_check_button_new_with_mnemonic(_("_Remain in chat after window is closed.")); gtk_box_pack_start(GTK_BOX(vbox), data->autojoin, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), data->persistent, FALSE, FALSE, 0); @@ -7177,7 +7177,10 @@ purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/y", 0); purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/width", 250); /* Golden ratio, baby */ purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/height", 405); /* Golden ratio, baby */ +#if !GTK_CHECK_VERSION(2,14,0) + /* This pref is used in pidgintooltip.c. */ purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay", 500); +#endif /* Register our signals */ purple_signal_register(gtk_blist_handle, "gtkblist-hiding",
--- a/pidgin/gtkconn.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkconn.c Thu Nov 13 19:50:53 2008 +0000 @@ -208,7 +208,10 @@ while (l) { PurpleAccount *a = (PurpleAccount*)l->data; if (!purple_account_is_disconnected(a)) { + char *password = g_strdup(purple_account_get_password(a)); purple_account_disconnect(a); + purple_account_set_password(a, password); + g_free(password); } l = l->next; }
--- a/pidgin/gtkconv.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkconv.c Thu Nov 13 19:50:53 2008 +0000 @@ -24,6 +24,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA * */ +#define _PIDGIN_GTKCONV_C_ + #include "internal.h" #include "pidgin.h" @@ -161,7 +163,7 @@ gboolean pidgin_conv_has_focus(PurpleConversation *conv); static GdkColor* generate_nick_colors(guint *numcolors, GdkColor background); static gboolean color_is_visible(GdkColor foreground, GdkColor background, int color_contrast, int brightness_contrast); -static GtkTextTag *get_buddy_tag(PurpleConversation *conv, const char *who, gboolean create); +static GtkTextTag *get_buddy_tag(PurpleConversation *conv, const char *who, PurpleMessageFlags flag, gboolean create); static void pidgin_conv_update_fields(PurpleConversation *conv, PidginConvFields fields); static void focus_out_from_menubar(GtkWidget *wid, PidginWindow *win); static void pidgin_conv_tab_pack(PidginWindow *win, PidginConversation *gtkconv); @@ -172,7 +174,8 @@ int width, int height); static gboolean pidgin_conv_xy_to_right_infopane(PidginWindow *win, int x, int y); -static const GdkColor *get_nick_color(PidginConversation *gtkconv, const char *name) { +static const GdkColor *get_nick_color(PidginConversation *gtkconv, const char *name) +{ static GdkColor col; GtkStyle *style = gtk_widget_get_style(gtkconv->imhtml); float scale; @@ -968,7 +971,9 @@ } name = purple_conversation_get_name(conv); - fprintf(fp, "<html>\n<head><title>%s</title></head>\n<body>", name); + fprintf(fp, "<html>\n<head>\n"); + fprintf(fp, "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n"); + fprintf(fp, "<title>%s</title>\n</head>\n<body>\n", name); fprintf(fp, _("<h1>Conversation with %s</h1>\n"), name); lines = gtk_imhtml_get_markup_lines( @@ -1910,6 +1915,40 @@ } static gboolean +gtkconv_cycle_focus(PidginConversation *gtkconv, GtkDirectionType dir) +{ + PurpleConversation *conv = gtkconv->active_conv; + gboolean chat = purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT; + GtkWidget *next = NULL; + struct { + GtkWidget *from; + GtkWidget *to; + } transitions[] = { + {gtkconv->entry, gtkconv->imhtml}, + {gtkconv->imhtml, chat ? gtkconv->u.chat->list : gtkconv->entry}, + {chat ? gtkconv->u.chat->list : NULL, gtkconv->entry}, + {NULL, NULL} + }, *ptr; + + for (ptr = transitions; !next && ptr->from; ptr++) { + GtkWidget *from, *to; + if (dir == GTK_DIR_TAB_FORWARD) { + from = ptr->from; + to = ptr->to; + } else { + from = ptr->to; + to = ptr->from; + } + if (gtk_widget_is_focus(from)) + next = to; + } + + if (next) + gtk_widget_grab_focus(next); + return !!next; +} + +static gboolean conv_keypress_common(PidginConversation *gtkconv, GdkEventKey *event) { PidginWindow *win; @@ -1970,7 +2009,10 @@ #endif return TRUE; break; - + case GDK_F6: + if (gtkconv_cycle_focus(gtkconv, event->state & GDK_SHIFT_MASK ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD)) + return TRUE; + break; } /* End of switch */ } @@ -1997,6 +2039,10 @@ return TRUE; } break; + case GDK_F6: + if (gtkconv_cycle_focus(gtkconv, event->state & GDK_SHIFT_MASK ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD)) + return TRUE; + break; } } return FALSE; @@ -4423,7 +4469,7 @@ blist_node_aliased_cb((PurpleBlistNode *)buddy, NULL, conv); - texttag = get_buddy_tag(conv, purple_buddy_get_name(buddy), FALSE); /* XXX: do we want the normalized name? */ + texttag = get_buddy_tag(conv, purple_buddy_get_name(buddy), 0, FALSE); /* XXX: do we want the normalized name? */ if (texttag) { g_object_set(texttag, "weight", is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, NULL); } @@ -5343,16 +5389,35 @@ purple_conversation_write(conv, who, message, flags, mtime); } +static const char * +get_text_tag_color(GtkTextTag *tag) +{ + GdkColor *color = NULL; + gboolean set = FALSE; + static char colcode[] = "#XXXXXX"; + if (tag) + g_object_get(G_OBJECT(tag), "foreground-set", &set, "foreground-gdk", &color, NULL); + if (set && color) + g_snprintf(colcode, sizeof(colcode), "#%02x%02x%02x", + color->red >> 8, color->green >> 8, color->blue >> 8); + else + colcode[0] = '\0'; + if (color) + gdk_color_free(color); + return colcode; +} + /* The callback for an event on a link tag. */ static gboolean buddytag_event(GtkTextTag *tag, GObject *imhtml, - GdkEvent *event, GtkTextIter *arg2, gpointer data) { + GdkEvent *event, GtkTextIter *arg2, gpointer data) +{ if (event->type == GDK_BUTTON_PRESS || event->type == GDK_2BUTTON_PRESS) { GdkEventButton *btn_event = (GdkEventButton*) event; PurpleConversation *conv = data; char *buddyname; - /* strlen("BUDDY ") == 6 */ + /* strlen("BUDDY " or "HILIT ") == 6 */ g_return_val_if_fail((tag->name != NULL) && (strlen(tag->name) > 6), FALSE); @@ -5392,24 +5457,33 @@ return FALSE; } -static GtkTextTag *get_buddy_tag(PurpleConversation *conv, const char *who, gboolean create) +static GtkTextTag *get_buddy_tag(PurpleConversation *conv, const char *who, PurpleMessageFlags flag, + gboolean create) { PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); GtkTextTag *buddytag; gchar *str; - - str = g_strdup_printf("BUDDY %s", who); + gboolean highlight = (flag & PURPLE_MESSAGE_NICK); + GtkTextBuffer *buffer = GTK_IMHTML(gtkconv->imhtml)->text_buffer; + + str = g_strdup_printf(highlight ? "HILIT %s" : "BUDDY %s", who); buddytag = gtk_text_tag_table_lookup( - gtk_text_buffer_get_tag_table( - GTK_IMHTML(gtkconv->imhtml)->text_buffer), str); + gtk_text_buffer_get_tag_table(buffer), str); if (buddytag == NULL && create) { - buddytag = gtk_text_buffer_create_tag( - GTK_IMHTML(gtkconv->imhtml)->text_buffer, str, - "foreground-gdk", get_nick_color(gtkconv, who), - "weight", purple_find_buddy(purple_conversation_get_account(conv), who) ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, - NULL); + if (highlight) + buddytag = gtk_text_buffer_create_tag(buffer, str, + "foreground", get_text_tag_color(gtk_text_tag_table_lookup( + gtk_text_buffer_get_tag_table(buffer), "highlight-name")), + "weight", PANGO_WEIGHT_BOLD, + NULL); + else + buddytag = gtk_text_buffer_create_tag( + buffer, str, + "foreground-gdk", get_nick_color(gtkconv, who), + "weight", purple_find_buddy(purple_conversation_get_account(conv), who) ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, + NULL); g_signal_connect(G_OBJECT(buddytag), "event", G_CALLBACK(buddytag_event), conv); @@ -5766,7 +5840,9 @@ } if (flags & PURPLE_MESSAGE_NICK) { - tagname = "highlight-name"; + if (type == PURPLE_CONV_TYPE_IM) { + tagname = "highlight-name"; + } } else if (flags & PURPLE_MESSAGE_RECV) { /* The tagname for chats is handled by get_buddy_tag */ if (type == PURPLE_CONV_TYPE_IM) { @@ -5785,7 +5861,7 @@ if (tagname) tag = gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), tagname); else - tag = get_buddy_tag(conv, name, TRUE); + tag = get_buddy_tag(conv, name, flags, TRUE); if (GTK_IMHTML(gtkconv->imhtml)->show_comments) { /* The color for the timestamp has to be set in the font-tags, unfortunately. @@ -5793,19 +5869,10 @@ * bold. I thought applying the "comment" tag again, which has "weight" set * to PANGO_WEIGHT_NORMAL, would remove the boldness. But it doesn't. So * this will have to do. I don't terribly like it. -- sadrul */ - GdkColor *color = NULL; - gboolean set = FALSE; - char colcode[] = "COLOR=\"#XXXXXX\""; - g_object_get(G_OBJECT(tag), "foreground-set", &set, "foreground-gdk", &color, NULL); - if (set && color) - g_snprintf(colcode, sizeof(colcode), "COLOR=\"#%02x%02x%02x\"", - color->red >> 8, color->green >> 8, color->blue >> 8); - else - colcode[0] = '\0'; - g_snprintf(buf2, BUF_LONG, "<FONT %s SIZE=\"2\"><!--%s --></FONT>", colcode, mdate); + const char *color = get_text_tag_color(tag); + g_snprintf(buf2, BUF_LONG, "<FONT %s%s%s SIZE=\"2\"><!--%s --></FONT>", + color ? "COLOR=\"" : "", color ? color : "", color ? "\"" : "", mdate); gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, gtk_font_options_all | GTK_IMHTML_NO_SCROLL); - if (color) - gdk_color_free(color); } gtk_text_buffer_get_end_iter(buffer, &end);
--- a/pidgin/gtkconv.h Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkconv.h Thu Nov 13 19:50:53 2008 +0000 @@ -143,7 +143,7 @@ GtkWidget *tab_label; GtkWidget *menu_icon; GtkWidget *menu_label; -#ifndef PIDGIN_DISABLE_DEPRECATED +#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKCONV_C_) /** @deprecated */ GtkSizeGroup *sg; #else
--- a/pidgin/gtkdialogs.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkdialogs.c Thu Nov 13 19:50:53 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PIDGIN_GTKDIALOGS_C_ + #include "internal.h" #include "pidgin.h" @@ -967,7 +969,7 @@ static void pidgin_dialogs_alias_contact_cb(PurpleContact *contact, const char *new_alias) { - purple_contact_set_alias(contact, new_alias); + purple_blist_alias_contact(contact, new_alias); } void
--- a/pidgin/gtkdialogs.h Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkdialogs.h Thu Nov 13 19:50:53 2008 +0000 @@ -38,11 +38,13 @@ void pidgin_dialogs_info(void); void pidgin_dialogs_log(void); +#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKDIALOGS_C_) /** * @deprecated This function is no longer used and will be removed in * Pidgin 3.0.0 unless there is sufficient demand to keep it. */ void pidgin_dialogs_alias_contact(PurpleContact *); +#endif void pidgin_dialogs_alias_buddy(PurpleBuddy *); void pidgin_dialogs_alias_chat(PurpleChat *); @@ -55,9 +57,12 @@ /* Everything after this should probably be moved elsewhere */ #ifndef PIDGIN_DISABLE_DEPRECATED +/* This PIDGIN_DISABLE_DEPRECATED doesn't need to be deactivated by + * _PIDGIN_GTKDIALOGS_C_, because it shouldn't be using this macro. */ #define PIDGIN_DIALOG(x) x = gtk_window_new(GTK_WINDOW_TOPLEVEL); \ gtk_window_set_type_hint(GTK_WINDOW(x), GDK_WINDOW_TYPE_HINT_DIALOG) #endif + #define PIDGIN_WINDOW_ICONIFIED(x) (gdk_window_get_state(GTK_WIDGET(x)->window) & GDK_WINDOW_STATE_ICONIFIED) #endif /* _PIDGINDIALOGS_H_ */
--- a/pidgin/gtkimhtml.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkimhtml.c Thu Nov 13 19:50:53 2008 +0000 @@ -24,6 +24,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA * */ +#define _PIDGIN_GTKIMHTML_C_ #ifdef HAVE_CONFIG_H #include <config.h> @@ -2054,12 +2055,23 @@ } static void +gtk_imhtml_disconnect_smiley(GtkIMHtml *imhtml, GtkIMHtmlSmiley *smiley) +{ + smiley->imhtml = NULL; + g_signal_handlers_disconnect_matched(imhtml, G_SIGNAL_MATCH_DATA, 0, 0, + NULL, NULL, smiley); +} + +static void gtk_imhtml_disassociate_smiley(GtkIMHtmlSmiley *smiley) { if (smiley->imhtml) { gtk_smiley_tree_remove(smiley->imhtml->default_smilies, smiley); g_hash_table_foreach(smiley->imhtml->smiley_data, gtk_imhtml_disassociate_smiley_foreach, smiley); + g_signal_handlers_disconnect_matched(smiley->imhtml, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, smiley); + smiley->imhtml = NULL; } } @@ -2079,9 +2091,19 @@ g_hash_table_insert(imhtml->smiley_data, g_strdup(sml), tree); } + /* need to disconnect old imhtml, if there is one */ + if (smiley->imhtml) { + g_signal_handlers_disconnect_matched(smiley->imhtml, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, smiley); + } + smiley->imhtml = imhtml; gtk_smiley_tree_insert (tree, smiley); + + /* connect destroy signal for the imhtml */ + g_signal_connect(imhtml, "destroy", G_CALLBACK(gtk_imhtml_disconnect_smiley), + smiley); } static gboolean
--- a/pidgin/gtkimhtml.h Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkimhtml.h Thu Nov 13 19:50:53 2008 +0000 @@ -130,7 +130,7 @@ GtkTextTag *link; } edit; -#ifndef PIDGIN_DISABLE_DEPRECATED +#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKIMHTML_C_) /** @deprecated */ char *clipboard_text_string; /** @deprecated */
--- a/pidgin/gtkmain.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkmain.c Thu Nov 13 19:50:53 2008 +0000 @@ -536,12 +536,8 @@ "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" - "%swiki/GetABacktrace\n\n" - "If you need further assistance, please IM either SeanEgn or \n" - "LSchiere (via AIM). Contact information for Sean and Luke \n" - "on other protocols is at\n" - "%swiki/DeveloperPages\n"), - PIDGIN_NAME, DISPLAY_VERSION, PURPLE_DEVEL_WEBSITE, PURPLE_DEVEL_WEBSITE, PURPLE_DEVEL_WEBSITE + "%swiki/GetABacktrace\n"), + PIDGIN_NAME, DISPLAY_VERSION, PURPLE_DEVEL_WEBSITE, PURPLE_DEVEL_WEBSITE ); /* we have to convert the message (UTF-8 to console
--- a/pidgin/gtkpounce.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkpounce.c Thu Nov 13 19:50:53 2008 +0000 @@ -1374,7 +1374,7 @@ gtk_box_pack_start(GTK_BOX(vbox), list, TRUE, TRUE, 0); /* Add button */ - button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_ADD, G_CALLBACK(pounces_manager_add_cb), dialog); + button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_ADD, G_CALLBACK(pounces_manager_add_cb), dialog); gtk_widget_set_sensitive(button, (purple_accounts_get_all() != NULL)); purple_signal_connect(purple_connections_get_handle(), "signed-on",
--- a/pidgin/gtkprefs.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkprefs.c Thu Nov 13 19:50:53 2008 +0000 @@ -1836,14 +1836,14 @@ gpointer data) { GtkToggleButton *button = data; - gboolean muted = val; + gboolean muted = GPOINTER_TO_INT(val); g_return_if_fail(!strcmp (pref_name, PIDGIN_PREFS_ROOT "/sound/mute")); /* Block the handler that re-sets the preference. */ - g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, pref_name); + g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); gtk_toggle_button_set_active (button, muted); - g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, pref_name); + g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); }
--- a/pidgin/gtksavedstatuses.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtksavedstatuses.c Thu Nov 13 19:50:53 2008 +0000 @@ -655,7 +655,7 @@ G_CALLBACK(status_window_use_cb), dialog); /* Add button */ - pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_ADD, + pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_ADD, G_CALLBACK(status_window_add_cb), dialog); /* Modify button */
--- a/pidgin/gtksound.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtksound.c Thu Nov 13 19:50:53 2008 +0000 @@ -447,7 +447,7 @@ if (!sound_cmd || *sound_cmd == '\0') { purple_debug_error("gtksound", "'Command' sound method has been chosen, " - "but no command has been set."); + "but no command has been set.\n"); return; }
--- a/pidgin/gtkthemes.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkthemes.c Thu Nov 13 19:50:53 2008 +0000 @@ -169,6 +169,12 @@ for (wer = theme->list; wer != NULL; wer = theme->list) { while (wer->smileys) { GtkIMHtmlSmiley *uio = wer->smileys->data; + + if (uio->imhtml) { + g_signal_handlers_disconnect_matched(uio->imhtml, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, uio); + } + if (uio->icon) g_object_unref(uio->icon); if (g_hash_table_lookup(already_freed, uio->file) == NULL) {
--- a/pidgin/gtkutils.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkutils.c Thu Nov 13 19:50:53 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PIDGIN_GTKUTILS_C_ + #include "internal.h" #include "pidgin.h" @@ -2878,7 +2880,6 @@ } #endif /* ! Gtk 2.6.0 */ -#ifndef PURPLE_DISABLE_DEPRECATED void pidgin_set_custom_buddy_icon(PurpleAccount *account, const char *who, const char *filename) { PurpleBuddy *buddy; @@ -2893,7 +2894,6 @@ contact = purple_buddy_get_contact(buddy); purple_buddy_icons_node_set_custom_icon_from_file((PurpleBlistNode*)contact, filename); } -#endif char *pidgin_make_pretty_arrows(const char *str) {
--- a/pidgin/gtkutils.h Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/gtkutils.h Thu Nov 13 19:50:53 2008 +0000 @@ -638,7 +638,7 @@ GError **error); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKUTILS_C_) /** * Set or unset a custom buddyicon for a user. *
--- a/pidgin/pidginstock-artwork.c Wed Oct 29 21:38:33 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,508 +0,0 @@ -/** - * @file pidginstock.c GTK+ Stock resources - * @ingroup pidgin - */ - -/* pidgin - * - * Pidgin 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA - * - */ -#include "internal.h" -#include "pidgin.h" - -#include "pidginstock.h" - -static struct StockIcon -{ - const char *name; - const char *dir; - const char *filename; - -} const stock_icons[] = -{ - { PIDGIN_STOCK_ACTION, NULL, GTK_STOCK_EXECUTE }, -#if GTK_CHECK_VERSION(2,6,0) - { PIDGIN_STOCK_ALIAS, NULL, GTK_STOCK_EDIT }, -#else - { PIDGIN_STOCK_ALIAS, "buttons", "edit.png" }, -#endif - { PIDGIN_STOCK_CHAT, NULL, GTK_STOCK_JUMP_TO }, - { PIDGIN_STOCK_CLEAR, NULL, GTK_STOCK_CLEAR }, - { PIDGIN_STOCK_CLOSE_TABS, NULL, GTK_STOCK_CLOSE }, - { PIDGIN_STOCK_DEBUG, NULL, GTK_STOCK_PROPERTIES }, - { PIDGIN_STOCK_DOWNLOAD, NULL, GTK_STOCK_GO_DOWN }, -#if GTK_CHECK_VERSION(2,6,0) - { PIDGIN_STOCK_DISCONNECT, NULL, GTK_STOCK_DISCONNECT }, -#else - { PIDGIN_STOCK_DISCONNECT, "icons", "stock_disconnect_16.png" }, -#endif - { PIDGIN_STOCK_FGCOLOR, "buttons", "change-fgcolor-small.png" }, -#if GTK_CHECK_VERSION(2,6,0) - { PIDGIN_STOCK_EDIT, NULL, GTK_STOCK_EDIT }, -#else - { PIDGIN_STOCK_EDIT, "buttons", "edit.png" }, -#endif - { PIDGIN_STOCK_FILE_CANCELED, NULL, GTK_STOCK_CANCEL }, - { PIDGIN_STOCK_FILE_DONE, NULL, GTK_STOCK_APPLY }, - { PIDGIN_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR }, - { PIDGIN_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO }, - { PIDGIN_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES }, -#if GTK_CHECK_VERSION(2,6,0) - { PIDGIN_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE }, -#else - { PIDGIN_STOCK_PAUSE, "buttons", "pause.png" }, -#endif - { PIDGIN_STOCK_POUNCE, NULL, GTK_STOCK_REDO }, - { PIDGIN_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO }, - { PIDGIN_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE }, - { PIDGIN_STOCK_SIGN_OFF, NULL, GTK_STOCK_CLOSE }, - { PIDGIN_STOCK_TYPED, "pidgin", "typed.png" }, - { PIDGIN_STOCK_UPLOAD, NULL, GTK_STOCK_GO_UP }, -#if GTK_CHECK_VERSION(2,8,0) - { PIDGIN_STOCK_INFO, NULL, GTK_STOCK_INFO }, -#else - { PIDGIN_STOCK_INFO, "buttons", "info.png" }, -#endif -}; - -static const GtkStockItem stock_items[] = -{ - { PIDGIN_STOCK_ALIAS, N_("_Alias"), 0, 0, NULL }, - { PIDGIN_STOCK_CHAT, N_("_Join"), 0, 0, NULL }, - { PIDGIN_STOCK_CLOSE_TABS, N_("Close _tabs"), 0, 0, NULL }, - { PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, N_("I_M"), 0, 0, NULL }, - { PIDGIN_STOCK_TOOLBAR_USER_INFO, N_("_Get Info"), 0, 0, NULL }, - { PIDGIN_STOCK_INVITE, N_("_Invite"), 0, 0, NULL }, - { PIDGIN_STOCK_MODIFY, N_("_Modify"), 0, 0, NULL }, - { PIDGIN_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL }, - { PIDGIN_STOCK_PAUSE, N_("_Pause"), 0, 0, NULL }, - { PIDGIN_STOCK_EDIT, N_("_Edit"), 0, 0, NULL } -}; - -static struct SizedStockIcon { - const char *name; - const char *dir; - const char *filename; - gboolean microscopic; - gboolean extra_small; - gboolean small; - gboolean medium; - gboolean large; - gboolean huge; - gboolean rtl; - const char *translucent_name; -} const sized_stock_icons [] = { - - - /* Status icons */ - - { PIDGIN_STOCK_STATUS_AVAILABLE, "status", "pidgin-available.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_AVAILABLE_I }, - { PIDGIN_STOCK_STATUS_AWAY, "status", "pidgin-away.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_AWAY_I }, - { PIDGIN_STOCK_STATUS_BUSY, "status", "pidgin-busy.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_BUSY_I }, - { PIDGIN_STOCK_STATUS_CHAT, "status", "pidgin-chat.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_STATUS_INVISIBLE, "status", "pidgin-invisible.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_STATUS_XA, "status", "pidgin-extended-away.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_XA_I }, - { PIDGIN_STOCK_STATUS_LOGIN, "status", "pidgin-log-in.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_STATUS_LOGOUT, "status", "pidgin-log-out.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_STATUS_OFFLINE, "status", "pidgin-offline.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_OFFLINE_I }, - { PIDGIN_STOCK_STATUS_PERSON, "status", "pidgin-person.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_STATUS_MESSAGE, "actions", "pidgin-message-new.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - - - /* Chatroom icons */ - - { PIDGIN_STOCK_STATUS_IGNORED, "status", "pidgin-blocked.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_STATUS_FOUNDER, "status", "pidgin-founder.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_STATUS_OPERATOR, "status", "pidgin-operator.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_STATUS_HALFOP, "status", "pidgin-half-operator.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_STATUS_VOICE, "status", "pidgin-voice.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - - - /* Dialog icons */ - - { PIDGIN_STOCK_DIALOG_AUTH, "status", "pidgin-auth.png", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL }, - { PIDGIN_STOCK_DIALOG_COOL, "status", "pidgin-cool.png", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL }, - { PIDGIN_STOCK_DIALOG_ERROR, "status", "pidgin-error.png", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL }, - { PIDGIN_STOCK_DIALOG_INFO, "status", "pidgin-info.png", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL }, - { PIDGIN_STOCK_DIALOG_MAIL, "status", "pidgin-mail.png", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL }, - { PIDGIN_STOCK_DIALOG_QUESTION, "status", "pidgin-question.png", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL }, - { PIDGIN_STOCK_DIALOG_WARNING, "status", "pidgin-warning.png", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL }, - - - /* Animations */ - - { PIDGIN_STOCK_ANIMATION_CONNECT0, "animations", "process-working0.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT1, "animations", "process-working1.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT2, "animations", "process-working2.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT3, "animations", "process-working3.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT4, "animations", "process-working4.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT5, "animations", "process-working5.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT6, "animations", "process-working6.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT7, "animations", "process-working7.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT8, "animations", "process-working8.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT9, "animations", "process-working9.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT10, "animations", "process-working10.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT11, "animations", "process-working11.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT12, "animations", "process-working12.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT13, "animations", "process-working13.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT14, "animations", "process-working14.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT15, "animations", "process-working15.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT16, "animations", "process-working16.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT17, "animations", "process-working17.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT18, "animations", "process-working18.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT19, "animations", "process-working19.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT20, "animations", "process-working20.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT21, "animations", "process-working21.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT22, "animations", "process-working22.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT23, "animations", "process-working23.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT24, "animations", "process-working24.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT25, "animations", "process-working25.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT26, "animations", "process-working26.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT27, "animations", "process-working27.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT28, "animations", "process-working28.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT29, "animations", "process-working29.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_CONNECT30, "animations", "process-working30.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_TYPING0, "animations", "typing0.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_TYPING1, "animations", "typing1.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_TYPING2, "animations", "typing2.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_TYPING3, "animations", "typing3.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_TYPING4, "animations", "typing4.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_ANIMATION_TYPING5, "animations", "typing5.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - - - /* Conversation toolbar icons */ - - { PIDGIN_STOCK_TOOLBAR_BGCOLOR, "actions", "pidgin-change-bgcolor.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_FGCOLOR, "actions", "pidgin-change-fgcolor.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_TEXT_SMALLER, "actions", "pidgin-font-size-down.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_TEXT_LARGER, "actions", "pidgin-font-size-up.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_SMILEY, "actions", "pidgin-emote-select.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_FONT_FACE, "actions", "pidgin-font-face.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_INSERT, "actions", "pidgin-insert.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE, "actions", "pidgin-insert-image.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_INSERT_LINK, "actions", "pidgin-insert-link.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - - - /* Menu icons */ - - { PIDGIN_STOCK_TOOLBAR_BLOCK, "status", "pidgin-blocked.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, "actions", "pidgin-message-new.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_PENDING, "status", "pidgin-tray-new-im.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_PLUGINS, "actions", "pidgin-view-plugins.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_UNBLOCK, "actions", "pidgin-unblock.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR, "actions", "pidgin-select-avatar.png", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_SEND_FILE, "actions", "pidgin-send-file.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_TRANSFER, "actions", "pidgin-view-transfer.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - - - /* Tray icons */ - - { PIDGIN_STOCK_TRAY_AVAILABLE, "status", "pidgin-tray-online.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TRAY_INVISIBLE, "status", "pidgin-tray-invisible.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TRAY_AWAY, "status", "pidgin-tray-away.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TRAY_BUSY, "status", "pidgin-tray-busy.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TRAY_XA, "status", "pidgin-tray-extended-away.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TRAY_OFFLINE, "status", "pidgin-tray-offline.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TRAY_CONNECT, "status", "pidgin-tray-connecting.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TRAY_PENDING, "status", "pidgin-tray-new-im.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TRAY_EMAIL, "status", "pidgin-tray-message.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL } - -}; - -static gchar * -find_file(const char *dir, const char *base) -{ - char *filename; - - if (base == NULL) - return NULL; - - if (!strcmp(dir, "pidgin")) - filename = g_build_filename(DATADIR, "pixmaps", "pidgin", base, NULL); - else - { - filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, - base, NULL); - } - - return filename; -} - -static void -add_sized_icon(GtkIconSet *iconset, GtkIconSize sizeid, const char *dir, - gboolean rtl, const char *size, const char *file) -{ - char *filename; - GtkIconSource *source; - - filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, size, file, NULL); - source = gtk_icon_source_new(); - gtk_icon_source_set_filename(source, filename); - gtk_icon_source_set_direction(source, GTK_TEXT_DIR_LTR); - gtk_icon_source_set_direction_wildcarded(source, !rtl); - gtk_icon_source_set_size(source, sizeid); - gtk_icon_source_set_size_wildcarded(source, FALSE); - gtk_icon_source_set_state_wildcarded(source, TRUE); - gtk_icon_set_add_source(iconset, source); - gtk_icon_source_free(source); - - if (sizeid == gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)) { - source = gtk_icon_source_new(); - gtk_icon_source_set_filename(source, filename); - gtk_icon_source_set_direction_wildcarded(source, TRUE); - gtk_icon_source_set_size(source, GTK_ICON_SIZE_MENU); - gtk_icon_source_set_size_wildcarded(source, FALSE); - gtk_icon_source_set_state_wildcarded(source, TRUE); - gtk_icon_set_add_source(iconset, source); - gtk_icon_source_free(source); - } - g_free(filename); - - if (rtl) { - filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, size, "rtl", file, NULL); - source = gtk_icon_source_new(); - gtk_icon_source_set_filename(source, filename); - gtk_icon_source_set_direction(source, GTK_TEXT_DIR_RTL); - gtk_icon_source_set_size(source, sizeid); - gtk_icon_source_set_size_wildcarded(source, FALSE); - gtk_icon_source_set_state_wildcarded(source, TRUE); - gtk_icon_set_add_source(iconset, source); - g_free(filename); - gtk_icon_source_free(source); - } - - -} - -/* Altered from do_colorshift in gnome-panel */ -static void -do_alphashift (GdkPixbuf *dest, GdkPixbuf *src) -{ - gint i, j; - gint width, height, has_alpha, srcrowstride, destrowstride; - guchar *target_pixels; - guchar *original_pixels; - guchar *pixsrc; - guchar *pixdest; - guchar a; - - has_alpha = gdk_pixbuf_get_has_alpha (src); - if (!has_alpha) - return; - - width = gdk_pixbuf_get_width (src); - height = gdk_pixbuf_get_height (src); - srcrowstride = gdk_pixbuf_get_rowstride (src); - destrowstride = gdk_pixbuf_get_rowstride (dest); - target_pixels = gdk_pixbuf_get_pixels (dest); - original_pixels = gdk_pixbuf_get_pixels (src); - - for (i = 0; i < height; i++) { - pixdest = target_pixels + i*destrowstride; - pixsrc = original_pixels + i*srcrowstride; - for (j = 0; j < width; j++) { - *(pixdest++) = *(pixsrc++); - *(pixdest++) = *(pixsrc++); - *(pixdest++) = *(pixsrc++); - a = *(pixsrc++); - *(pixdest++) = a / 2; - } - } -} - -/* TODO: This is almost certainly not the best way to do this, but it's late, I'm tired, - * we're a few hours from getting this thing out, and copy/paste is EASY. - */ -static void -add_translucent_sized_icon(GtkIconSet *iconset, GtkIconSize sizeid, const char *dir, - gboolean rtl, const char *size, const char *file) -{ - char *filename; - GtkIconSource *source; - GdkPixbuf *pixbuf; - - filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, size, file, NULL); - pixbuf = gdk_pixbuf_new_from_file(filename, NULL); - do_alphashift(pixbuf, pixbuf); - - source = gtk_icon_source_new(); - gtk_icon_source_set_pixbuf(source, pixbuf); - gtk_icon_source_set_direction(source, GTK_TEXT_DIR_LTR); - gtk_icon_source_set_direction_wildcarded(source, !rtl); - gtk_icon_source_set_size(source, sizeid); - gtk_icon_source_set_size_wildcarded(source, FALSE); - gtk_icon_source_set_state_wildcarded(source, TRUE); - gtk_icon_set_add_source(iconset, source); - gtk_icon_source_free(source); - - if (sizeid == gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)) { - source = gtk_icon_source_new(); - gtk_icon_source_set_pixbuf(source, pixbuf); - gtk_icon_source_set_direction_wildcarded(source, TRUE); - gtk_icon_source_set_size(source, GTK_ICON_SIZE_MENU); - gtk_icon_source_set_size_wildcarded(source, FALSE); - gtk_icon_source_set_state_wildcarded(source, TRUE); - gtk_icon_set_add_source(iconset, source); - gtk_icon_source_free(source); - } - g_free(filename); - g_object_unref(pixbuf); - - if (rtl) { - filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, size, "rtl", file, NULL); - pixbuf = gdk_pixbuf_new_from_file(filename, NULL); - do_alphashift(pixbuf, pixbuf); - source = gtk_icon_source_new(); - gtk_icon_source_set_pixbuf(source, pixbuf); - gtk_icon_source_set_direction(source, GTK_TEXT_DIR_RTL); - gtk_icon_source_set_size(source, sizeid); - gtk_icon_source_set_size_wildcarded(source, FALSE); - gtk_icon_source_set_state_wildcarded(source, TRUE); - gtk_icon_set_add_source(iconset, source); - g_free(filename); - g_object_unref(pixbuf); - gtk_icon_source_free(source); - } - - -} - - -void -pidgin_stock_init(void) -{ - static gboolean stock_initted = FALSE; - GtkIconFactory *icon_factory; - size_t i; - GtkWidget *win; - GtkIconSize microscopic, extra_small, small, medium, large, huge; - - if (stock_initted) - return; - - stock_initted = TRUE; - - /* Setup the icon factory. */ - icon_factory = gtk_icon_factory_new(); - - gtk_icon_factory_add_default(icon_factory); - - /* Er, yeah, a hack, but it works. :) */ - win = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_widget_realize(win); - - for (i = 0; i < G_N_ELEMENTS(stock_icons); i++) - { - GtkIconSource *source; - GtkIconSet *iconset; - gchar *filename; - - if (stock_icons[i].dir == NULL) - { - /* GTK+ Stock icon */ - iconset = gtk_style_lookup_icon_set(gtk_widget_get_style(win), - stock_icons[i].filename); - } - else - { - filename = find_file(stock_icons[i].dir, stock_icons[i].filename); - - if (filename == NULL) - continue; - - source = gtk_icon_source_new(); - gtk_icon_source_set_filename(source, filename); - gtk_icon_source_set_direction_wildcarded(source, TRUE); - gtk_icon_source_set_size_wildcarded(source, TRUE); - gtk_icon_source_set_state_wildcarded(source, TRUE); - - - iconset = gtk_icon_set_new(); - gtk_icon_set_add_source(iconset, source); - - gtk_icon_source_free(source); - g_free(filename); - } - - gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset); - - gtk_icon_set_unref(iconset); - } - - /* register custom icon sizes */ - - microscopic = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC, 11, 11); - extra_small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL, 16, 16); - small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_SMALL, 22, 22); - medium = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_MEDIUM, 32, 32); - large = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_LARGE, 48, 48); - huge = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_HUGE, 64, 64); - - for (i = 0; i < G_N_ELEMENTS(sized_stock_icons); i++) - { - GtkIconSet *iconset; - - iconset = gtk_icon_set_new(); - -#define ADD_SIZED_ICON(name, size) do { \ - if (sized_stock_icons[i].name) \ - add_sized_icon(iconset, name, \ - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, \ - size, sized_stock_icons[i].filename); \ - } while (0) - ADD_SIZED_ICON(microscopic, "11"); - ADD_SIZED_ICON(extra_small, "16"); - ADD_SIZED_ICON(small, "22"); - ADD_SIZED_ICON(medium, "32"); - ADD_SIZED_ICON(large, "48"); - ADD_SIZED_ICON(huge, "64"); -#undef ADD_SIZED_ICON - - gtk_icon_factory_add(icon_factory, sized_stock_icons[i].name, iconset); - gtk_icon_set_unref(iconset); - - if (sized_stock_icons[i].translucent_name) { - iconset = gtk_icon_set_new(); - -#define ADD_TRANS_ICON(name, size) do { \ - if (sized_stock_icons[i].name) \ - add_translucent_sized_icon(iconset, name, \ - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, \ - size, sized_stock_icons[i].filename); \ - } while (0) - ADD_TRANS_ICON(microscopic, "11"); - ADD_TRANS_ICON(extra_small, "16"); - ADD_TRANS_ICON(small, "22"); - ADD_TRANS_ICON(medium, "32"); - ADD_TRANS_ICON(large, "48"); - ADD_TRANS_ICON(huge, "64"); -#undef ADD_TRANS_ICON - - gtk_icon_factory_add(icon_factory, sized_stock_icons[i].translucent_name, iconset); - gtk_icon_set_unref(iconset); - } - } - - gtk_widget_destroy(win); - g_object_unref(G_OBJECT(icon_factory)); - - /* Register the stock items. */ - gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items)); -}
--- a/pidgin/pidginstock.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/pidginstock.c Thu Nov 13 19:50:53 2008 +0000 @@ -64,6 +64,7 @@ { PIDGIN_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR }, { PIDGIN_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO }, { PIDGIN_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES }, + { PIDGIN_STOCK_ADD, NULL, GTK_STOCK_ADD }, #if GTK_CHECK_VERSION(2,6,0) { PIDGIN_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE }, #else @@ -90,7 +91,8 @@ { PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, N_("I_M"), 0, 0, NULL }, { PIDGIN_STOCK_TOOLBAR_USER_INFO, N_("_Get Info"), 0, 0, NULL }, { PIDGIN_STOCK_INVITE, N_("_Invite"), 0, 0, NULL }, - { PIDGIN_STOCK_MODIFY, N_("_Modify"), 0, 0, NULL }, + { PIDGIN_STOCK_MODIFY, N_("_Modify..."), 0, 0, NULL }, + { PIDGIN_STOCK_ADD, N_("_Add..."), 0, 0, NULL }, { PIDGIN_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL }, { PIDGIN_STOCK_PAUSE, N_("_Pause"), 0, 0, NULL }, { PIDGIN_STOCK_EDIT, N_("_Edit"), 0, 0, NULL }
--- a/pidgin/pidginstock.h Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/pidginstock.h Thu Nov 13 19:50:53 2008 +0000 @@ -49,6 +49,7 @@ #define PIDGIN_STOCK_INFO "pidgin-info" #define PIDGIN_STOCK_INVITE "pidgin-invite" #define PIDGIN_STOCK_MODIFY "pidgin-modify" +#define PIDGIN_STOCK_ADD "pidgin-add" #define PIDGIN_STOCK_OPEN_MAIL "pidgin-stock-open-mail" #define PIDGIN_STOCK_PAUSE "pidgin-pause" #define PIDGIN_STOCK_POUNCE "pidgin-pounce"
--- a/pidgin/pidgintooltip.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/pidgintooltip.c Thu Nov 13 19:50:53 2008 +0000 @@ -30,6 +30,9 @@ #include "pidgintooltip.h" #include "debug.h" +static gboolean enable_tooltips; +static int tooltip_delay = -1; + struct { GtkWidget *widget; @@ -56,6 +59,27 @@ } PidginTooltipData; static void +initialize_tooltip_delay() +{ +#if GTK_CHECK_VERSION(2,14,0) + GtkSettings *settings; +#endif + + if (tooltip_delay != -1) + return; + +#if GTK_CHECK_VERSION(2,14,0) + settings = gtk_settings_get_default(); + + g_object_get(settings, "gtk-enable-tooltips", &enable_tooltips, NULL); + g_object_get(settings, "gtk-tooltip-timeout", &tooltip_delay, NULL); +#else + tooltip_delay = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay"); + enable_tooltips = (tooltip_delay != 0); +#endif +} + +static void destroy_tooltip_data(PidginTooltipData *data) { gtk_tree_path_free(data->common.treeview.path); @@ -280,14 +304,12 @@ row_motion_cb(GtkWidget *tv, GdkEventMotion *event, gpointer userdata) { GtkTreePath *path; - int delay; if (event->window != gtk_tree_view_get_bin_window(GTK_TREE_VIEW(tv))) return FALSE; /* The cursor is probably on the TreeView's header. */ - /* XXX: probably use something more generic? */ - delay = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay"); - if (delay == 0) + initialize_tooltip_delay(); + if (!enable_tooltips) return FALSE; if (pidgin_tooltip.timeout) { @@ -307,7 +329,7 @@ gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), path, NULL, &pidgin_tooltip.tip_rect); gtk_tree_path_free(path); - pidgin_tooltip.timeout = g_timeout_add(delay, (GSourceFunc)pidgin_tooltip_timeout, userdata); + pidgin_tooltip.timeout = g_timeout_add(tooltip_delay, (GSourceFunc)pidgin_tooltip_timeout, userdata); return FALSE; } @@ -337,13 +359,13 @@ static gboolean widget_motion_cb(GtkWidget *widget, GdkEvent *event, gpointer data) { - int delay = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay"); + initialize_tooltip_delay(); pidgin_tooltip_destroy(); - if (delay == 0) + if (!enable_tooltips) return FALSE; - pidgin_tooltip.timeout = g_timeout_add(delay, (GSourceFunc)pidgin_tooltip_timeout, data); + pidgin_tooltip.timeout = g_timeout_add(tooltip_delay, (GSourceFunc)pidgin_tooltip_timeout, data); return FALSE; }
--- a/pidgin/plugins/markerline.c Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/plugins/markerline.c Thu Nov 13 19:50:53 2008 +0000 @@ -202,16 +202,14 @@ } static void -conv_created(PurpleConversation *conv, gpointer null) +conv_created(PidginConversation *gtkconv, gpointer null) { - PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); PidginWindow *win; - if (!gtkconv) + win = pidgin_conv_get_window(gtkconv); + if (!win) return; - win = pidgin_conv_get_window(gtkconv); - detach_from_pidgin_window(win, NULL); attach_to_pidgin_window(win, NULL); } @@ -247,7 +245,7 @@ { attach_to_all_windows(); - purple_signal_connect(purple_conversations_get_handle(), "conversation-created", + purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", plugin, PURPLE_CALLBACK(conv_created), NULL); purple_signal_connect(purple_conversations_get_handle(), "conversation-extended-menu",
--- a/pidgin/plugins/perl/common/gtkmodule.h Wed Oct 29 21:38:33 2008 +0000 +++ b/pidgin/plugins/perl/common/gtkmodule.h Thu Nov 13 19:50:53 2008 +0000 @@ -1,3 +1,7 @@ +/* Allow the Perl code to see deprecated functions, so we can continue to + * export them to Perl plugins. */ +#undef PIDGIN_DISABLE_DEPRECATED + typedef struct group *Pidgin__Group; #define group perl_group
--- a/po/POTFILES.in Wed Oct 29 21:38:33 2008 +0000 +++ b/po/POTFILES.in Thu Nov 13 19:50:53 2008 +0000 @@ -136,6 +136,7 @@ libpurple/protocols/qq/buddy_opt.c libpurple/protocols/qq/group.c libpurple/protocols/qq/group_im.c +libpurple/protocols/qq/group_info.c libpurple/protocols/qq/group_internal.c libpurple/protocols/qq/group_join.c libpurple/protocols/qq/group_opt.c @@ -145,7 +146,6 @@ libpurple/protocols/qq/qq_network.c libpurple/protocols/qq/qq_process.c libpurple/protocols/qq/send_file.c -libpurple/protocols/qq/sys_msg.c libpurple/protocols/sametime/sametime.c libpurple/protocols/silc/buddy.c libpurple/protocols/silc/chat.c @@ -215,7 +215,6 @@ pidgin/gtkwhiteboard.c pidgin/pidgin.h pidgin/pidgincombobox.c -pidgin/pidginstock-artwork.c pidgin/pidginstock.c pidgin/pidgintooltip.c pidgin/pixmaps/emotes/default/24/default.theme.in