# HG changeset patch # User Yoshiki Yazawa # Date 1226902533 0 # Node ID 6ecfc6b9667cb3e1162b22df91fcd1b91d24b327 # Parent 45ce87f9a07fa2a329976444e077e3f537355918# Parent ef9da5db3c71af4d7dac28fc40079ddc46e214d2 propagate from branch 'im.pidgin.pidgin' (head ca4b6e987b967927b0f8bd001bc33440a6885000) to branch 'im.pidgin.pidgin.yaz' (head 7a92169e2ac82026d2b2918ed9662c7fd42e3280) diff -r 45ce87f9a07f -r 6ecfc6b9667c .mtn-ignore --- a/.mtn-ignore Fri Oct 31 08:37:42 2008 +0000 +++ b/.mtn-ignore Mon Nov 17 06:15:33 2008 +0000 @@ -39,8 +39,10 @@ pidgin/pidgin$ pidgin/pixmaps/emotes/default/24/theme pidgin/pixmaps/emotes/none/theme +pidgin/pixmaps/emotes/small/16/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 @@ -51,6 +53,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 diff -r 45ce87f9a07f -r 6ecfc6b9667c COPYRIGHT --- a/COPYRIGHT Fri Oct 31 08:37:42 2008 +0000 +++ b/COPYRIGHT Mon Nov 17 06:15:33 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 @@ -462,6 +464,7 @@ Dan Willemsen Justin Williams (Jaywalker) Jason Willis +Alex Willmer Matt Wilson Dan Winship Scott Wolchok diff -r 45ce87f9a07f -r 6ecfc6b9667c ChangeLog --- a/ChangeLog Fri Oct 31 08:37:42 2008 +0000 +++ b/ChangeLog Mon Nov 17 06:15:33 2008 +0000 @@ -7,6 +7,7 @@ "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 diff -r 45ce87f9a07f -r 6ecfc6b9667c Makefile.am --- a/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/Makefile.am Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c configure.ac --- a/configure.ac Fri Oct 31 08:37:42 2008 +0000 +++ b/configure.ac Mon Nov 17 06:15:33 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();" @@ -2384,6 +2384,7 @@ pidgin/pixmaps/Makefile pidgin/pixmaps/emotes/default/24/Makefile pidgin/pixmaps/emotes/none/Makefile + pidgin/pixmaps/emotes/small/16/Makefile pidgin/plugins/Makefile pidgin/plugins/cap/Makefile pidgin/plugins/gestures/Makefile diff -r 45ce87f9a07f -r 6ecfc6b9667c doc/TCL-HOWTO.dox --- a/doc/TCL-HOWTO.dox Fri Oct 31 08:37:42 2008 +0000 +++ b/doc/TCL-HOWTO.dox Mon Nov 17 06:15:33 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 load {} gaim 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 load {} purple 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 namespace -import gaim::*) 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 namespace +import purple::*) 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 - gaim::account username and gaim::account protocol) and + purple::account username and purple::account protocol) and returns the account if found, or 0 otherwise. @c handle returns the instance handle required to connect to account - signals. (See gaim::signal connect). + signals. (See purple::signal connect). 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 gaim::signal connect). + signals to buddy list events. (See purple::signal connect). - @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 - gaim_connection_get_display_name(gc). + purple_connection_get_display_name(gc). - @c handle returns the gaim connections instance handle. (See - gaim::signal connect). + @c handle returns the purple connections instance handle. (See + purple::signal connect). @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 - gaim::conversation write. It sends the IM, determines the from - and to arguments for gaim::conversation write, and prints the text + @c purple::conv is simply a convenience wrapper for @c purple::send_im and + purple::conversation write. It sends the IM, determines the from + and to arguments for purple::conversation write, and prints the text sent to the conversation as one would expect. For the curious, you - may view the source for it by typing info body gaim::conv_send at - a Gaim Commander prompt. + may view the source for it by typing info body purple::conv_send at + a Purple Commander prompt. - Note that an error in either @c gaim::send_im or gaim::conversation + Note that an error in either @c purple::send_im or purple::conversation write 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 gaim::signal connect). + of signal connection. (See purple::signal connect). @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. - gaim::core handle returns a handle to the gaim core for signal - connection. (See gaim::signal connect). + purple::core handle returns a handle to the purple core for signal + connection. (See purple::signal connect). - @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. - gaim::signal connect 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. purple::signal + connect 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. diff -r 45ce87f9a07f -r 6ecfc6b9667c doc/funniest_home_convos.txt --- a/doc/funniest_home_convos.txt Fri Oct 31 08:37:42 2008 +0000 +++ b/doc/funniest_home_convos.txt Mon Nov 17 06:15:33 2008 +0000 @@ -556,3 +556,12 @@ (16:58:10) elb: I just spent literally a couple of HOURS trying to debug a problem where I was using g_list_delete_link with a list item which wasn't in the list + +-- + +22:35 hi I know this might sound like a stupid question and I am NOT + trolling.. +22:36 but when I go to some channels like anime ones people lol at me + for using pidgen +22:36 why do they think this is a bad client? does it have history? + diff -r 45ce87f9a07f -r 6ecfc6b9667c finch/gntdebug.c --- a/finch/gntdebug.c Fri Oct 31 08:37:42 2008 +0000 +++ b/finch/gntdebug.c Mon Nov 17 06:15:33 2008 +0000 @@ -233,7 +233,7 @@ } fprintf(fp, "Finch Debug Log : %s\n", purple_date_format_full(NULL)); - fprintf(fp, tv->string->str); + fprintf(fp, "%s", tv->string->str); fclose(fp); gnt_widget_destroy(GNT_WIDGET(fs)); } diff -r 45ce87f9a07f -r 6ecfc6b9667c finch/libgnt/gntentry.c --- a/finch/libgnt/gntentry.c Fri Oct 31 08:37:42 2008 +0000 +++ b/finch/libgnt/gntentry.c Mon Nov 17 06:15:33 2008 +0000 @@ -903,6 +903,7 @@ GNT_KEY_CTRL_K, NULL); gnt_bindable_class_register_action(bindable, "delete-prev-word", del_prev_word, GNT_KEY_CTRL_W, NULL); + gnt_bindable_register_binding(bindable, "delete-prev-word", "\033", s, NULL); gnt_bindable_class_register_action(bindable, "cursor-prev-word", move_back_word, "\033" "b", NULL); gnt_bindable_class_register_action(bindable, "cursor-prev", move_back, diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/blist.c --- a/libpurple/blist.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/blist.c Mon Nov 17 06:15:33 2008 +0000 @@ -2214,6 +2214,7 @@ struct proto_chat_entry *pce; PurpleBlistNode *node, *group; GList *parts; + char *normname; g_return_val_if_fail(purplebuddylist != NULL, NULL); g_return_val_if_fail((name != NULL) && (*name != '\0'), NULL); @@ -2227,6 +2228,7 @@ if (prpl_info->find_blist_chat != NULL) return prpl_info->find_blist_chat(account, name); + normname = g_strdup(purple_normalize(account, name)); for (group = purplebuddylist->root; group != NULL; group = group->next) { for (node = group->child; node != NULL; node = node->next) { if (PURPLE_BLIST_NODE_IS_CHAT(node)) { @@ -2246,14 +2248,15 @@ g_list_free(parts); if (chat->account == account && chat_name != NULL && - name != NULL && !strcmp(chat_name, name)) { - + normname != NULL && !strcmp(purple_normalize(account, chat_name), normname)) { + g_free(normname); return chat; } } } } + g_free(normname); return NULL; } diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/dbus-analyze-functions.py --- a/libpurple/dbus-analyze-functions.py Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/dbus-analyze-functions.py Mon Nov 17 06:15:33 2008 +0000 @@ -372,13 +372,13 @@ def inputsimple(self, type, name, us): if us: + self.cdecls.append("\tdbus_uint32_t %s;" % name) + self.cparams.append(("UINT32", name)) + self.addintype("u", name) + else: self.cdecls.append("\tdbus_int32_t %s;" % name) self.cparams.append(("INT32", name)) self.addintype("i", name) - else: - self.cdecls.append("\tdbus_uint32_t %s;" % name) - self.cparams.append(("UINT32", name)) - self.addintype("u", name) def inputstring(self, type, name, us): if us: diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/plugins/log_reader.c --- a/libpurple/plugins/log_reader.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/plugins/log_reader.c Mon Nov 17 06:15:33 2008 +0000 @@ -1971,7 +1971,7 @@ c = contents; line = contents; - while (*c) { + while (c && *c) { gboolean is_in_message = FALSE; if (purple_str_has_prefix(line, QIP_LOG_IN_MESSAGE_ESC) || diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/plugins/perl/common/Notify.xs --- a/libpurple/plugins/perl/common/Notify.xs Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/plugins/perl/common/Notify.xs Mon Nov 17 06:15:33 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[] = { diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/plugins/ssl/ssl-nss.c --- a/libpurple/plugins/ssl/ssl-nss.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/plugins/ssl/ssl-nss.c Mon Nov 17 06:15:33 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 * diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/plugins/tcl/tcl_cmd.c --- a/libpurple/plugins/tcl/tcl_cmd.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/plugins/tcl/tcl_cmd.c Mon Nov 17 06:15:33 2008 +0000 @@ -159,7 +159,7 @@ errorstr = g_strdup_printf("error evaluating callback: %s\n", Tcl_GetString(Tcl_GetObjResult(handler->interp))); - purple_debug(PURPLE_DEBUG_ERROR, "tcl", errorstr); + purple_debug(PURPLE_DEBUG_ERROR, "tcl", "%s", errorstr); *errors = errorstr; retval = PURPLE_CMD_RET_FAILED; } else { @@ -170,7 +170,7 @@ errorstr = g_strdup_printf("Error retreiving procedure result: %s\n", Tcl_GetString(Tcl_GetObjResult(handler->interp))); - purple_debug(PURPLE_DEBUG_ERROR, "tcl", errorstr); + purple_debug(PURPLE_DEBUG_ERROR, "tcl", "%s", errorstr); *errors = errorstr; retval = PURPLE_CMD_RET_FAILED; } diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/bonjour/Makefile.am --- a/libpurple/protocols/bonjour/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/bonjour/Makefile.am Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/gg/Makefile.am --- a/libpurple/protocols/gg/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/gg/Makefile.am Mon Nov 17 06:15:33 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) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/gg/gg.c --- a/libpurple/protocols/gg/gg.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/gg/gg.c Mon Nov 17 06:15:33 2008 +0000 @@ -2232,7 +2232,7 @@ break; } - purple_debug(purple_level, "gg", msg); + purple_debug(purple_level, "gg", "%s", msg); g_free(msg); } /* }}} */ diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/irc/Makefile.am --- a/libpurple/protocols/irc/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/irc/Makefile.am Mon Nov 17 06:15:33 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) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/irc/irc.c --- a/libpurple/protocols/irc/irc.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/irc/irc.c Mon Nov 17 06:15:33 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; diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/irc/irc.h --- a/libpurple/protocols/irc/irc.h Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/irc/irc.h Mon Nov 17 06:15:33 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); diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/irc/parse.c --- a/libpurple/protocols/irc/parse.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/irc/parse.c Mon Nov 17 06:15:33 2008 +0000 @@ -698,6 +698,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] == '&'); diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/jabber/Makefile.am --- a/libpurple/protocols/jabber/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/jabber/Makefile.am Mon Nov 17 06:15:33 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) @@ -59,20 +59,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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/jabber/buddy.c Mon Nov 17 06:15:33 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; } diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/jabber/message.c --- a/libpurple/protocols/jabber/message.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/jabber/message.c Mon Nov 17 06:15:33 2008 +0000 @@ -616,7 +616,7 @@ if (jid) { chat = jabber_chat_find(js, jid->node, jid->domain); - conv = chat->conv; + if (chat) conv = chat->conv; } jabber_id_free(jid); @@ -650,7 +650,7 @@ /* note: if there were no smileys in the incoming message, or if receiving custom smileys is turned off, smiley_refs will be NULL */ - for (; smiley_refs ; smiley_refs = g_list_delete_link(smiley_refs, smiley_refs)) { + for (; conv && smiley_refs ; smiley_refs = g_list_delete_link(smiley_refs, smiley_refs)) { JabberSmileyRef *ref = (JabberSmileyRef *) smiley_refs->data; const gchar *cid = ref->cid; const gchar *alt = ref->alt; diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/Makefile.am --- a/libpurple/protocols/msn/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/Makefile.am Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/httpconn.c --- a/libpurple/protocols/msn/httpconn.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/httpconn.c Mon Nov 17 06:15:33 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); @@ -120,7 +119,7 @@ /* Need to wait for the full HTTP header to arrive */ return FALSE; - s += 4; /* Skip \r\n */ + s += 4; /* Skip \r\n\r\n */ header = g_strndup(buf, s - buf); body_start = s; body_len = size - (body_start - buf); @@ -158,11 +157,12 @@ } } - 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", + purple_debug_misc("msn", "Incoming HTTP buffer (header): {%s}\n", header); #endif @@ -184,6 +184,7 @@ purple_debug_error("msn", "Malformed X-MSN-Messenger field.\n{%s}\n", buf); + g_free(header); g_free(body); return FALSE; } @@ -217,15 +218,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 +250,8 @@ g_free(session_id); g_free(gw_ip); } + + g_free(session_action); } g_free(header); @@ -271,27 +269,26 @@ { MsnHttpConn *httpconn; MsnServConn *servconn; - MsnSession *session; char buf[MSN_BUF_LEN]; - char *cur, *end, *old_rx_buf; gssize len; - int cur_len; char *result_msg = NULL; size_t result_len = 0; gboolean error = FALSE; httpconn = data; - servconn = NULL; - session = httpconn->session; + servconn = httpconn->servconn; + + if (servconn->type == MSN_SERVCONN_NS) + servconn->session->account->gc->last_received = time(NULL); len = read(httpconn->fd, buf, sizeof(buf) - 1); - if (len < 0 && errno == EAGAIN) return; - else if (len <= 0) - { - purple_debug_error("msn", "HTTP: Read error\n"); - msn_servconn_got_error(httpconn->servconn, MSN_SERVCONN_ERROR_READ); + if (len <= 0) { + purple_debug_error("msn", "HTTP: servconn %03d read error, " + "len: %" G_GSSIZE_FORMAT ", errno: %d, error: %s\n", + servconn->num, len, error, g_strerror(errno)); + msn_servconn_got_error(servconn, MSN_SERVCONN_ERROR_READ); return; } @@ -307,19 +304,15 @@ { /* Either we must wait for more input, or something went wrong */ if (error) - msn_servconn_got_error(httpconn->servconn, MSN_SERVCONN_ERROR_READ); + msn_servconn_got_error(servconn, MSN_SERVCONN_ERROR_READ); return; } - httpconn->servconn->processing = FALSE; - - servconn = httpconn->servconn; - if (error) { purple_debug_error("msn", "HTTP: Special error\n"); - msn_servconn_got_error(httpconn->servconn, MSN_SERVCONN_ERROR_READ); + msn_servconn_got_error(servconn, MSN_SERVCONN_ERROR_READ); return; } @@ -342,64 +335,7 @@ servconn->rx_buf = result_msg; servconn->rx_len = result_len; - end = old_rx_buf = servconn->rx_buf; - - servconn->processing = TRUE; - - do - { - cur = end; - - if (servconn->payload_len) - { - if (servconn->payload_len > servconn->rx_len) - /* The payload is still not complete. */ - break; - - cur_len = servconn->payload_len; - end += cur_len; - } - else - { - end = strstr(cur, "\r\n"); - - if (end == NULL) - /* The command is still not complete. */ - break; - - *end = '\0'; - end += 2; - cur_len = end - cur; - } - - servconn->rx_len -= cur_len; - - if (servconn->payload_len) - { - msn_cmdproc_process_payload(servconn->cmdproc, cur, cur_len); - servconn->payload_len = 0; - } - else - { - msn_cmdproc_process_cmd_text(servconn->cmdproc, cur); - servconn->payload_len = servconn->cmdproc->last_cmd->payload_len; - } - } while (servconn->connected && servconn->rx_len > 0); - - if (servconn->connected) - { - if (servconn->rx_len > 0) - servconn->rx_buf = g_memdup(cur, servconn->rx_len); - else - servconn->rx_buf = NULL; - } - - servconn->processing = FALSE; - - if (servconn->wasted) - msn_servconn_destroy(servconn); - - g_free(old_rx_buf); + msn_servconn_process_data(servconn); } static void @@ -723,7 +659,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); } diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/msg.c --- a/libpurple/protocols/msn/msg.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/msg.c Mon Nov 17 06:15:33 2008 +0000 @@ -195,8 +195,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; } } @@ -212,8 +213,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); @@ -311,8 +313,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; } @@ -328,8 +331,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'; } } @@ -526,8 +530,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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/msn.c --- a/libpurple/protocols/msn/msn.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/msn.c Mon Nov 17 06:15:33 2008 +0000 @@ -121,9 +121,6 @@ session = gc->proto_data; swboard = msn_session_get_swboard(session, username, MSN_SB_FLAG_IM); - if (swboard == NULL) - return FALSE; - msn_switchboard_send_msg(swboard, msg, TRUE); msn_message_destroy(msg); @@ -574,21 +571,17 @@ msn_new_xfer(PurpleConnection *gc, const char *who) { MsnSession *session; - MsnSlpLink *slplink; PurpleXfer *xfer; session = gc->proto_data; xfer = purple_xfer_new(gc->account, PURPLE_XFER_SEND, who); - if (xfer) - { - slplink = msn_session_get_slplink(session, who); - - xfer->data = slplink; - - purple_xfer_set_init_fnc(xfer, t_msn_xfer_init); - } + g_return_val_if_fail(xfer != NULL, NULL); + + xfer->data = msn_session_get_slplink(session, who); + + purple_xfer_set_init_fnc(xfer, t_msn_xfer_init); return xfer; } @@ -2591,22 +2584,19 @@ PURPLE_PLUGIN_MAGIC, PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION, - PURPLE_PLUGIN_PROTOCOL, /**< type */ + PURPLE_PLUGIN_PROTOCOL, /**< type */ NULL, /**< ui_requirement */ 0, /**< flags */ NULL, /**< dependencies */ - PURPLE_PRIORITY_DEFAULT, /**< priority */ + PURPLE_PRIORITY_DEFAULT, /**< priority */ "prpl-msn", /**< id */ "MSN", /**< name */ DISPLAY_VERSION, /**< version */ - /** summary */ - N_("Windows Live Messenger Protocol Plugin"), - /** description */ - N_("Windows Live Messenger Protocol Plugin"), - "Christian Hammond , " - "MaYuan ", /**< author */ - PURPLE_WEBSITE, /**< homepage */ + N_("Windows Live Messenger Protocol Plugin"), /**< summary */ + N_("Windows Live Messenger Protocol Plugin"), /**< description */ + NULL, /**< author */ + PURPLE_WEBSITE, /**< homepage */ msn_load, /**< load */ msn_unload, /**< unload */ diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/servconn.c --- a/libpurple/protocols/msn/servconn.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/servconn.c Mon Nov 17 06:15:33 2008 +0000 @@ -174,15 +174,6 @@ servconn = data; servconn->connect_data = NULL; - servconn->processing = FALSE; - - if (servconn->wasted) - { - if (source >= 0) - close(source); - msn_servconn_destroy(servconn); - return; - } servconn->fd = source; @@ -239,15 +230,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 @@ -383,24 +366,19 @@ read_cb(gpointer data, gint source, PurpleInputCondition cond) { MsnServConn *servconn; - MsnSession *session; char buf[MSN_BUF_LEN]; - char *cur, *end, *old_rx_buf; gssize len; - int cur_len; servconn = data; - session = servconn->session; - len = read(servconn->fd, buf, sizeof(buf) - 1); if (servconn->type == MSN_SERVCONN_NS) servconn->session->account->gc->last_received = time(NULL); - if (len < 0 && errno == EAGAIN) { + len = read(servconn->fd, buf, sizeof(buf) - 1); + if (len < 0 && errno == EAGAIN) return; - - } else if (len <= 0) { - purple_debug_error("msn", "servconn %03d read error," + if (len <= 0) { + purple_debug_error("msn", "servconn %03d read error, " "len: %" G_GSSIZE_FORMAT ", errno: %d, error: %s\n", servconn->num, len, errno, g_strerror(errno)); msn_servconn_got_error(servconn, MSN_SERVCONN_ERROR_READ); @@ -414,6 +392,14 @@ memcpy(servconn->rx_buf + servconn->rx_len, buf, len + 1); servconn->rx_len += len; + msn_servconn_process_data(servconn); +} + +void msn_servconn_process_data(MsnServConn *servconn) +{ + char *cur, *end, *old_rx_buf; + int cur_len; + end = old_rx_buf = servconn->rx_buf; servconn->processing = TRUE; diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/servconn.h --- a/libpurple/protocols/msn/servconn.h Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/servconn.h Mon Nov 17 06:15:33 2008 +0000 @@ -170,4 +170,12 @@ */ void msn_servconn_got_error(MsnServConn *servconn, MsnServConnError error); +/** + * Process the data in servconn->rx_buf. This is called after reading + * data from the socket. + * + * @param servconn The servconn. + */ +void msn_servconn_process_data(MsnServConn *servconn); + #endif /* _MSN_SERVCONN_H_ */ diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/session.c --- a/libpurple/protocols/msn/session.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/session.c Mon Nov 17 06:15:33 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; diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/slp.c --- a/libpurple/protocols/msn/slp.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/slp.c Mon Nov 17 06:15:33 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: */ #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; @@ -755,17 +758,20 @@ if (slplink->swboard == NULL) { - /* We will need this in order to change its flags. */ - slplink->swboard = (MsnSwitchBoard *)cmdproc->data; - /* If swboard is NULL, something has probably gone wrong earlier on - * I didn't want to do this, but MSN 7 is somehow causing us to crash - * here, I couldn't reproduce it to debug more, and people are - * reporting bugs. Hopefully this doesn't cause more crashes. Stu. + /* + * We will need swboard in order to change its flags. If its + * NULL, something has probably gone wrong earlier on. I + * didn't want to do this, but MSN 7 is somehow causing us + * to crash here, I couldn't reproduce it to debug more, + * and people are reporting bugs. Hopefully this doesn't + * cause more crashes. Stu. */ - if (slplink->swboard != NULL) + if (cmdproc->data == NULL) + g_warning("msn_p2p_msg cmdproc->data was NULL\n"); + else { + slplink->swboard = (MsnSwitchBoard *)cmdproc->data; slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink); - else - purple_debug_error("msn", "msn_p2p_msg, swboard is NULL, ouch!\n"); + } } msn_slplink_process_msg(slplink, msg); @@ -841,7 +847,18 @@ sha1 = msn_object_get_sha1(obj); slplink = msn_session_get_slplink(session, who); - slplink->swboard = swboard; + if (slplink->swboard != swboard) { + if (slplink->swboard != NULL) + /* + * Apparently we're using a different switchboard now or + * something? I don't know if this is normal, but it + * definitely happens. So make sure the old switchboard + * doesn't still have a reference to us. + */ + slplink->swboard->slplinks = g_list_remove(slplink->swboard->slplinks, slplink); + slplink->swboard = swboard; + slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink); + } /* If the conversation doesn't exist then this is a custom smiley * used in the first message in a MSN conversation: we need to create @@ -1054,8 +1071,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); } diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/slpcall.c --- a/libpurple/protocols/msn/slpcall.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/slpcall.c Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/slpcall.h --- a/libpurple/protocols/msn/slpcall.h Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/slpcall.h Mon Nov 17 06:15:33 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_ */ diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/slplink.c --- a/libpurple/protocols/msn/slplink.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/slplink.c Mon Nov 17 06:15:33 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); } diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/slplink.h --- a/libpurple/protocols/msn/slplink.h Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/slplink.h Mon Nov 17 06:15:33 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, diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/slpmsg.c --- a/libpurple/protocols/msn/slpmsg.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/slpmsg.c Mon Nov 17 06:15:33 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, diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/soap.c --- a/libpurple/protocols/msn/soap.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/soap.c Mon Nov 17 06:15:33 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) { diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/switchboard.c --- a/libpurple/protocols/msn/switchboard.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/switchboard.c Mon Nov 17 06:15:33 2008 +0000 @@ -1319,10 +1319,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; @@ -1332,12 +1332,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; } /************************************************************************** diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/switchboard.h --- a/libpurple/protocols/msn/switchboard.h Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/switchboard.h Mon Nov 17 06:15:33 2008 +0000 @@ -68,9 +68,9 @@ */ struct _MsnSwitchBoard { - MsnSession *session; - MsnServConn *servconn; - MsnCmdProc *cmdproc; + MsnSession *session; /**< Our parent session. */ + MsnServConn *servconn; /**< The physical connection for this switchboard. */ + MsnCmdProc *cmdproc; /**< Convenience variable for servconn->cmdproc. */ char *im_user; MsnSBFlag flag; @@ -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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msn/transaction.c --- a/libpurple/protocols/msn/transaction.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msn/transaction.c Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/msnp9/Makefile.am --- a/libpurple/protocols/msnp9/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/msnp9/Makefile.am Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/myspace/Makefile.am --- a/libpurple/protocols/myspace/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/myspace/Makefile.am Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.c Mon Nov 17 06:15:33 2008 +0000 @@ -680,20 +680,34 @@ msim_incoming_im(MsimSession *session, MsimMessage *msg) { gchar *username, *msg_msim_markup, *msg_purple_markup; + gchar *userid; time_t time_received; + PurpleConversation *conv; g_return_val_if_fail(MSIM_SESSION_VALID(session), FALSE); g_return_val_if_fail(msg != NULL, FALSE); username = msim_msg_get_string(msg, "_username"); + /* I know this isn't really a string... but we need it to be one for + * purple_find_conversation_with_account(). */ + userid = msim_msg_get_string(msg, "f"); g_return_val_if_fail(username != NULL, FALSE); + purple_debug_info("msim_incoming_im", "UserID is %s", userid); + if (msim_is_userid(username)) { purple_debug_info("msim", "Ignoring message from spambot (%s) on account %s\n", username, purple_account_get_username(session->account)); g_free(username); return FALSE; } + + /* See if a conversation with their UID already exists...*/ + conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, userid, session->account); + if (conv) { + /* Since the conversation exists... We need to normalize it */ + purple_conversation_set_name(conv, username); + } msg_msim_markup = msim_msg_get_string(msg, "msg"); g_return_val_if_fail(msg_msim_markup != NULL, FALSE); @@ -703,6 +717,7 @@ time_received = msim_msg_get_integer(msg, "date"); if (!time_received) { + purple_debug_info("msim_incoming_im", "date in message not set.\n"); time_received = time(NULL); } diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/myspace/myspace.h --- a/libpurple/protocols/myspace/myspace.h Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.h Mon Nov 17 06:15:33 2008 +0000 @@ -48,6 +48,7 @@ #include "request.h" /* For dialogs used in setting the username */ #include "xmlnode.h" #include "core.h" +#include "conversation.h" /* For late normalization */ /* MySpaceIM includes */ #include "persist.h" diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/novell/Makefile.am --- a/libpurple/protocols/novell/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/novell/Makefile.am Mon Nov 17 06:15:33 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) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/null/Makefile.am --- a/libpurple/protocols/null/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/null/Makefile.am Mon Nov 17 06:15:33 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) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/oscar/Makefile.am --- a/libpurple/protocols/oscar/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/oscar/Makefile.am Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/oscar/family_auth.c --- a/libpurple/protocols/oscar/family_auth.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/oscar/family_auth.c Mon Nov 17 06:15:33 2008 +0000 @@ -32,7 +32,7 @@ #include -#define USE_XOR_FOR_ICQ +/* #define USE_XOR_FOR_ICQ */ #ifdef USE_XOR_FOR_ICQ /** diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/oscar/flap_connection.c --- a/libpurple/protocols/oscar/flap_connection.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/oscar/flap_connection.c Mon Nov 17 06:15:33 2008 +0000 @@ -228,7 +228,13 @@ rateclass->last.tv_usec = now.tv_usec; } } else { - purple_debug_warning("oscar", "No rate class found for family %hu subtype %hu\n", family, subtype); + /* + * It's normal for SNACs 0x0001/0x0006 and 0x0001/0x0017 to be + * sent before we receive rate info from the server, so don't + * bother warning about them. + */ + if (family != 0x0001 || (subtype != 0x0006 && subtype != 0x0017)) + purple_debug_warning("oscar", "No rate class found for family 0x%04hx subtype 0x%04hx\n", family, subtype); } if (enqueue) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/oscar/oscar.c Mon Nov 17 06:15:33 2008 +0000 @@ -1170,15 +1170,7 @@ conn->watcher_incoming = purple_input_add(conn->fd, PURPLE_INPUT_READ, flap_connection_recv_cb, conn); if (conn->cookie == NULL) - { - if (!aim_snvalid_icq(purple_account_get_username(account))) - /* - * We don't send this when authenticating an ICQ account - * because for some reason ICQ is still using the - * assy/insecure authentication procedure. - */ - flap_connection_send_version(od, conn); - } + flap_connection_send_version(od, conn); else { flap_connection_send_version_with_cookie(od, conn, @@ -1712,7 +1704,7 @@ for (x = 0; x < 16; x++) g_string_append_printf(msg, "%02hhx ", (unsigned char)m[x]); g_string_append(msg, "\n"); - purple_debug_misc("oscar", msg->str); + purple_debug_misc("oscar", "%s", msg->str); g_string_free(msg, TRUE); purple_input_remove(pos->inpa); @@ -4835,7 +4827,7 @@ gchar *buf; buf = g_strdup_printf(_("Could not add the buddy %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), buddy->name); if (!purple_conv_present_error(buddy->name, account, buf)) - purple_notify_error(gc, NULL, _("Unable To Add"), buf); + purple_notify_error(gc, NULL, _("Unable to Add"), buf); g_free(buf); /* Remove from local list */ @@ -4954,7 +4946,7 @@ purple_debug_error("oscar", "ssi: SNAC error %hu\n", reason); if (reason == 0x0005) { - purple_notify_error(gc, NULL, _("Unable To Retrieve Buddy List"), + purple_notify_error(gc, NULL, _("Unable to Retrieve Buddy List"), _("The AIM servers were temporarily unable to send your buddy list. Your buddy list is not lost, and will probably become available in a few minutes.")); if (od->getblisttimer > 0) purple_timeout_remove(od->getblisttimer); @@ -4983,7 +4975,7 @@ for (i=0; istr); + purple_debug_misc("oscar", "%s", msg->str); g_string_free(msg, TRUE); if (numtypes >= 0) @@ -5305,7 +5297,7 @@ gchar *buf; buf = g_strdup_printf(_("Could not add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)"))); if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) - purple_notify_error(gc, NULL, _("Unable To Add"), buf); + purple_notify_error(gc, NULL, _("Unable to Add"), buf); g_free(buf); } @@ -5320,7 +5312,7 @@ buf = g_strdup_printf(_("Could not add the buddy %s for an unknown reason."), (retval->name ? retval->name : _("(no name)"))); if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) - purple_notify_error(gc, NULL, _("Unable To Add"), buf); + purple_notify_error(gc, NULL, _("Unable to Add"), buf); g_free(buf); } break; } @@ -6119,10 +6111,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; diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/qq/Makefile.am --- a/libpurple/protocols/qq/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/qq/Makefile.am Mon Nov 17 06:15:33 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) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/qq/Makefile.mingw --- a/libpurple/protocols/qq/Makefile.mingw Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/qq/Makefile.mingw Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/qq/buddy_info.c --- a/libpurple/protocols/qq/buddy_info.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/qq/buddy_info.c Mon Nov 17 06:15:33 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 @@ -418,8 +418,8 @@ utf8_title = g_strdup(_("Modify Address")); utf8_prim = g_strdup_printf("%s for %s", _("Modify Address"), segments[0]); case QQ_FIELD_EXT: - utf8_title = g_strdup(_("Modify Extend Information")); - utf8_prim = g_strdup_printf("%s for %s", _("Modify Extend Information"), segments[0]); + utf8_title = g_strdup(_("Modify Extended Information")); + utf8_prim = g_strdup_printf("%s for %s", _("Modify Extended Information"), segments[0]); break; case QQ_FIELD_BASE: default: @@ -457,7 +457,7 @@ data[data_len] = '\0'; if (qd->uid != atoi((gchar *) data)) { /* return should be my uid */ purple_debug_info("QQ", "Failed Updating info\n"); - qq_got_attention(gc, _("Failed changing buddy information.")); + qq_got_attention(gc, _("Could not change buddy information.")); } } @@ -483,51 +483,27 @@ void qq_change_icon_cb(PurpleConnection *gc, const char *filepath) { - gchar **segments; - const gchar *filename; - gint index; + gchar *basename; + size_t index; gint face; - gchar *error; g_return_if_fail(filepath != NULL); purple_debug_info("QQ", "Change my icon to %s\n", filepath); - segments = g_strsplit_set(filepath, G_DIR_SEPARATOR_S, 0); -#if 0 - for (index = 0; segments[index] != NULL; index++) { - purple_debug_info("QQ", "Split to %s\n", segments[index]); - } -#endif - - index = g_strv_length(segments) - 1; - if (index < 0) { - g_strfreev(segments); - return; - } - - filename = segments[index]; - index = strcspn (filename, "0123456789"); - if (index < 0 || index >= strlen(filename)) { - error = g_strdup_printf(_("Can not get face number in file name (%s)"), filename); - purple_notify_error(gc, _("QQ Buddy"), _("Failed change icon"), error); - g_free(error); - return; - } - face = strtol(filename+index, NULL, 10); + basename = g_path_get_basename(filepath); + index = strcspn(basename, "0123456789"); + face = strtol(basename + index, NULL, 10); + g_free(basename); purple_debug_info("QQ", "Set face to %d\n", face); request_set_buddy_icon(gc, face); - - g_strfreev(segments); } void qq_set_custom_icon(PurpleConnection *gc, PurpleStoredImage *img) { PurpleAccount *account = purple_connection_get_account(gc); const gchar *icon_path = purple_account_get_buddy_icon_path(account); - gchar **segments; - gint index; g_return_if_fail(icon_path != NULL); @@ -536,12 +512,6 @@ * purple_imgstore_get_filename is always new file * QQ buddy may set custom icon if level is over 16 */ purple_debug_info("QQ", "Change my icon to %s\n", icon_path); - segments = g_strsplit_set(icon_path, G_DIR_SEPARATOR_S, 0); - for (index = 0; segments[index] != NULL; index++) { - purple_debug_info("QQ", "Split to %s\n", segments[index]); - } - - g_strfreev(segments); } gchar *qq_get_icon_name(gint face) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/qq/group_join.c --- a/libpurple/protocols/qq/group_join.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/qq/group_join.c Mon Nov 17 06:15:33 2008 +0000 @@ -219,11 +219,11 @@ rmd = qq_room_data_find(gc, id); if (rmd != NULL) { - msg = g_strdup_printf(_("Successed join to Qun %s (%d)"), rmd->title_utf8, rmd->ext_id); + msg = g_strdup_printf(_("Successfully joined Qun %s (%d)"), rmd->title_utf8, rmd->ext_id); qq_got_attention(gc, msg); g_free(msg); } else { - qq_got_attention(gc, _("Successed join to Qun")); + qq_got_attention(gc, _("Successfully joined Qun")); } } diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/qq/group_opt.c --- a/libpurple/protocols/qq/group_opt.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/qq/group_opt.c Mon Nov 17 06:15:33 2008 +0000 @@ -204,7 +204,7 @@ purple_debug_info("QQ", "Succeed in modify members for room %d\n", rmd->ext_id); - qq_room_got_chat_in(gc, id, 0, _("Successed changing Qun member"), now); + qq_room_got_chat_in(gc, id, 0, _("Successfully changed Qun member"), now); } void qq_room_change_info(PurpleConnection *gc, qq_room_data *rmd) @@ -248,7 +248,7 @@ purple_debug_info("QQ", "Succeed modify room info of %d\n", id); - qq_room_got_chat_in(gc, id, 0, _("Successed changing Qun information"), now); + qq_room_got_chat_in(gc, id, 0, _("Successfully changed Qun information"), now); } /* we create a very simple room first, and then let the user to modify */ @@ -347,7 +347,7 @@ purple_request_action(gc, _("QQ Qun Operation"), _("You have successfully created a Qun"), - _("Would you like to set up the detail information now?"), + _("Would you like to set detailed information now?"), 1, purple_connection_get_account(gc), NULL, NULL, add_req, 2, @@ -520,7 +520,7 @@ rmd->my_role = QQ_ROOM_ROLE_YES; } - msg = g_strdup_printf(_("Joinning Qun %d is approved by Admin %d for %s"), + msg = g_strdup_printf(_("Joining Qun %d is approved by admin %d for %s"), ext_id, admin_uid, reason); now = time(NULL); qq_room_got_chat_in(gc, id, 0, msg, now); diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/qq/qq.c --- a/libpurple/protocols/qq/qq.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/qq/qq.c Mon Nov 17 06:15:33 2008 +0000 @@ -56,9 +56,6 @@ #include "utils.h" #include "version.h" -#define OPENQ_AUTHOR "Puzzlebird" -#define OPENQ_WEBSITE "http://openq.sourceforge.net" - #ifndef OPENQ_VERSION #define OPENQ_VERSION DISPLAY_VERSION #endif @@ -770,7 +767,7 @@ g_string_append(info, ""); title = g_strdup_printf(_("About OpenQ r%s"), OPENQ_VERSION); - purple_notify_formatted(gc, NULL, title, NULL, info->str, NULL, NULL); + purple_notify_formatted(gc, title, title, NULL, info->str, NULL, NULL); g_free(title); g_string_free(info, TRUE); @@ -866,7 +863,7 @@ act = purple_plugin_action_new(_("Modify Information"), action_modify_info_base); m = g_list_append(m, act); - act = purple_plugin_action_new(_("Modify Extend Information"), action_modify_info_ext); + act = purple_plugin_action_new(_("Modify Extended Information"), action_modify_info_ext); m = g_list_append(m, act); act = purple_plugin_action_new(_("Modify Address"), action_modify_info_addr); @@ -1113,11 +1110,11 @@ "QQ", /**< name */ DISPLAY_VERSION, /**< version */ /** summary */ - N_("QQ Protocol Plugin"), + N_("QQ Protocol Plugin"), /** description */ - N_("QQ Protocol Plugin"), - OPENQ_AUTHOR, /**< author */ - OPENQ_WEBSITE, /**< homepage */ + N_("QQ Protocol Plugin"), + NULL, /**< author */ + PURPLE_WEBSITE, /**< homepage */ NULL, /**< load */ NULL, /**< unload */ @@ -1149,8 +1146,7 @@ server_list = server_list_build('A'); - purple_prefs_add_string_list("/plugins/prpl/qq/serverlist", server_list); - server_list = purple_prefs_get_string_list("/plugins/prpl/qq/serverlist"); + purple_prefs_remove("/plugins/prpl/qq/serverlist"); server_kv_list = NULL; kvp = g_new0(PurpleKeyValuePair, 1); @@ -1203,10 +1199,10 @@ option = purple_account_option_bool_new(_("Show server news"), "show_news", TRUE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); - option = purple_account_option_int_new(_("Keep alive interval(s)"), "keep_alive_interval", 60); + option = purple_account_option_int_new(_("Keep alive interval (seconds)"), "keep_alive_interval", 60); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); - option = purple_account_option_int_new(_("Update interval(s)"), "update_interval", 300); + option = purple_account_option_int_new(_("Update interval (seconds)"), "update_interval", 300); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); purple_prefs_add_none("/plugins/prpl/qq"); diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/qq/qq_base.c --- a/libpurple/protocols/qq/qq_base.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/qq/qq_base.c Mon Nov 17 06:15:33 2008 +0000 @@ -71,7 +71,7 @@ if (len < 139) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, - _("Can not decrypt get server reply")); + _("Can not decrypt server reply")); return QQ_LOGIN_REPLY_ERR; } @@ -404,18 +404,18 @@ return process_login_redirect(gc, data, data_len); case 0x0A: /* extend redirect used in QQ2006 */ - error = g_strdup( _("Not support Redirect_EX now") ); + error = g_strdup( _("Redirect_EX is not currently supported") ); reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; break; case 0x05: /* invalid password */ if (!purple_account_get_remember_password(gc->account)) { purple_account_set_password(gc->account, NULL); } - error = g_strdup( _("Error password")); + error = g_strdup( _("Incorrect password.")); reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; break; case 0x06: /* need activation */ - error = g_strdup( _("Need active")); + error = g_strdup( _("Activation required")); reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; break; @@ -789,7 +789,7 @@ qd->send_seq++; qq_send_cmd_encrypted(gc, QQ_CMD_TOKEN_EX, qd->send_seq, buf, bytes, TRUE); - purple_connection_update_progress(gc, _("Checking code of captcha ..."), 3, QQ_CONNECT_STEPS); + purple_connection_update_progress(gc, _("Checking code of captcha ..."), 3, QQ_CONNECT_STEPS); } typedef struct { @@ -873,7 +873,7 @@ purple_request_fields(account, _("QQ Captcha Verifing"), _("QQ Captcha Verifing"), - _("Please fill code according to image"), + _("Enter the text from the image"), fields, _("OK"), G_CALLBACK(captcha_input_ok_cb), _("Cancel"), G_CALLBACK(captcha_input_cancel_cb), @@ -1094,16 +1094,16 @@ if (!purple_account_get_remember_password(gc->account)) { purple_account_set_password(gc->account, NULL); } - error = g_strdup(_("Error password")); + error = g_strdup(_("Incorrect password.")); reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; break; case 0x33: /* need activation */ case 0x51: /* need activation */ - error = g_strdup(_("Need active")); + error = g_strdup(_("Activation required")); reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; break; case 0xBF: /* uid is not exist */ - error = g_strdup(_("invalid user name")); + error = g_strdup(_("Invalid username.")); reason = PURPLE_CONNECTION_ERROR_INVALID_USERNAME; break; default: diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/qq/qq_network.c --- a/libpurple/protocols/qq/qq_network.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/qq/qq_network.c Mon Nov 17 06:15:33 2008 +0000 @@ -204,7 +204,7 @@ if ( set_new_server(qd) != TRUE) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Failed to connect all servers")); + _("Unable to connect.")); return FALSE; } qd->connect_retry = QQ_CONNECT_MAX; @@ -461,9 +461,6 @@ conn->tcp_rxqueue = NULL; } - if (pkt == NULL) { - continue; - } /* packet_process may call disconnect and destory data like conn * do not call packet_process before jump, * break if packet_process return FALSE */ diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/qq/qq_process.c --- a/libpurple/protocols/qq/qq_process.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/qq/qq_process.c Mon Nov 17 06:15:33 2008 +0000 @@ -960,7 +960,7 @@ return ret_8; } - purple_connection_update_progress(gc, _("Logined"), QQ_CONNECT_STEPS - 1, QQ_CONNECT_STEPS); + purple_connection_update_progress(gc, _("Logging in"), QQ_CONNECT_STEPS - 1, QQ_CONNECT_STEPS); purple_debug_info("QQ", "Login repliess OK; everything is fine\n"); purple_connection_set_state(gc, PURPLE_CONNECTED); qd->is_login = TRUE; /* must be defined after sev_finish_login */ diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/qq/utils.c --- a/libpurple/protocols/qq/utils.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/qq/utils.c Mon Nov 17 06:15:33 2008 +0000 @@ -325,7 +325,7 @@ va_end(args); if (bytes <= 0) { - purple_debug(level, category, arg_s); + purple_debug(level, category, "%s", arg_s); return; } diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/sametime/Makefile.am --- a/libpurple/protocols/sametime/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/sametime/Makefile.am Mon Nov 17 06:15:33 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) - diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/sametime/sametime.c --- a/libpurple/protocols/sametime/sametime.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/sametime/sametime.c Mon Nov 17 06:15:33 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; diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/silc/Makefile.am --- a/libpurple/protocols/silc/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/silc/Makefile.am Mon Nov 17 06:15:33 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) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/silc10/Makefile.am --- a/libpurple/protocols/silc10/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/silc10/Makefile.am Mon Nov 17 06:15:33 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) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/simple/Makefile.am --- a/libpurple/protocols/simple/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/simple/Makefile.am Mon Nov 17 06:15:33 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) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/simple/simple.c --- a/libpurple/protocols/simple/simple.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/simple/simple.c Mon Nov 17 06:15:33 2008 +0000 @@ -1228,11 +1228,14 @@ if (purple_str_has_prefix(ssparts[i], "terminated")) { purple_debug_info("simple", "Subscription expired!"); - g_free(b->dialog->ourtag); - g_free(b->dialog->theirtag); - g_free(b->dialog->callid); - g_free(b->dialog); - b->dialog = NULL; + if (b->dialog) + { + g_free(b->dialog->ourtag); + g_free(b->dialog->theirtag); + g_free(b->dialog->callid); + g_free(b->dialog); + b->dialog = NULL; + } purple_prpl_got_user_status(sip->account, from, "offline", NULL); break; diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/simple/sipmsg.c --- a/libpurple/protocols/simple/sipmsg.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/simple/sipmsg.c Mon Nov 17 06:15:33 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; } diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/toc/Makefile.am --- a/libpurple/protocols/toc/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/toc/Makefile.am Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/yahoo/Makefile.am --- a/libpurple/protocols/yahoo/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/yahoo/Makefile.am Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Mon Nov 17 06:15:33 2008 +0000 @@ -3630,8 +3630,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) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/yahoo/yahoo.h --- a/libpurple/protocols/yahoo/yahoo.h Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.h Mon Nov 17 06:15:33 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) ( \ diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/yahoo/yahoo_filexfer.c --- a/libpurple/protocols/yahoo/yahoo_filexfer.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Mon Nov 17 06:15:33 2008 +0000 @@ -267,7 +267,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); diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/protocols/zephyr/Makefile.am --- a/libpurple/protocols/zephyr/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/protocols/zephyr/Makefile.am Mon Nov 17 06:15:33 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) diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/proxy.c --- a/libpurple/proxy.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/proxy.c Mon Nov 17 06:15:33 2008 +0000 @@ -1342,7 +1342,7 @@ if ((buf[0] != 0x05) || (buf[1] != 0x00)) { if ((buf[0] == 0x05) && (buf[1] < 0x09)) { - purple_debug_error("socks5 proxy", socks5errors[buf[1]]); + purple_debug_error("socks5 proxy", "%s", socks5errors[buf[1]]); purple_proxy_connect_data_disconnect(connect_data, socks5errors[buf[1]]); } else { diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/server.c --- a/libpurple/server.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/server.c Mon Nov 17 06:15:33 2008 +0000 @@ -265,7 +265,8 @@ purple_blist_server_alias_buddy(b, alias2); conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, b->name, account); - if(conv != NULL && alias2 != NULL && strcmp(alias2, who)) + if(conv != NULL && alias2 != NULL && + who != NULL && strcmp(alias2, who)) { char *escaped = g_markup_escape_text(who, -1); char *escaped2 = g_markup_escape_text(alias2, -1); diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/util.c --- a/libpurple/util.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/util.c Mon Nov 17 06:15:33 2008 +0000 @@ -984,6 +984,8 @@ gchar *tmp; gchar *ret; + g_return_val_if_fail(opt != NULL, NULL); + if (!css_str) return NULL; @@ -2433,6 +2435,7 @@ gunichar c; char *tag; + g_return_val_if_fail(str != NULL, NULL); g_return_val_if_fail(x <= y, NULL); if (x == y) @@ -3483,6 +3486,9 @@ char *cmd; GHashTable *params = NULL; int len; + + g_return_if_fail(uri != NULL); + if (!(tmp = strchr(uri, ':')) || tmp == uri) { purple_debug_error("util", "Malformed protocol handler message - missing protocol.\n"); return; @@ -4188,6 +4194,8 @@ const char *c, *domain; static char *rfc822_specials = "()<>@,;:\\\"[]"; + g_return_val_if_fail(address != NULL, FALSE); + /* first we validate the name portion (name@domain) (rfc822)*/ for (c = address; *c; c++) { if (*c == '\"' && (c == address || *(c - 1) == '.' || *(c - 1) == '\"')) { @@ -4236,6 +4244,9 @@ { int c, o1, o2, o3, o4; char end; + + g_return_val_if_fail(ip != NULL, FALSE); + c = sscanf(ip, "%d.%d.%d.%d%c", &o1, &o2, &o3, &o4, &end); if (c != 4 || o1 < 0 || o1 > 255 || o2 < 0 || o2 > 255 || o3 < 0 || o3 > 255 || o4 < 0 || o4 > 255) return FALSE; diff -r 45ce87f9a07f -r 6ecfc6b9667c libpurple/xmlnode.c --- a/libpurple/xmlnode.c Fri Oct 31 08:37:42 2008 +0000 +++ b/libpurple/xmlnode.c Mon Nov 17 06:15:33 2008 +0000 @@ -249,6 +249,7 @@ xmlnode *x; g_return_val_if_fail(node != NULL, NULL); + g_return_val_if_fail(attr != NULL, NULL); for(x = node->child; x; x = x->next) { if(x->type == XMLNODE_TYPE_ATTRIB && !strcmp(attr, x->name)) { @@ -265,6 +266,7 @@ xmlnode *x; g_return_val_if_fail(node != NULL, NULL); + g_return_val_if_fail(attr != NULL, NULL); for(x = node->child; x; x = x->next) { if(x->type == XMLNODE_TYPE_ATTRIB && diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtkaccount.c --- a/pidgin/gtkaccount.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/gtkaccount.c Mon Nov 17 06:15:33 2008 +0000 @@ -472,7 +472,7 @@ G_CALLBACK(screenname_changed_cb), dialog); /* Do the user split thang */ - if (dialog->plugin == NULL) /* Yeah right. */ + if (dialog->prpl_info == NULL) user_splits = NULL; else user_splits = dialog->prpl_info->user_splits; @@ -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 @@ "Welcome to %s!\n\n" "You have no IM accounts configured. To start connecting with %s " - "press the Add button below and configure your first " + "press the Add... button below and configure your first " "account. If you want %s to connect to multiple IM accounts, " - "press Add again to configure them all.\n\n" + "press Add... again to configure them all.\n\n" "You can come back to this window to add, edit, or remove " "accounts from Accounts->Manage Accounts 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); diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtkblist.c --- a/pidgin/gtkblist.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/gtkblist.c Mon Nov 17 06:15:33 2008 +0000 @@ -3350,7 +3350,7 @@ } } - if (prpl_info->chat_info != NULL) + if (prpl_info && prpl_info->chat_info != NULL) cur = prpl_info->chat_info(chat->account->gc); else cur = NULL; @@ -6957,7 +6957,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); diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtkconn.c --- a/pidgin/gtkconn.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/gtkconn.c Mon Nov 17 06:15:33 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; } diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtkconv.c --- a/pidgin/gtkconv.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/gtkconv.c Mon Nov 17 06:15:33 2008 +0000 @@ -1027,7 +1027,9 @@ } name = purple_conversation_get_name(conv); - fprintf(fp, "\n%s\n", name); + fprintf(fp, "\n\n"); + fprintf(fp, "\n"); + fprintf(fp, "%s\n\n\n", name); fprintf(fp, _("

