Mercurial > pidgin.yaz
changeset 27905:45ce87f9a07f
propagate from branch 'im.pidgin.pidgin' (head 7821a3549d7d99473e999dc067afc4218addcc1e)
to branch 'im.pidgin.pidgin.yaz' (head a23f8b0bf428af45a81e2d1baa0305cca0ad2a59)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 31 Oct 2008 08:37:42 +0000 |
parents | 18711b62ec27 (diff) b5e2be33a17a (current diff) |
children | 6ecfc6b9667c |
files | autogen.sh configure.ac libpurple/notify.c pidgin/gtkblist.c pidgin/gtkconv.c pidgin/gtkimhtml.c pidgin/gtkprefs.c pidgin/gtkutils.c pidgin/gtkutils.h |
diffstat | 49 files changed, 466 insertions(+), 192 deletions(-) [+] |
line wrap: on
line diff
--- a/.mtn-ignore Wed Oct 29 05:24:28 2008 +0000 +++ b/.mtn-ignore Fri Oct 31 08:37:42 2008 +0000 @@ -13,6 +13,7 @@ intltool-.* Doxyfile(\.mingw)?$ aclocal.m4 +autogen.args compile config.cache config.guess
--- a/COPYRIGHT Wed Oct 29 05:24:28 2008 +0000 +++ b/COPYRIGHT Fri Oct 31 08:37:42 2008 +0000 @@ -305,6 +305,7 @@ Ted Percival Eduardo PĆ©rez Matt Perry +Diego Pettenņ Nathan Peterson SebastiĆ”n E. Peyrott Celso Pinto
--- a/ChangeLog Wed Oct 29 05:24:28 2008 +0000 +++ b/ChangeLog Fri Oct 31 08:37:42 2008 +0000 @@ -8,6 +8,20 @@ --with-system-ssl-certs and GnuTLS need to include these in the system certs directory. + Pidgin: + * On GTK+ 2.14 and higher, we're using the gtk-tooltip-delay setting + instead of our own (hidden) tooltip_delay pref. If you had + previously changed that pref, add a line like this to + ~/.purple/gtkrc-2.0 (where 500 is the timeout (in ms) you want): + gtk-tooltip-timeout = 500 + To completely disable tooltips (e.g. if you had an old tooltip_delay + of zero), add this to ~/.purple/gtkrc-2.0: + gtk-enable-tooltips = 0 + + Finch: + * Allow binding meta+arrow keys for actions. + + version 2.5.2 (10/19/2008): libpurple: * Fixed a crash on removing a custom buddy icon on a buddy.
--- a/autogen.sh Wed Oct 29 05:24:28 2008 +0000 +++ b/autogen.sh Fri Oct 31 08:37:42 2008 +0000 @@ -37,7 +37,7 @@ # INTLTOOLIZE_FLAGS - command line arguments to pass to intltoolize # LIBTOOLIZE_FLAGS - command line arguments to pass to libtoolize # -# Other helpfull notes: +# Other helpful notes: # If you're using a different c compiler, you can override the environment # variable in 'autogen.args'. For example, say you're using distcc, just add # the following to 'autogen.args': @@ -48,6 +48,8 @@ ############################################################################### PACKAGE="Pidgin" ARGS_FILE="autogen.args" +export CFLAGS +export LDFLAGS libtoolize="libtoolize" case $(uname -s) in @@ -115,7 +117,7 @@ if [ -f ${ARGS_FILE} ] ; then echo "found." printf "%s" "sourcing ${ARGS_FILE}: " - . ${ARGS_FILE} + . "`dirname "$0"`"/${ARGS_FILE} echo "done." else echo "not found." @@ -125,8 +127,8 @@ # Check for our required helpers ############################################################################### check "$libtoolize"; LIBTOOLIZE=${BIN}; -check "glib-gettextize"; GLIB_GETTEXTIZE=${BIN}; -check "intltoolize"; INTLTOOLIZE=${BIN}; +check "glib-gettextize"; GLIB_GETTEXTIZE=${BIN}; +check "intltoolize"; INTLTOOLIZE=${BIN}; check "aclocal"; ACLOCAL=${BIN}; check "autoheader"; AUTOHEADER=${BIN}; check "automake"; AUTOMAKE=${BIN};
--- a/configure.ac Wed Oct 29 05:24:28 2008 +0000 +++ b/configure.ac Fri Oct 31 08:37:42 2008 +0000 @@ -1143,6 +1143,7 @@ AC_ARG_ENABLE(fortify, [AC_HELP_STRING([--disable-fortify], [compile without FORTIFY_SOURCE support])], , enable_fortify=yes) +DEBUG_CFLAGS="$DEBUG_CFLAGS -DPURPLE_DISABLE_DEPRECATED -DPIDGIN_DISABLE_DEPRECATED -DFINCH_DISABLE_DEPRECATED -DGNT_DISABLE_DEPRECATED" if test "x$GCC" = "xyes"; then dnl We enable -Wall later. dnl If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags.
--- a/finch/libgnt/gntkeys.c Wed Oct 29 05:24:28 2008 +0000 +++ b/finch/libgnt/gntkeys.c Fri Oct 31 08:37:42 2008 +0000 @@ -102,7 +102,12 @@ #define INSERT_COMB(k, code) do { \ snprintf(key, sizeof(key), "%s%s%s", controls[c], alts[a], k); \ INSERT_KEY(key, code); \ - } while (0); + } while (0) +#define INSERT_COMB_CODE(k, c1, c2) do { \ + char __[32]; \ + snprintf(__, sizeof(__), "%s%s", c1, c2); \ + INSERT_COMB(k, __); \ + } while (0) /* Lower-case alphabets */ for (a = 0, c = 0; controls[c]; c++, a = 0) { @@ -124,6 +129,10 @@ } if (c == 0) { INSERT_COMB("tab", "\033\t"); + INSERT_COMB_CODE("up", "\033", GNT_KEY_UP); + INSERT_COMB_CODE("down", "\033", GNT_KEY_DOWN); + INSERT_COMB_CODE("left", "\033", GNT_KEY_LEFT); + INSERT_COMB_CODE("right", "\033", GNT_KEY_RIGHT); } } } @@ -144,6 +153,8 @@ void gnt_keys_refine(char *text) { + while (*text == 27 && *(text + 1) == 27) + text++; if (*text == 27 && *(text + 1) == '[' && (*(text + 2) >= 'A' && *(text + 2) <= 'D')) { /* Apparently this is necessary for urxvt and screen and xterm */
--- a/libpurple/account.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/account.c Fri Oct 31 08:37:42 2008 +0000 @@ -1035,7 +1035,7 @@ purple_debug_info("account", "Registering account %s\n", purple_account_get_username(account)); - purple_connection_new(account, TRUE, purple_account_get_password(account)); + _purple_connection_new(account, TRUE, purple_account_get_password(account)); } void @@ -1046,7 +1046,7 @@ purple_debug_info("account", "Unregistering account %s\n", purple_account_get_username(account)); - purple_connection_new_unregister(account, purple_account_get_password(account), cb, user_data); + _purple_connection_new_unregister(account, purple_account_get_password(account), cb, user_data); } static void @@ -1069,7 +1069,7 @@ purple_account_set_password(account, entry); - purple_connection_new(account, FALSE, entry); + _purple_connection_new(account, FALSE, entry); } static void @@ -1155,7 +1155,7 @@ !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) purple_account_request_password(account, G_CALLBACK(request_password_ok_cb), G_CALLBACK(request_password_cancel_cb), account); else - purple_connection_new(account, FALSE, password); + _purple_connection_new(account, FALSE, password); } void @@ -1171,7 +1171,7 @@ account->disconnecting = TRUE; gc = purple_account_get_connection(account); - purple_connection_destroy(gc); + _purple_connection_destroy(gc); if (!purple_account_get_remember_password(account)) purple_account_set_password(account, NULL); purple_account_set_connection(account, NULL);
--- a/libpurple/blist.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/blist.c Fri Oct 31 08:37:42 2008 +0000 @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA * */ +#define _PURPLE_BLIST_C_ + #include "internal.h" #include "blist.h" #include "conversation.h" @@ -41,7 +43,6 @@ static guint save_timer = 0; static gboolean blist_loaded = FALSE; - /********************************************************************* * Private utility functions * *********************************************************************/ @@ -446,7 +447,7 @@ purple_blist_get_last_child((PurpleBlistNode*)group)); if ((alias = xmlnode_get_attrib(cnode, "alias"))) { - purple_contact_set_alias(contact, alias); + purple_blist_alias_contact(contact, alias); } for (x = cnode->child; x; x = x->next) { @@ -835,13 +836,11 @@ ops->update(purplebuddylist, node); } -#ifndef PURPLE_DISABLE_DEPRECATED void purple_blist_update_buddy_icon(PurpleBuddy *buddy) { purple_blist_update_node_icon((PurpleBlistNode *)buddy); } -#endif /* * TODO: Maybe remove the call to this from server.c and call it
--- a/libpurple/blist.h Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/blist.h Fri Oct 31 08:37:42 2008 +0000 @@ -75,11 +75,11 @@ } PurpleBlistNodeFlags; -#define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (((PurpleBlistNode*)(b))->flags & (f)) +#define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (purple_blist_node_get_flags((PurpleBlistNode*)(b)) & (f)) #define PURPLE_BLIST_NODE_SHOULD_SAVE(b) (! PURPLE_BLIST_NODE_HAS_FLAG(b, PURPLE_BLIST_NODE_FLAG_NO_SAVE)) -#define PURPLE_BLIST_NODE_NAME(n) ((n)->type == PURPLE_BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \ - (n)->type == PURPLE_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL) +#define PURPLE_BLIST_NODE_NAME(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \ + purple_blist_node_get_type(n) == PURPLE_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL) #include "account.h" #include "buddyicon.h" @@ -89,6 +89,8 @@ /* Data Structures */ /**************************************************************************/ +#if !(defined PURPLE_HIDE_STRUCTS) || (defined _PURPLE_BLIST_C_) + /** * A Buddy list node. This can represent a group, a buddy, or anything else. * This is a base class for struct buddy and struct group and for anything @@ -154,6 +156,8 @@ PurpleAccount *account; /**< The account this chat is attached to */ }; +#endif /* PURPLE_HIDE_STRUCTS && PURPLE_BLIST_STRUCTS */ + /** * The Buddy List @@ -331,7 +335,7 @@ */ void purple_blist_update_node_icon(PurpleBlistNode *node); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_) /** * Updates a buddy's icon. * @@ -557,7 +561,7 @@ */ PurpleBuddy *purple_contact_get_priority_buddy(PurpleContact *contact); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_) /** * Sets the alias for a contact. *
--- a/libpurple/buddyicon.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/buddyicon.c Fri Oct 31 08:37:42 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PURPLE_BUDDYICON_C_ + #include "internal.h" #include "buddyicon.h" #include "conversation.h" @@ -954,7 +956,6 @@ return purple_buddy_icons_node_set_custom_icon(node, data, len); } -#ifndef PURPLE_DISABLE_DEPRECATED gboolean purple_buddy_icons_has_custom_icon(PurpleContact *contact) { @@ -973,7 +974,6 @@ { return purple_buddy_icons_node_set_custom_icon((PurpleBlistNode*)contact, icon_data, icon_len); } -#endif void _purple_buddy_icon_set_old_icons_dir(const char *dirname)
--- a/libpurple/buddyicon.h Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/buddyicon.h Fri Oct 31 08:37:42 2008 +0000 @@ -337,7 +337,7 @@ purple_buddy_icons_node_set_custom_icon_from_file(PurpleBlistNode *node, const gchar *filename); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BUDDYICON_C_) /** * PurpleContact version of purple_buddy_icons_node_has_custom_icon. *
--- a/libpurple/connection.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/connection.c Fri Oct 31 08:37:42 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PURPLE_CONNECTION_C_ + #include "internal.h" #include "account.h" #include "blist.h" @@ -99,6 +101,12 @@ void purple_connection_new(PurpleAccount *account, gboolean regist, const char *password) { + _purple_connection_new(account, regist, password); +} + +void +_purple_connection_new(PurpleAccount *account, gboolean regist, const char *password) +{ PurpleConnection *gc; PurplePlugin *prpl; PurplePluginProtocolInfo *prpl_info; @@ -170,9 +178,14 @@ prpl_info->login(account); } } +void +purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data) +{ + _purple_connection_new_unregister(account, password, cb, user_data); +} void -purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data) +_purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data) { /* Lots of copy/pasted code to avoid API changes. You might want to integrate that into the previous function when posssible. */ PurpleConnection *gc; @@ -230,6 +243,12 @@ void purple_connection_destroy(PurpleConnection *gc) { + _purple_connection_destroy(gc); +} + +void +_purple_connection_destroy(PurpleConnection *gc) +{ PurpleAccount *account; GSList *buddies; PurplePluginProtocolInfo *prpl_info = NULL;
--- a/libpurple/connection.h Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/connection.h Fri Oct 31 08:37:42 2008 +0000 @@ -268,7 +268,7 @@ /**************************************************************************/ /*@{*/ -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_) /** * This function should only be called by purple_account_connect() * in account.c. If you're trying to sign on an account, use that @@ -292,7 +292,7 @@ const char *password); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_) /** * This function should only be called by purple_account_unregister() * in account.c. @@ -310,7 +310,7 @@ void purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_) /** * Disconnects and destroys a PurpleConnection. *
--- a/libpurple/dbus-server.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/dbus-server.c Fri Oct 31 08:37:42 2008 +0000 @@ -29,6 +29,10 @@ #include <stdlib.h> #include <string.h> +/* Allow the code below to see deprecated functions, so we can continue to + * export them via DBus. */ +#undef PURPLE_DISABLE_DEPRECATED + #include "account.h" #include "blist.h" #include "conversation.h"
--- a/libpurple/internal.h Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/internal.h Fri Oct 31 08:37:42 2008 +0000 @@ -231,6 +231,12 @@ #define PURPLE_WEBSITE "http://pidgin.im/" #define PURPLE_DEVEL_WEBSITE "http://developer.pidgin.im/" + +/* INTERNAL FUNCTIONS */ + +#include "account.h" +#include "connection.h" + /* This is for the accounts code to notify the buddy icon code that * it's done loading. We may want to replace this with a signal. */ void @@ -247,4 +253,48 @@ void _purple_buddy_icon_set_old_icons_dir(const char *dirname); +/** + * Creates a connection to the specified account and either connects + * or attempts to register a new account. If you are logging in, + * the connection uses the current active status for this account. + * So if you want to sign on as "away," for example, you need to + * have called purple_account_set_status(account, "away"). + * (And this will call purple_account_connect() automatically). + * + * @note This function should only be called by purple_account_connect() + * in account.c. If you're trying to sign on an account, use that + * function instead. + * + * @param account The account the connection should be connecting to. + * @param regist Whether we are registering a new account or just + * trying to do a normal signon. + * @param password The password to use. + */ +void _purple_connection_new(PurpleAccount *account, gboolean regist, + const char *password); +/** + * Tries to unregister the account on the server. If the account is not + * connected, also creates a new connection. + * + * @note This function should only be called by purple_account_unregister() + * in account.c. + * + * @param account The account to unregister + * @param password The password to use. + * @param cb Optional callback to be called when unregistration is complete + * @param user_data user data to pass to the callback + */ +void _purple_connection_new_unregister(PurpleAccount *account, const char *password, + PurpleAccountUnregistrationCb cb, void *user_data); +/** + * Disconnects and destroys a PurpleConnection. + * + * @note This function should only be called by purple_account_disconnect() + * in account.c. If you're trying to sign off an account, use that + * function instead. + * + * @param gc The purple connection to destroy. + */ +void _purple_connection_destroy(PurpleConnection *gc); + #endif /* _PURPLE_INTERNAL_H_ */
--- a/libpurple/network.h Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/network.h Fri Oct 31 08:37:42 2008 +0000 @@ -106,7 +106,6 @@ */ const char *purple_network_get_my_ip(int fd); -#ifndef PURPLE_DISABLE_DEPRECATED /** * Should calls to purple_network_listen() and purple_network_listen_range() * map the port externally using NAT-PMP or UPnP? @@ -118,7 +117,6 @@ * @since 2.3.0 */ void purple_network_listen_map_external(gboolean map_external); -#endif /** * Attempts to open a listening port ONLY on the specified port number. @@ -203,11 +201,9 @@ unsigned short purple_network_get_port_from_fd(int fd); /** - * Detects if there is an available Internet connection. Note that this call - * could block for the amount of time specified in inet_detect_timeout, so - * using it in a UI thread may cause uncomfortableness + * Detects if there is an available network connection. * - * @return TRUE if the Internet is available + * @return TRUE if the network is available */ gboolean purple_network_is_available(void);
--- a/libpurple/notify.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/notify.c Fri Oct 31 08:37:42 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PURPLE_NOTIFY_C_ + #include "internal.h" #include "dbus-maybe.h" #include "notify.h"
--- a/libpurple/notify.h Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/notify.h Fri Oct 31 08:37:42 2008 +0000 @@ -289,7 +289,7 @@ */ void purple_notify_searchresults_row_add(PurpleNotifySearchResults *results, GList *row); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_) /** * Returns a number of the rows in the search results object. * @@ -310,7 +310,7 @@ guint purple_notify_searchresults_get_rows_count(PurpleNotifySearchResults *results); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_) /** * Returns a number of the columns in the search results object. * @@ -331,7 +331,7 @@ guint purple_notify_searchresults_get_columns_count(PurpleNotifySearchResults *results); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_) /** * Returns a row of the results from the search results object. * @@ -354,7 +354,7 @@ unsigned int row_id); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_) /** * Returns a title of the search results object's column. *
--- a/libpurple/plugin.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/plugin.c Fri Oct 31 08:37:42 2008 +0000 @@ -19,6 +19,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PURPLE_PLUGIN_C_ + #include "internal.h" #include "accountopt.h"
--- a/libpurple/plugin.h Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/plugin.h Fri Oct 31 08:37:42 2008 +0000 @@ -533,7 +533,7 @@ */ gboolean purple_plugins_enabled(void); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Registers a function that will be called when probing is finished. * @@ -544,7 +544,7 @@ void purple_plugins_register_probe_notify_cb(void (*func)(void *), void *data); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Unregisters a function that would be called when probing is finished. * @@ -554,7 +554,7 @@ void purple_plugins_unregister_probe_notify_cb(void (*func)(void *)); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Registers a function that will be called when a plugin is loaded. * @@ -566,7 +566,7 @@ void *data); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Unregisters a function that would be called when a plugin is loaded. * @@ -576,7 +576,7 @@ void purple_plugins_unregister_load_notify_cb(void (*func)(PurplePlugin *, void *)); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Registers a function that will be called when a plugin is unloaded. * @@ -588,7 +588,7 @@ void *data); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) /** * Unregisters a function that would be called when a plugin is unloaded. *
--- a/libpurple/plugins/autoaccept.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/plugins/autoaccept.c Fri Oct 31 08:37:42 2008 +0000 @@ -104,7 +104,7 @@ return; } - node = node->parent; + node = purple_blist_node_get_parent(node); g_return_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(node)); pref = purple_prefs_get_string(PREF_PATH); @@ -179,7 +179,7 @@ save_cb(PurpleBlistNode *node, int choice) { if (PURPLE_BLIST_NODE_IS_BUDDY(node)) - node = node->parent; + node = purple_blist_node_get_parent(node); g_return_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(node)); purple_blist_node_set_int(node, "autoaccept", choice); } @@ -190,7 +190,7 @@ char *message; if (PURPLE_BLIST_NODE_IS_BUDDY(node)) - node = node->parent; + node = purple_blist_node_get_parent(node); g_return_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(node)); message = g_strdup_printf(_("When a file-transfer request arrives from %s"),
--- a/libpurple/plugins/log_reader.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/plugins/log_reader.c Fri Oct 31 08:37:42 2008 +0000 @@ -661,8 +661,10 @@ username = g_strdup(purple_normalize(account, account->username)); } - if (buddy) - savedfilename = purple_blist_node_get_string(&buddy->node, "log_reader_msn_log_filename"); + if (buddy) { + savedfilename = purple_blist_node_get_string((PurpleBlistNode *)buddy, + "log_reader_msn_log_filename"); + } if (savedfilename) { /* As a special case, we allow the null string to kill the parsing @@ -822,7 +824,8 @@ * detected for both buddies. */ if (buddy && logfile) { - purple_blist_node_set_string(&buddy->node, "log_reader_msn_log_filename", logfile); + PurpleBlistNode *node = (PurpleBlistNode *)buddy; + purple_blist_node_set_string(node, "log_reader_msn_log_filename", logfile); g_free(logfile); } @@ -981,8 +984,8 @@ gboolean from_name_matches; gboolean to_name_matches; - if (buddy && buddy->alias) - their_name = buddy->alias; + if (buddy) + their_name = purple_buddy_get_alias(buddy); if (log->account->alias) { @@ -1018,13 +1021,14 @@ } else if (to_name_matches) { name_guessed = NAME_GUESS_THEM; } else { - if (buddy && buddy->alias) { - char *alias = g_strdup(buddy->alias); + if (buddy) { + const char *server_alias = NULL; + char *alias = g_strdup(purple_buddy_get_alias(buddy)); + char *temp; /* "Truncate" the string at the first non-alphanumeric * character. The idea is to relax the comparison. */ - char *temp; for (temp = alias; *temp ; temp++) { if (!isalnum(*temp)) { *temp = '\0'; @@ -1056,9 +1060,9 @@ } } else if (to_name_matches) { name_guessed = NAME_GUESS_ME; - } else if (buddy->server_alias) { + } else if ((server_alias = purple_buddy_get_server_alias(buddy))) { friendly_name_length = - strlen(buddy->server_alias); + strlen(server_alias); /* Try to guess which user is them. * The first step is to determine if either of @@ -1068,13 +1072,13 @@ */ from_name_matches = (purple_str_has_prefix( from_name, - buddy->server_alias) && + server_alias) && !isalnum(*(from_name + friendly_name_length))); to_name_matches = to_name && ( (purple_str_has_prefix( - to_name, buddy->server_alias) && + to_name, server_alias) && !isalnum(*(to_name + friendly_name_length)))); @@ -1565,18 +1569,30 @@ g_string_append(formatted, "</b>"); footer = NULL; } else if (strstr(line, " signed off ")) { - if (buddy != NULL && buddy->alias) + const char *alias = NULL; + + if (buddy != NULL) + alias = purple_buddy_get_alias(buddy); + + if (alias != NULL) { g_string_append_printf(formatted, - _("%s has signed off."), buddy->alias); - else + _("%s has signed off."), alias); + } else { g_string_append_printf(formatted, _("%s has signed off."), log->name); + } line = ""; } else if (strstr(line, " signed on ")) { - if (buddy != NULL && buddy->alias) - g_string_append(formatted, buddy->alias); + const char *alias = NULL; + + if (buddy != NULL) + alias = purple_buddy_get_alias(buddy); + + if (alias != NULL) + g_string_append(formatted, alias); else g_string_append(formatted, log->name); + line = " logged in."; } else if (purple_str_has_prefix(line, "One or more messages may have been undeliverable.")) { @@ -1631,11 +1647,15 @@ footer = "</span></b>"; } } else if (purple_str_has_prefix(line, data->their_nickname)) { - if (buddy != NULL && buddy->alias) { - line += strlen(data->their_nickname) + 2; - g_string_append_printf(formatted, - "<span style=\"color: #A82F2F;\">" - "<b>%s</b></span>: ", buddy->alias); + if (buddy != NULL) { + const char *alias = purple_buddy_get_alias(buddy); + + if (alias != NULL) { + line += strlen(data->their_nickname) + 2; + g_string_append_printf(formatted, + "<span style=\"color: #A82F2F;\">" + "<b>%s</b></span>: ", alias); + } } } else { const char *line2 = strstr(line, ":"); @@ -2001,10 +2021,14 @@ g_string_append(formatted, "</font> "); if (is_in_message) { - if (buddy_name != NULL && buddy != NULL && buddy->alias) { + const char *alias = NULL; + + if (buddy_name != NULL && buddy != NULL && + (alias = purple_buddy_get_alias(buddy))) + { g_string_append_printf(formatted, "<span style=\"color: #A82F2F;\">" - "<b>%s</b></span>: ", buddy->alias); + "<b>%s</b></span>: ", alias); } } else { const char *acct_name;
--- a/libpurple/plugins/perl/common/BuddyList.xs Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/plugins/perl/common/BuddyList.xs Fri Oct 31 08:37:42 2008 +0000 @@ -1,3 +1,4 @@ +#undef PURPLE_DISABLE_DEPRECATED #include "module.h" #include "../perl-handlers.h"
--- a/libpurple/plugins/perl/common/module.h Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/plugins/perl/common/module.h Fri Oct 31 08:37:42 2008 +0000 @@ -1,4 +1,6 @@ - +/* Allow the Perl code to see deprecated functions, so we can continue to + * export them to Perl plugins. */ +#undef PURPLE_DISABLE_DEPRECATED typedef struct group *Purple__Group;
--- a/libpurple/plugins/signals-test.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/plugins/signals-test.c Fri Oct 31 08:37:42 2008 +0000 @@ -116,8 +116,9 @@ PurpleStatus *status, void *data) { purple_debug_misc("signals test", "buddy-status-changed (%s %s to %s)\n", - buddy->name, purple_status_get_id(old_status), - purple_status_get_id(status)); + purple_buddy_get_name(buddy), + purple_status_get_id(old_status), + purple_status_get_id(status)); } static void @@ -125,25 +126,29 @@ void *data) { purple_debug_misc("signals test", "buddy-idle-changed (%s %s)\n", - buddy->name, old_idle ? "unidled" : "idled"); + purple_buddy_get_name(buddy), + old_idle ? "unidled" : "idled"); } static void buddy_signed_on_cb(PurpleBuddy *buddy, void *data) { - purple_debug_misc("signals test", "buddy-signed-on (%s)\n", buddy->name); + purple_debug_misc("signals test", "buddy-signed-on (%s)\n", + purple_buddy_get_name(buddy)); } static void buddy_signed_off_cb(PurpleBuddy *buddy, void *data) { - purple_debug_misc("signals test", "buddy-signed-off (%s)\n", buddy->name); + purple_debug_misc("signals test", "buddy-signed-off (%s)\n", + purple_buddy_get_name(buddy)); } static void buddy_added_cb(PurpleBuddy *buddy, void *data) { - purple_debug_misc("signals test", "buddy_added_cb (%s)\n", purple_buddy_get_name(buddy)); + purple_debug_misc("signals test", "buddy_added_cb (%s)\n", + purple_buddy_get_name(buddy)); } static void @@ -160,17 +165,27 @@ PurpleChat *c = (PurpleChat *)node; PurpleGroup *g = (PurpleGroup *)node; - if (PURPLE_BLIST_NODE_IS_CONTACT(node)) - purple_debug_misc("signals test", "blist-node-aliased (Contact: %s, %s)\n", p->alias, old_alias); - else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) - purple_debug_misc("signals test", "blist-node-aliased (Buddy: %s, %s)\n", b->name, old_alias); - else if (PURPLE_BLIST_NODE_IS_CHAT(node)) - purple_debug_misc("signals test", "blist-node-aliased (Chat: %s, %s)\n", c->alias, old_alias); - else if (PURPLE_BLIST_NODE_IS_GROUP(node)) - purple_debug_misc("signals test", "blist-node-aliased (Group: %s, %s)\n", g->name, old_alias); - else - purple_debug_misc("signals test", "blist-node-aliased (UNKNOWN: %d, %s)\n", node->type, old_alias); - + if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { + purple_debug_misc("signals test", + "blist-node-aliased (Contact: %s, %s)\n", + purple_contact_get_alias(p), old_alias); + } else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { + purple_debug_misc("signals test", + "blist-node-aliased (Buddy: %s, %s)\n", + purple_buddy_get_name(b), old_alias); + } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { + purple_debug_misc("signals test", + "blist-node-aliased (Chat: %s, %s)\n", + purple_chat_get_name(c), old_alias); + } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { + purple_debug_misc("signals test", + "blist-node-aliased (Group: %s, %s)\n", + purple_group_get_name(g), old_alias); + } else { + purple_debug_misc("signals test", + "blist-node-aliased (UNKNOWN: %d, %s)\n", + purple_blist_node_get_type(node), old_alias); + } } static void @@ -181,17 +196,27 @@ PurpleChat *c = (PurpleChat *)node; PurpleGroup *g = (PurpleGroup *)node; - if (PURPLE_BLIST_NODE_IS_CONTACT(node)) - purple_debug_misc("signals test", "blist-node-extended-menu (Contact: %s)\n", p->alias); - else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) - purple_debug_misc("signals test", "blist-node-extended-menu (Buddy: %s)\n", b->name); - else if (PURPLE_BLIST_NODE_IS_CHAT(node)) - purple_debug_misc("signals test", "blist-node-extended-menu (Chat: %s)\n", c->alias); - else if (PURPLE_BLIST_NODE_IS_GROUP(node)) - purple_debug_misc("signals test", "blist-node-extended-menu (Group: %s)\n", g->name); - else - purple_debug_misc("signals test", "blist-node-extended-menu (UNKNOWN: %d)\n", node->type); - + if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { + purple_debug_misc("signals test", + "blist-node-extended-menu (Contact: %s)\n", + purple_contact_get_alias(p)); + } else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { + purple_debug_misc("signals test", + "blist-node-extended-menu (Buddy: %s)\n", + purple_buddy_get_name(b)); + } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { + purple_debug_misc("signals test", + "blist-node-extended-menu (Chat: %s)\n", + purple_chat_get_name(c)); + } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { + purple_debug_misc("signals test", + "blist-node-extended-menu (Group: %s)\n", + purple_group_get_name(g)); + } else { + purple_debug_misc("signals test", + "blist-node-extended-menu (UNKNOWN: %d)\n", + purple_blist_node_get_type(node)); + } }
--- a/libpurple/plugins/statenotify.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/plugins/statenotify.c Fri Oct 31 08:37:42 2008 +0000 @@ -15,13 +15,18 @@ static void write_status(PurpleBuddy *buddy, const char *message) { + PurpleAccount *account = NULL; PurpleConversation *conv; const char *who; char buf[256]; char *escaped; + const gchar *buddy_name = NULL; + + account = purple_buddy_get_account(buddy); + buddy_name = purple_buddy_get_name(buddy); conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, - buddy->name, buddy->account); + buddy_name, account); if (conv == NULL) return;
--- a/libpurple/plugins/tcl/tcl_cmds.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/plugins/tcl/tcl_cmds.c Fri Oct 31 08:37:42 2008 +0000 @@ -414,7 +414,7 @@ Tcl_Obj *list, *tclgroup, *tclgrouplist, *tclcontact, *tclcontactlist, *tclbud, **elems, *result; const char *cmds[] = { "alias", "handle", "info", "list", NULL }; enum { CMD_BUDDY_ALIAS, CMD_BUDDY_HANDLE, CMD_BUDDY_INFO, CMD_BUDDY_LIST } cmd; - PurpleBuddyList *blist; + PurpleBlistNodeType type; PurpleBlistNode *node, *gnode, *bnode; PurpleAccount *account; PurpleBuddy *bud; @@ -438,10 +438,11 @@ return error; if ((node = tcl_list_to_buddy(interp, count, elems)) == NULL) return TCL_ERROR; - if (node->type == PURPLE_BLIST_CHAT_NODE) + type = purple_blist_node_get_type(node); + if (type == PURPLE_BLIST_CHAT_NODE) Tcl_SetObjResult(interp, - Tcl_NewStringObj(((PurpleChat *)node)->alias, -1)); - else if (node->type == PURPLE_BLIST_BUDDY_NODE) + Tcl_NewStringObj(purple_chat_get_name((PurpleChat *)node), -1)); + else if (type == PURPLE_BLIST_BUDDY_NODE) Tcl_SetObjResult(interp, Tcl_NewStringObj((char *)purple_buddy_get_alias((PurpleBuddy *)node), -1)); return TCL_OK; @@ -494,15 +495,17 @@ } } list = Tcl_NewListObj(0, NULL); - blist = purple_get_blist(); - for (gnode = blist->root; gnode != NULL; gnode = gnode->next) { + for (gnode = purple_blist_get_root(); gnode != NULL; gnode = purple_blist_node_get_sibling_next(gnode)) { tclgroup = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(interp, tclgroup, Tcl_NewStringObj("group", -1)); Tcl_ListObjAppendElement(interp, tclgroup, - Tcl_NewStringObj(((PurpleGroup *)gnode)->name, -1)); + Tcl_NewStringObj(purple_group_get_name((PurpleGroup *)gnode), -1)); tclgrouplist = Tcl_NewListObj(0, NULL); - for (node = gnode->child; node != NULL; node = node->next) { - switch (node->type) { + for (node = purple_blist_node_get_first_child(gnode); node != NULL; node = purple_blist_node_get_sibling_next(node)) { + PurpleAccount *account; + + type = purple_blist_node_get_type(node); + switch (type) { case PURPLE_BLIST_CONTACT_NODE: tclcontact = Tcl_NewListObj(0, NULL); Tcl_IncrRefCount(tclcontact); @@ -510,17 +513,18 @@ tclcontactlist = Tcl_NewListObj(0, NULL); Tcl_IncrRefCount(tclcontactlist); count = 0; - for (bnode = node->child; bnode != NULL; bnode = bnode ->next) { - if (bnode->type != PURPLE_BLIST_BUDDY_NODE) + for (bnode = purple_blist_node_get_first_child(node); bnode != NULL; bnode = purple_blist_node_get_sibling_next(bnode)) { + if (purple_blist_node_get_type(bnode) != PURPLE_BLIST_BUDDY_NODE) continue; bud = (PurpleBuddy *)bnode; - if (!all && !purple_account_is_connected(bud->account)) + account = purple_buddy_get_account(bud); + if (!all && !purple_account_is_connected(account)) continue; count++; tclbud = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj("buddy", -1)); - Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj(bud->name, -1)); - Tcl_ListObjAppendElement(interp, tclbud, purple_tcl_ref_new(PurpleTclRefAccount, bud->account)); + Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj(purple_buddy_get_name(bud), -1)); + Tcl_ListObjAppendElement(interp, tclbud, purple_tcl_ref_new(PurpleTclRefAccount, account)); Tcl_ListObjAppendElement(interp, tclcontactlist, tclbud); } if (count) { @@ -532,16 +536,17 @@ break; case PURPLE_BLIST_CHAT_NODE: cnode = (PurpleChat *)node; - if (!all && !purple_account_is_connected(cnode->account)) + account = purple_chat_get_account(cnode); + if (!all && !purple_account_is_connected(account)) continue; tclbud = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj("chat", -1)); - Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj(cnode->alias, -1)); - Tcl_ListObjAppendElement(interp, tclbud, purple_tcl_ref_new(PurpleTclRefAccount, cnode->account)); + Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj(purple_chat_get_name(cnode), -1)); + Tcl_ListObjAppendElement(interp, tclbud, purple_tcl_ref_new(PurpleTclRefAccount, account)); Tcl_ListObjAppendElement(interp, tclgrouplist, tclbud); break; default: - purple_debug(PURPLE_DEBUG_WARNING, "tcl", "Unexpected buddy type %d", node->type); + purple_debug(PURPLE_DEBUG_WARNING, "tcl", "Unexpected buddy type %d", type); continue; } }
--- a/libpurple/plugins/tcl/tcl_signals.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/plugins/tcl/tcl_signals.c Fri Oct 31 08:37:42 2008 +0000 @@ -292,13 +292,13 @@ node = *va_arg(args, PurpleBlistNode **); else node = va_arg(args, PurpleBlistNode *); - switch (node->type) { + switch (purple_blist_node_get_type(node)) { case PURPLE_BLIST_GROUP_NODE: arg = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(handler->interp, arg, Tcl_NewStringObj("group", -1)); Tcl_ListObjAppendElement(handler->interp, arg, - Tcl_NewStringObj(((PurpleGroup *)node)->name, -1)); + Tcl_NewStringObj(purple_group_get_name((PurpleGroup *)node), -1)); break; case PURPLE_BLIST_CONTACT_NODE: /* g_string_printf(val, "contact {%s}", Contact Name? ); */ @@ -309,20 +309,20 @@ Tcl_ListObjAppendElement(handler->interp, arg, Tcl_NewStringObj("buddy", -1)); Tcl_ListObjAppendElement(handler->interp, arg, - Tcl_NewStringObj(((PurpleBuddy *)node)->name, -1)); + Tcl_NewStringObj(purple_buddy_get_name((PurpleBuddy *)node), -1)); Tcl_ListObjAppendElement(handler->interp, arg, purple_tcl_ref_new(PurpleTclRefAccount, - ((PurpleBuddy *)node)->account)); + purple_buddy_get_account((PurpleBuddy *)node))); break; case PURPLE_BLIST_CHAT_NODE: arg = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(handler->interp, arg, Tcl_NewStringObj("chat", -1)); Tcl_ListObjAppendElement(handler->interp, arg, - Tcl_NewStringObj(((PurpleChat *)node)->alias, -1)); + Tcl_NewStringObj(purple_chat_get_name((PurpleChat *)node), -1)); Tcl_ListObjAppendElement(handler->interp, arg, purple_tcl_ref_new(PurpleTclRefAccount, - ((PurpleChat *)node)->account)); + purple_chat_get_account((PurpleChat *)node))); break; case PURPLE_BLIST_OTHER_NODE: arg = Tcl_NewStringObj("other", -1);
--- a/libpurple/protocols/bonjour/bonjour.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/protocols/bonjour/bonjour.c Fri Oct 31 08:37:42 2008 +0000 @@ -59,18 +59,18 @@ return; /* Go through and remove all buddies that belong to this account */ - for (cnode = ((PurpleBlistNode *) bonjour_group)->child; cnode; cnode = cnodenext) { - cnodenext = cnode->next; + for (cnode = purple_blist_node_get_first_child((PurpleBlistNode *) bonjour_group); cnode; cnode = cnodenext) { + cnodenext = purple_blist_node_get_sibling_next(cnode); if (!PURPLE_BLIST_NODE_IS_CONTACT(cnode)) continue; - for (bnode = cnode->child; bnode; bnode = bnodenext) { - bnodenext = bnode->next; + for (bnode = purple_blist_node_get_first_child(cnode); bnode; bnode = bnodenext) { + bnodenext = purple_blist_node_get_sibling_next(bnode); if (!PURPLE_BLIST_NODE_IS_BUDDY(bnode)) continue; buddy = (PurpleBuddy *) bnode; - if (buddy->account != account) + if (purple_buddy_get_account(buddy) != account) continue; - purple_prpl_got_user_status(account, buddy->name, "offline", NULL); + purple_prpl_got_user_status(account, purple_buddy_get_name(buddy), "offline", NULL); purple_account_remove_buddy(account, buddy, NULL); purple_blist_remove_buddy(buddy); }
--- a/libpurple/protocols/bonjour/buddy.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/protocols/bonjour/buddy.c Fri Oct 31 08:37:42 2008 +0000 @@ -127,7 +127,7 @@ { PurpleGroup *group; PurpleAccount *account = bonjour_buddy->account; - const char *status_id, *old_hash, *new_hash; + const char *status_id, *old_hash, *new_hash, *name; /* Translate between the Bonjour status and the Purple status */ if (bonjour_buddy->status != NULL && g_ascii_strcasecmp("dnd", bonjour_buddy->status) == 0) @@ -158,10 +158,11 @@ } buddy->proto_data = bonjour_buddy; + name = purple_buddy_get_name(buddy); /* Create the alias for the buddy using the first and the last name */ if (bonjour_buddy->nick) - serv_got_alias(purple_account_get_connection(account), buddy->name, bonjour_buddy->nick); + serv_got_alias(purple_account_get_connection(account), name, bonjour_buddy->nick); else { gchar *alias = NULL; const char *first, *last; @@ -172,18 +173,18 @@ (first && *first ? first : ""), (first && *first && last && *last ? " " : ""), (last && *last ? last : "")); - serv_got_alias(purple_account_get_connection(account), buddy->name, alias); + serv_got_alias(purple_account_get_connection(account), name, alias); g_free(alias); } /* Set the user's status */ if (bonjour_buddy->msg != NULL) - purple_prpl_got_user_status(account, buddy->name, status_id, + purple_prpl_got_user_status(account, name, status_id, "message", bonjour_buddy->msg, NULL); else - purple_prpl_got_user_status(account, buddy->name, status_id, NULL); + purple_prpl_got_user_status(account, name, status_id, NULL); - purple_prpl_got_user_idle(account, buddy->name, FALSE, 0); + purple_prpl_got_user_idle(account, name, FALSE, 0); /* TODO: Because we don't save Bonjour buddies in blist.xml, * we will always have to look up the buddy icon at login time. @@ -198,7 +199,7 @@ * as what we looked up. */ bonjour_dns_sd_retrieve_buddy_icon(bonjour_buddy); } else if (!new_hash) - purple_buddy_icons_set_for_user(account, buddy->name, NULL, 0, NULL); + purple_buddy_icons_set_for_user(account, name, NULL, 0, NULL); } /**
--- a/libpurple/protocols/bonjour/jabber.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/protocols/bonjour/jabber.c Fri Oct 31 08:37:42 2008 +0000 @@ -142,7 +142,7 @@ _jabber_parse_and_write_message_to_ui(xmlnode *message_node, PurpleBuddy *pb) { xmlnode *body_node, *html_node, *events_node; - PurpleConnection *gc = pb->account->gc; + PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(pb)); gchar *body = NULL; gboolean composing_event = FALSE; @@ -225,7 +225,7 @@ } /* Send the message to the UI */ - serv_got_im(gc, pb->name, body, 0, time(NULL)); + serv_got_im(gc, purple_buddy_get_name(pb), body, 0, time(NULL)); g_free(body); }
--- a/libpurple/protocols/gg/gg.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/protocols/gg/gg.c Fri Oct 31 08:37:42 2008 +0000 @@ -421,7 +421,7 @@ */ /* Need to disconnect or actually log in. For now, we disconnect. */ - purple_connection_destroy(gc); + purple_account_disconnect(account); exit_err: if(account->registration_cb) @@ -446,7 +446,7 @@ GGPInfo *info = gc->proto_data; GGPToken *token = info->token; - purple_connection_destroy(gc); + purple_account_disconnect(gc->account); g_free(token->id); g_free(token->data);
--- a/libpurple/protocols/msn/notification.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/protocols/msn/notification.c Fri Oct 31 08:37:42 2008 +0000 @@ -578,7 +578,7 @@ g_snprintf(fmt_str, sizeof(fmt_str), "%d", MSN_NETWORK_PASSPORT); /*mobile*/ - //type_str = g_strdup_printf("4"); + /*type_str = g_strdup_printf("4");*/ xmlnode_set_attrib(c_node, "t", fmt_str); xmlnode_insert_child(d_node, c_node);
--- a/libpurple/protocols/qq/im.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/protocols/qq/im.c Fri Oct 31 08:37:42 2008 +0000 @@ -341,7 +341,7 @@ if(im_text.fragmentCount == 0) im_text.fragmentCount = 1; - // Filter tail space + /* Filter tail space */ if(im_text.fragmentIndex == im_text.fragmentCount -1) { gint real_len = text_len; @@ -349,7 +349,7 @@ real_len --; text_len = real_len; - // Null string instaed of space + /* Null string instead of space */ im_text.msg[text_len] = 0; }
--- a/libpurple/sslconn.c Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/sslconn.c Fri Oct 31 08:37:42 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PURPLE_SSLCONN_C_ + #include "internal.h" #include "certificate.h"
--- a/libpurple/sslconn.h Wed Oct 29 05:24:28 2008 +0000 +++ b/libpurple/sslconn.h Fri Oct 31 08:37:42 2008 +0000 @@ -185,7 +185,7 @@ PurpleSslErrorFunction error_func, void *data); -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_SSLCONN_C_) /** * Makes a SSL connection using an already open file descriptor. *
--- a/pidgin/Makefile.am Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/Makefile.am Fri Oct 31 08:37:42 2008 +0000 @@ -188,6 +188,7 @@ pidgin_LDFLAGS = -export-dynamic pidgin_LDADD = \ @LIBOBJS@ \ + $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(GSTREAMER_LIBS) \ $(XSS_LIBS) \
--- a/pidgin/gtkblist.c Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/gtkblist.c Fri Oct 31 08:37:42 2008 +0000 @@ -7183,7 +7183,10 @@ purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/y", 0); purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/width", 250); /* Golden ratio, baby */ purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/height", 405); /* Golden ratio, baby */ +#if !GTK_CHECK_VERSION(2,14,0) + /* This pref is used in pidgintooltip.c. */ purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay", 500); +#endif /* Register our signals */ purple_signal_register(gtk_blist_handle, "gtkblist-hiding",
--- a/pidgin/gtkconv.c Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/gtkconv.c Fri Oct 31 08:37:42 2008 +0000 @@ -25,6 +25,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA * */ +#define _PIDGIN_GTKCONV_C_ + #include "internal.h" #include "pidgin.h" @@ -166,7 +168,7 @@ gboolean pidgin_conv_has_focus(PurpleConversation *conv); static GdkColor* generate_nick_colors(guint *numcolors, GdkColor background); static gboolean color_is_visible(GdkColor foreground, GdkColor background, int color_contrast, int brightness_contrast); -static GtkTextTag *get_buddy_tag(PurpleConversation *conv, const char *who, gboolean create); +static GtkTextTag *get_buddy_tag(PurpleConversation *conv, const char *who, PurpleMessageFlags flag, gboolean create); static void pidgin_conv_update_fields(PurpleConversation *conv, PidginConvFields fields); static void focus_out_from_menubar(GtkWidget *wid, PidginWindow *win); static void pidgin_conv_tab_pack(PidginWindow *win, PidginConversation *gtkconv); @@ -177,7 +179,8 @@ int width, int height); static gboolean pidgin_conv_xy_to_right_infopane(PidginWindow *win, int x, int y); -static const GdkColor *get_nick_color(PidginConversation *gtkconv, const char *name) { +static const GdkColor *get_nick_color(PidginConversation *gtkconv, const char *name) +{ static GdkColor col; GtkStyle *style = gtk_widget_get_style(gtkconv->imhtml); float scale; @@ -1966,6 +1969,40 @@ } static gboolean +gtkconv_cycle_focus(PidginConversation *gtkconv, GtkDirectionType dir) +{ + PurpleConversation *conv = gtkconv->active_conv; + gboolean chat = purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT; + GtkWidget *next = NULL; + struct { + GtkWidget *from; + GtkWidget *to; + } transitions[] = { + {gtkconv->entry, gtkconv->imhtml}, + {gtkconv->imhtml, chat ? gtkconv->u.chat->list : gtkconv->entry}, + {chat ? gtkconv->u.chat->list : NULL, gtkconv->entry}, + {NULL, NULL} + }, *ptr; + + for (ptr = transitions; !next && ptr->from; ptr++) { + GtkWidget *from, *to; + if (dir == GTK_DIR_TAB_FORWARD) { + from = ptr->from; + to = ptr->to; + } else { + from = ptr->to; + to = ptr->from; + } + if (gtk_widget_is_focus(from)) + next = to; + } + + if (next) + gtk_widget_grab_focus(next); + return !!next; +} + +static gboolean conv_keypress_common(PidginConversation *gtkconv, GdkEventKey *event) { PidginWindow *win; @@ -2026,7 +2063,10 @@ #endif return TRUE; break; - + case GDK_F6: + if (gtkconv_cycle_focus(gtkconv, event->state & GDK_SHIFT_MASK ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD)) + return TRUE; + break; } /* End of switch */ } @@ -2053,6 +2093,10 @@ return TRUE; } break; + case GDK_F6: + if (gtkconv_cycle_focus(gtkconv, event->state & GDK_SHIFT_MASK ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD)) + return TRUE; + break; } } return FALSE; @@ -4497,7 +4541,7 @@ blist_node_aliased_cb((PurpleBlistNode *)buddy, NULL, conv); - texttag = get_buddy_tag(conv, purple_buddy_get_name(buddy), FALSE); /* XXX: do we want the normalized name? */ + texttag = get_buddy_tag(conv, purple_buddy_get_name(buddy), 0, FALSE); /* XXX: do we want the normalized name? */ if (texttag) { g_object_set(texttag, "weight", is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, NULL); } @@ -5433,16 +5477,35 @@ purple_conversation_write(conv, who, message, flags, mtime); } +static const char * +get_text_tag_color(GtkTextTag *tag) +{ + GdkColor *color = NULL; + gboolean set = FALSE; + static char colcode[] = "#XXXXXX"; + if (tag) + g_object_get(G_OBJECT(tag), "foreground-set", &set, "foreground-gdk", &color, NULL); + if (set && color) + g_snprintf(colcode, sizeof(colcode), "#%02x%02x%02x", + color->red >> 8, color->green >> 8, color->blue >> 8); + else + colcode[0] = '\0'; + if (color) + gdk_color_free(color); + return colcode; +} + /* The callback for an event on a link tag. */ static gboolean buddytag_event(GtkTextTag *tag, GObject *imhtml, - GdkEvent *event, GtkTextIter *arg2, gpointer data) { + GdkEvent *event, GtkTextIter *arg2, gpointer data) +{ if (event->type == GDK_BUTTON_PRESS || event->type == GDK_2BUTTON_PRESS) { GdkEventButton *btn_event = (GdkEventButton*) event; PurpleConversation *conv = data; char *buddyname; - /* strlen("BUDDY ") == 6 */ + /* strlen("BUDDY " or "HILIT ") == 6 */ g_return_val_if_fail((tag->name != NULL) && (strlen(tag->name) > 6), FALSE); @@ -5482,24 +5545,33 @@ return FALSE; } -static GtkTextTag *get_buddy_tag(PurpleConversation *conv, const char *who, gboolean create) +static GtkTextTag *get_buddy_tag(PurpleConversation *conv, const char *who, PurpleMessageFlags flag, + gboolean create) { PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); GtkTextTag *buddytag; gchar *str; - - str = g_strdup_printf("BUDDY %s", who); + gboolean highlight = (flag & PURPLE_MESSAGE_NICK); + GtkTextBuffer *buffer = GTK_IMHTML(gtkconv->imhtml)->text_buffer; + + str = g_strdup_printf(highlight ? "HILIT %s" : "BUDDY %s", who); buddytag = gtk_text_tag_table_lookup( - gtk_text_buffer_get_tag_table( - GTK_IMHTML(gtkconv->imhtml)->text_buffer), str); + gtk_text_buffer_get_tag_table(buffer), str); if (buddytag == NULL && create) { - buddytag = gtk_text_buffer_create_tag( - GTK_IMHTML(gtkconv->imhtml)->text_buffer, str, - "foreground-gdk", get_nick_color(gtkconv, who), - "weight", purple_find_buddy(purple_conversation_get_account(conv), who) ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, - NULL); + if (highlight) + buddytag = gtk_text_buffer_create_tag(buffer, str, + "foreground", get_text_tag_color(gtk_text_tag_table_lookup( + gtk_text_buffer_get_tag_table(buffer), "highlight-name")), + "weight", PANGO_WEIGHT_BOLD, + NULL); + else + buddytag = gtk_text_buffer_create_tag( + buffer, str, + "foreground-gdk", get_nick_color(gtkconv, who), + "weight", purple_find_buddy(purple_conversation_get_account(conv), who) ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, + NULL); g_signal_connect(G_OBJECT(buddytag), "event", G_CALLBACK(buddytag_event), conv); @@ -5856,7 +5928,9 @@ } if (flags & PURPLE_MESSAGE_NICK) { - tagname = "highlight-name"; + if (type == PURPLE_CONV_TYPE_IM) { + tagname = "highlight-name"; + } } else if (flags & PURPLE_MESSAGE_RECV) { /* The tagname for chats is handled by get_buddy_tag */ if (type == PURPLE_CONV_TYPE_IM) { @@ -5875,7 +5949,7 @@ if (tagname) tag = gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), tagname); else - tag = get_buddy_tag(conv, name, TRUE); + tag = get_buddy_tag(conv, name, flags, TRUE); if (GTK_IMHTML(gtkconv->imhtml)->show_comments) { /* The color for the timestamp has to be set in the font-tags, unfortunately. @@ -5883,19 +5957,10 @@ * bold. I thought applying the "comment" tag again, which has "weight" set * to PANGO_WEIGHT_NORMAL, would remove the boldness. But it doesn't. So * this will have to do. I don't terribly like it. -- sadrul */ - GdkColor *color = NULL; - gboolean set = FALSE; - char colcode[] = "COLOR=\"#XXXXXX\""; - g_object_get(G_OBJECT(tag), "foreground-set", &set, "foreground-gdk", &color, NULL); - if (set && color) - g_snprintf(colcode, sizeof(colcode), "COLOR=\"#%02x%02x%02x\"", - color->red >> 8, color->green >> 8, color->blue >> 8); - else - colcode[0] = '\0'; - g_snprintf(buf2, BUF_LONG, "<FONT %s SIZE=\"2\"><!--%s --></FONT>", colcode, mdate); + const char *color = get_text_tag_color(tag); + g_snprintf(buf2, BUF_LONG, "<FONT %s%s%s SIZE=\"2\"><!--%s --></FONT>", + color ? "COLOR=\"" : "", color ? color : "", color ? "\"" : "", mdate); gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, gtk_font_options_all | GTK_IMHTML_NO_SCROLL); - if (color) - gdk_color_free(color); } gtk_text_buffer_get_end_iter(buffer, &end);
--- a/pidgin/gtkconv.h Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/gtkconv.h Fri Oct 31 08:37:42 2008 +0000 @@ -143,7 +143,7 @@ GtkWidget *tab_label; GtkWidget *menu_icon; GtkWidget *menu_label; -#ifndef PIDGIN_DISABLE_DEPRECATED +#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKCONV_C_) /** @deprecated */ GtkSizeGroup *sg; #else
--- a/pidgin/gtkdialogs.c Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/gtkdialogs.c Fri Oct 31 08:37:42 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PIDGIN_GTKDIALOGS_C_ + #include "internal.h" #include "pidgin.h" @@ -967,7 +969,7 @@ static void pidgin_dialogs_alias_contact_cb(PurpleContact *contact, const char *new_alias) { - purple_contact_set_alias(contact, new_alias); + purple_blist_alias_contact(contact, new_alias); } void
--- a/pidgin/gtkdialogs.h Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/gtkdialogs.h Fri Oct 31 08:37:42 2008 +0000 @@ -38,11 +38,13 @@ void pidgin_dialogs_info(void); void pidgin_dialogs_log(void); +#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKDIALOGS_C_) /** * @deprecated This function is no longer used and will be removed in * Pidgin 3.0.0 unless there is sufficient demand to keep it. */ void pidgin_dialogs_alias_contact(PurpleContact *); +#endif void pidgin_dialogs_alias_buddy(PurpleBuddy *); void pidgin_dialogs_alias_chat(PurpleChat *); @@ -55,9 +57,12 @@ /* Everything after this should probably be moved elsewhere */ #ifndef PIDGIN_DISABLE_DEPRECATED +/* This PIDGIN_DISABLE_DEPRECATED doesn't need to be deactivated by + * _PIDGIN_GTKDIALOGS_C_, because it shouldn't be using this macro. */ #define PIDGIN_DIALOG(x) x = gtk_window_new(GTK_WINDOW_TOPLEVEL); \ gtk_window_set_type_hint(GTK_WINDOW(x), GDK_WINDOW_TYPE_HINT_DIALOG) #endif + #define PIDGIN_WINDOW_ICONIFIED(x) (gdk_window_get_state(GTK_WIDGET(x)->window) & GDK_WINDOW_STATE_ICONIFIED) #endif /* _PIDGINDIALOGS_H_ */
--- a/pidgin/gtkimhtml.c Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/gtkimhtml.c Fri Oct 31 08:37:42 2008 +0000 @@ -24,6 +24,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA * */ +#define _PIDGIN_GTKIMHTML_C_ #ifdef HAVE_CONFIG_H #include <config.h> @@ -1988,7 +1989,7 @@ pos = strchr (t->values->str, *x); if (pos) - t = t->children [(unsigned int) pos - (unsigned int) t->values->str]; + t = t->children [pos - t->values->str]; else return;
--- a/pidgin/gtkimhtml.h Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/gtkimhtml.h Fri Oct 31 08:37:42 2008 +0000 @@ -130,7 +130,7 @@ GtkTextTag *link; } edit; -#ifndef PIDGIN_DISABLE_DEPRECATED +#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKIMHTML_C_) /** @deprecated */ char *clipboard_text_string; /** @deprecated */
--- a/pidgin/gtkprefs.c Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/gtkprefs.c Fri Oct 31 08:37:42 2008 +0000 @@ -1839,14 +1839,14 @@ gpointer data) { GtkToggleButton *button = data; - gboolean muted = val; + gboolean muted = GPOINTER_TO_INT(val); g_return_if_fail(!strcmp (pref_name, PIDGIN_PREFS_ROOT "/sound/mute")); /* Block the handler that re-sets the preference. */ - g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, pref_name); + g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); gtk_toggle_button_set_active (button, muted); - g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, pref_name); + g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); }
--- a/pidgin/gtkutils.c Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/gtkutils.c Fri Oct 31 08:37:42 2008 +0000 @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PIDGIN_GTKUTILS_C_ + #include "internal.h" #include "pidgin.h" @@ -2878,7 +2880,6 @@ } #endif /* ! Gtk 2.6.0 */ -#ifndef PURPLE_DISABLE_DEPRECATED void pidgin_set_custom_buddy_icon(PurpleAccount *account, const char *who, const char *filename) { PurpleBuddy *buddy; @@ -2893,7 +2894,6 @@ contact = purple_buddy_get_contact(buddy); purple_buddy_icons_node_set_custom_icon_from_file((PurpleBlistNode*)contact, filename); } -#endif char *pidgin_make_pretty_arrows(const char *str) {
--- a/pidgin/gtkutils.h Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/gtkutils.h Fri Oct 31 08:37:42 2008 +0000 @@ -638,7 +638,7 @@ GError **error); #endif -#ifndef PURPLE_DISABLE_DEPRECATED +#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKUTILS_C_) /** * Set or unset a custom buddyicon for a user. *
--- a/pidgin/pidgintooltip.c Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/pidgintooltip.c Fri Oct 31 08:37:42 2008 +0000 @@ -30,6 +30,9 @@ #include "pidgintooltip.h" #include "debug.h" +static gboolean enable_tooltips; +static int tooltip_delay = -1; + struct { GtkWidget *widget; @@ -56,6 +59,27 @@ } PidginTooltipData; static void +initialize_tooltip_delay() +{ +#if GTK_CHECK_VERSION(2,14,0) + GtkSettings *settings; +#endif + + if (tooltip_delay != -1) + return; + +#if GTK_CHECK_VERSION(2,14,0) + settings = gtk_settings_get_default(); + + g_object_get(settings, "gtk-enable-tooltips", &enable_tooltips, NULL); + g_object_get(settings, "gtk-tooltip-timeout", &tooltip_delay, NULL); +#else + tooltip_delay = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay"); + enable_tooltips = (tooltip_delay != 0); +#endif +} + +static void destroy_tooltip_data(PidginTooltipData *data) { gtk_tree_path_free(data->common.treeview.path); @@ -280,14 +304,12 @@ row_motion_cb(GtkWidget *tv, GdkEventMotion *event, gpointer userdata) { GtkTreePath *path; - int delay; if (event->window != gtk_tree_view_get_bin_window(GTK_TREE_VIEW(tv))) return FALSE; /* The cursor is probably on the TreeView's header. */ - /* XXX: probably use something more generic? */ - delay = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay"); - if (delay == 0) + initialize_tooltip_delay(); + if (!enable_tooltips) return FALSE; if (pidgin_tooltip.timeout) { @@ -307,7 +329,7 @@ gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), path, NULL, &pidgin_tooltip.tip_rect); gtk_tree_path_free(path); - pidgin_tooltip.timeout = g_timeout_add(delay, (GSourceFunc)pidgin_tooltip_timeout, userdata); + pidgin_tooltip.timeout = g_timeout_add(tooltip_delay, (GSourceFunc)pidgin_tooltip_timeout, userdata); return FALSE; } @@ -337,13 +359,13 @@ static gboolean widget_motion_cb(GtkWidget *widget, GdkEvent *event, gpointer data) { - int delay = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay"); + initialize_tooltip_delay(); pidgin_tooltip_destroy(); - if (delay == 0) + if (!enable_tooltips) return FALSE; - pidgin_tooltip.timeout = g_timeout_add(delay, (GSourceFunc)pidgin_tooltip_timeout, data); + pidgin_tooltip.timeout = g_timeout_add(tooltip_delay, (GSourceFunc)pidgin_tooltip_timeout, data); return FALSE; }
--- a/pidgin/plugins/perl/common/gtkmodule.h Wed Oct 29 05:24:28 2008 +0000 +++ b/pidgin/plugins/perl/common/gtkmodule.h Fri Oct 31 08:37:42 2008 +0000 @@ -1,3 +1,7 @@ +/* Allow the Perl code to see deprecated functions, so we can continue to + * export them to Perl plugins. */ +#undef PIDGIN_DISABLE_DEPRECATED + typedef struct group *Pidgin__Group; #define group perl_group