Conversation with %s

\n"), name); lines = gtk_imhtml_get_markup_lines( diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/gtkimhtml.c Mon Nov 17 06:15:33 2008 +0000 @@ -2069,12 +2069,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; } } @@ -2094,9 +2105,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 diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtkmain.c --- a/pidgin/gtkmain.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/gtkmain.c Mon Nov 17 06:15:33 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 diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtknotify.c --- a/pidgin/gtknotify.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/gtknotify.c Mon Nov 17 06:15:33 2008 +0000 @@ -703,7 +703,7 @@ gtk_widget_grab_focus(button); g_signal_connect_swapped(G_OBJECT(button), "clicked", - G_CALLBACK(gtk_widget_destroy), window); + G_CALLBACK(formatted_close_cb), window); g_signal_connect(G_OBJECT(window), "key_press_event", G_CALLBACK(formatted_input_cb), NULL); diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtkpounce.c --- a/pidgin/gtkpounce.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/gtkpounce.c Mon Nov 17 06:15:33 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", diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtksavedstatuses.c --- a/pidgin/gtksavedstatuses.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/gtksavedstatuses.c Mon Nov 17 06:15:33 2008 +0000 @@ -475,7 +475,8 @@ static void savedstatus_activated_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, StatusWindow *dialog) { - status_window_modify_cb(NULL, dialog); + status_window_use_cb(NULL, dialog); + status_window_close_cb(NULL, dialog); } static void @@ -655,7 +656,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 */ diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtksound.c --- a/pidgin/gtksound.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/gtksound.c Mon Nov 17 06:15:33 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; } diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtkthemes.c --- a/pidgin/gtkthemes.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/gtkthemes.c Mon Nov 17 06:15:33 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) { diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/gtkutils.c diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pidginstock-artwork.c --- a/pidgin/pidginstock-artwork.c Fri Oct 31 08:37:42 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)); -} diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pidginstock.c --- a/pidgin/pidginstock.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/pidginstock.c Mon Nov 17 06:15:33 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 } diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pidginstock.h --- a/pidgin/pidginstock.h Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/pidginstock.h Mon Nov 17 06:15:33 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" diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/Makefile.am --- a/pidgin/pixmaps/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/pixmaps/Makefile.am Mon Nov 17 06:15:33 2008 +0000 @@ -1,12 +1,13 @@ pidginpixmapdir = $(datadir)/pixmaps/pidgin pidginiconsdir = $(datadir) -SUBDIRS = emotes/default/24 emotes/none +SUBDIRS = emotes/default/24 emotes/none emotes/small/16 if INSTALL_PIXMAPS MAKEFILE_MINGW = \ emotes/default/24/Makefile.mingw \ - emotes/none/Makefile.mingw + emotes/none/Makefile.mingw \ + emotes/small/16/Makefile.mingw ANIMATIONS_16 = \ animations/16/connect0.png \ @@ -177,6 +178,7 @@ emotes/default/24/scalable/musical-note.svg \ emotes/default/24/scalable/peace.svg \ emotes/default/24/scalable/phone.svg \ + emotes/default/24/scalable/pidgin-emotes.svg \ emotes/default/24/scalable/pig.svg \ emotes/default/24/scalable/pill.svg \ emotes/default/24/scalable/pizza.svg \ @@ -204,6 +206,9 @@ emotes/default/24/scalable/watermelon.svg \ emotes/default/24/scalable/yin-yang.svg +EMOTES_SMALL_16_SCALABLE = \ + emotes/small/16/scalable/pidgin-emotes.svg + PROTOCOLS_16_SCALABLE = \ protocols/16/scalable/aim.svg \ protocols/16/scalable/bonjour.svg \ diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/default/24/Makefile.am --- a/pidgin/pixmaps/emotes/default/24/Makefile.am Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/pixmaps/emotes/default/24/Makefile.am Mon Nov 17 06:15:33 2008 +0000 @@ -1,4 +1,5 @@ -SMILEYS = act-up.png \ +SMILEYS = \ + act-up.png \ airplane.png \ alien.png \ angel.png \ diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/emotes/small/16/Makefile.am Mon Nov 17 06:15:33 2008 +0000 @@ -0,0 +1,59 @@ +SMILEYS = \ + angel.png \ + angry.png \ + beer.png \ + camera.png \ + cigarette.png \ + coffee.png \ + confused.png \ + console.png \ + cool.png \ + cross.png \ + crying.png \ + devil.png \ + dont-know.png \ + grin.png \ + hug-left.png \ + hug-right.png \ + kiss.png \ + love.png \ + meeting.png \ + musical-note.png \ + nerdy.png \ + neutral.png \ + party.png \ + phone.png \ + plate.png \ + question.png \ + sad.png \ + shame.png \ + shock.png \ + sick.png \ + silent.png \ + sleepy.png \ + smile-big.png \ + smile.png \ + thinking.png \ + tongue.png \ + tv.png \ + uhm-yeah.png \ + wink.png \ + yawn.png + + +pidginsmileypix_in_files = small.theme.in + +if INSTALL_PIXMAPS +pidginsmileypixdir = $(datadir)/pixmaps/pidgin/emotes/small +pidginsmileypix_DATA = \ + $(SMILEYS) \ + theme + +theme: small.theme.in + sed -e 's/^_Name=/Name=/' \ + -e 's/^_Description=/Description=/' \ + -e 's/^_Author=/Author=/' \ + $< > $@ +endif + +EXTRA_DIST = $(SMILEYS) $(pidginsmileypix_in_files) theme diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/Makefile.mingw --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/emotes/small/16/Makefile.mingw Mon Nov 17 06:15:33 2008 +0000 @@ -0,0 +1,27 @@ +# +# Makefile.mingw +# +# Description: Makefile for win32 (mingw) version of Pidgin pixmaps +# + +PIDGIN_TREE_TOP := ../../../../.. +include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak + +datadir = $(PIDGIN_INSTALL_DIR) +-include ./Makefile.am.mingw + +.PHONY: install clean + +install: ./Makefile.am.mingw theme + if test '$(pidginsmileypix_DATA)'; then \ + mkdir -p $(pidginsmileypixdir); \ + cp $(pidginsmileypix_DATA) $(pidginsmileypixdir); \ + fi; + +clean: + rm -f theme ./Makefile.am.mingw + +./Makefile.am.mingw: ./Makefile.am + sed -e 's/^if\ INSTALL_PIXMAPS/ifeq (\$$(INSTALL_PIXMAPS), 1)/' ./Makefile.am > $@ + include $@ + diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/TODO --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/emotes/small/16/TODO Mon Nov 17 06:15:33 2008 +0000 @@ -0,0 +1,20 @@ +The following icons where just scaled down from the 24x24 and may need work: + meeting.png + question.png + search.png + sleepy.png + smile-big.png + tv.png + +The following icons came from N3fr0n and probably need to be redone to match +our default icons: + beer.png + camera.png + cigarette.png + coffee.png + console.png + love.png + musical-note.png + party.png + phone.png + plate.png diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/angel.png Binary file pidgin/pixmaps/emotes/small/16/angel.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/angry.png Binary file pidgin/pixmaps/emotes/small/16/angry.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/beer.png Binary file pidgin/pixmaps/emotes/small/16/beer.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/camera.png Binary file pidgin/pixmaps/emotes/small/16/camera.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/cigarette.png Binary file pidgin/pixmaps/emotes/small/16/cigarette.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/coffee.png Binary file pidgin/pixmaps/emotes/small/16/coffee.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/confused.png Binary file pidgin/pixmaps/emotes/small/16/confused.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/console.png Binary file pidgin/pixmaps/emotes/small/16/console.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/cool.png Binary file pidgin/pixmaps/emotes/small/16/cool.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/cross.png Binary file pidgin/pixmaps/emotes/small/16/cross.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/crying.png Binary file pidgin/pixmaps/emotes/small/16/crying.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/devil.png Binary file pidgin/pixmaps/emotes/small/16/devil.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/dont-know.png Binary file pidgin/pixmaps/emotes/small/16/dont-know.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/grin.png Binary file pidgin/pixmaps/emotes/small/16/grin.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/hug-left.png Binary file pidgin/pixmaps/emotes/small/16/hug-left.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/hug-right.png Binary file pidgin/pixmaps/emotes/small/16/hug-right.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/kiss.png Binary file pidgin/pixmaps/emotes/small/16/kiss.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/love.png Binary file pidgin/pixmaps/emotes/small/16/love.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/meeting.png Binary file pidgin/pixmaps/emotes/small/16/meeting.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/musical-note.png Binary file pidgin/pixmaps/emotes/small/16/musical-note.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/nerdy.png Binary file pidgin/pixmaps/emotes/small/16/nerdy.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/neutral.png Binary file pidgin/pixmaps/emotes/small/16/neutral.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/party.png Binary file pidgin/pixmaps/emotes/small/16/party.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/phone.png Binary file pidgin/pixmaps/emotes/small/16/phone.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/plate.png Binary file pidgin/pixmaps/emotes/small/16/plate.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/question.png Binary file pidgin/pixmaps/emotes/small/16/question.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/sad.png Binary file pidgin/pixmaps/emotes/small/16/sad.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/scalable/pidgin-emotes.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/emotes/small/16/scalable/pidgin-emotes.svg Mon Nov 17 06:15:33 2008 +0000 @@ -0,0 +1,6689 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/search.png Binary file pidgin/pixmaps/emotes/small/16/search.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/shame.png Binary file pidgin/pixmaps/emotes/small/16/shame.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/shock.png Binary file pidgin/pixmaps/emotes/small/16/shock.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/sick.png Binary file pidgin/pixmaps/emotes/small/16/sick.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/silent.png Binary file pidgin/pixmaps/emotes/small/16/silent.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/sleepy.png Binary file pidgin/pixmaps/emotes/small/16/sleepy.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/small.theme.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/emotes/small/16/small.theme.in Mon Nov 17 06:15:33 2008 +0000 @@ -0,0 +1,156 @@ +_Name=Small +_Description=Smaller versions of the default smilies +Icon=wink.png +Author=Hylke Bons + + +# Default smileys +[default] +smile.png :) :-) +smile-big.png :-D :-d :D :d +sad.png :-( :( +wink.png ;-) ;) +tongue.png :P :-P :-p :p +shock.png =-O =-o +kiss.png :-* +crying.png :'( +thinking.png :-/ :-\\ +angel.png O:-) o:-) + + +# Following AIM 6.1 +[AIM] +smile.png :-) :) +wink.png ;-) ;) +sad.png :-( :( +tongue.png :-P :P :-p :p +shock.png =-O +kiss.png :-* +smile-big.png :-D :D +angel.png O:-) +thinking.png :-\\ :-/ +crying.png :'( + + +# Following Windows Live Messenger 8.1 +[MSN] +smile.png :) :-) +smile-big.png :D :d :-D :-d +wink.png ;) ;-) +shock.png :-O :-o :O :o +tongue.png :P :p :-P :-p +angry.png :@ :-@ +confused.png :S :s :-S :-s +sad.png :( :-( +crying.png :'( +neutral.png :| :-| +devil.png (6) +angel.png (A) (a) +love.png (L) (l) +musical-note.png (8) +kiss.png (K) (k) +camera.png (P) (p) +coffee.png (C) (c) +phone.png (T) (t) +hug-left.png ({) +hug-right.png (}) +beer.png (B) (b) +sick.png +o( +plate.png (pl) +dont-know.png :^) +thinking.png *-) +party.png <:o) +yawn.png |-) + +# Hidden MSN emotes +cigarette.png (ci) (CI) +console.png (xx) (XX) + + +# Following QQ 2006 +[QQ] +shock.png /:O /jy /surprised +party.png /8-) /dy /revel +crying.png /:< /ll /cry +sleepy.png /:Z /shui /sleep +smile-big.png /:D /cy /toothy_smile +smile.png /:) /wx /small_smile +sad.png /:( /ng /sad +sick.png /:T /tu /vomit +yawn.png /|-) /kun /sleepy +question.png /? /yiw /question +search.png /find /zhao /search +hug-left.png /hug /yb /hug +musical-note.png /music /yy /music +coffee.png /coffee /kf /coffee +kiss.png /kiss /wen /kiss +love.png /heart /xin /heart +meeting.png /meeting /hy /meeting +phone.png /phone /dh /phone +tv.png /TV /ds /TV +angry.png / /oh /angry + + +# Following ICQ 6.0 +[ICQ] +smile.png :-) :) +neutral.png :-$ +sad.png :-( :( +shock.png =-O +wink.png ;-) ;) +tongue.png :-P :P :-p :p +sleepy.png *TIRED* +crying.png :'( :'-( +sick.png :-! +kiss.png :-{} :-* +devil.png ]:-> +angel.png O:-) +thinking.png :-\\ :-/ +beer.png *DRINK* +smile-big.png :-D :D + + +# Following Yahoo! Messenger 8.1 +[Yahoo] +smile.png :) :-) +question.png :-/ :-\\ +shock.png :-O :O :-o :o +devil.png >:) +angel.png O:-) o:-) 0:-) +sick.png :-& +yawn.png (:| +sad.png :( :-( +angry.png X-( x-( X( x( +crying.png :(( +wink.png ;) ;-) +thinking.png :-? +smile-big.png :D :-D :d :-d +tongue.png :-P :P :-p :p +neutral.png :| :-| +sleepy.png I-) i-) |-) +kiss.png :-* :* +confused.png :-S :-s +hug-left.png >:D< >:d< +party.png <:-P <:-p + +# Hidden Yahoo emotes +coffee.png ~o) ~O) +dont-know.png :-L :-l +shame.png [-X [-x +musical-note.png :-" + +# Only available after activating the Yahoo! Fighter IMVironment + + +# Following MySpaceIM Beta 1.0.697.0 +[MySpaceIM] +smile-big.png :D :-D +devil.png }:) +confused.png :Z +smile.png :) :-) +shock.png :O +neutral.png :| +tongue.png :P :p +wink.png ;-) ;) +sad.png :[ +kiss.png :x diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/smile-big.png Binary file pidgin/pixmaps/emotes/small/16/smile-big.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/smile.png Binary file pidgin/pixmaps/emotes/small/16/smile.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/thinking.png Binary file pidgin/pixmaps/emotes/small/16/thinking.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/tongue.png Binary file pidgin/pixmaps/emotes/small/16/tongue.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/tv.png Binary file pidgin/pixmaps/emotes/small/16/tv.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/uhm-yeah.png Binary file pidgin/pixmaps/emotes/small/16/uhm-yeah.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/wink.png Binary file pidgin/pixmaps/emotes/small/16/wink.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/pixmaps/emotes/small/16/yawn.png Binary file pidgin/pixmaps/emotes/small/16/yawn.png has changed diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/plugins/markerline.c --- a/pidgin/plugins/markerline.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/plugins/markerline.c Mon Nov 17 06:15:33 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", diff -r 45ce87f9a07f -r 6ecfc6b9667c pidgin/plugins/sendbutton.c --- a/pidgin/plugins/sendbutton.c Fri Oct 31 08:37:42 2008 +0000 +++ b/pidgin/plugins/sendbutton.c Mon Nov 17 06:15:33 2008 +0000 @@ -37,9 +37,26 @@ } static void +input_buffer_changed(GtkTextBuffer *text_buffer, GtkWidget *send_button) +{ + if (gtk_text_buffer_get_char_count(text_buffer) != 0) + gtk_widget_set_sensitive(send_button, TRUE); + else + gtk_widget_set_sensitive(send_button, FALSE); +} + +static void create_send_button_pidgin(PidginConversation *gtkconv) { GtkWidget *send_button; + GtkTextBuffer *buf; + guint signal_id; + + send_button = g_object_get_data(G_OBJECT(gtkconv->lower_hbox), + "send_button"); + + if (send_button != NULL) + return; send_button = gtk_button_new_with_mnemonic(_("_Send")); g_signal_connect(G_OBJECT(send_button), "clicked", @@ -48,6 +65,16 @@ FALSE, 0); gtk_widget_show(send_button); + buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); + if (buf) { + signal_id = g_signal_connect(G_OBJECT(buf), "changed", + G_CALLBACK(input_buffer_changed), + send_button); + g_object_set_data(G_OBJECT(send_button), "buffer-signal", + GINT_TO_POINTER(signal_id)); + input_buffer_changed(buf, send_button); + } + g_object_set_data(G_OBJECT(gtkconv->lower_hbox), "send_button", send_button); } @@ -60,7 +87,18 @@ send_button = g_object_get_data(G_OBJECT(gtkconv->lower_hbox), "send_button"); if (send_button != NULL) { + GtkTextBuffer *buf; + guint signal_id; + + buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); + signal_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(send_button), + "buffer-signal")); + if (buf && signal_id) + g_signal_handler_disconnect(G_OBJECT(buf), signal_id); + gtk_widget_destroy(send_button); + g_object_set_data(G_OBJECT(gtkconv->lower_hbox), + "send_button", NULL); } } diff -r 45ce87f9a07f -r 6ecfc6b9667c po/POTFILES.in --- a/po/POTFILES.in Fri Oct 31 08:37:42 2008 +0000 +++ b/po/POTFILES.in Mon Nov 17 06:15:33 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,11 +215,11 @@ 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 pidgin/pixmaps/emotes/none/none.theme.in +pidgin/pixmaps/emotes/small/16/small.theme.in pidgin/plugins/cap/cap.c pidgin/plugins/contact_priority.c pidgin/plugins/convcolors.c