Only in libpurple: Makefile.in diff -ru extract/pidgin-2.6.4/libpurple/account.c libpurple/account.c --- extract/pidgin-2.6.4/libpurple/account.c 2009-11-30 04:13:46.000000000 +0100 +++ libpurple/account.c 2009-12-06 00:38:31.000000000 +0100 @@ -30,7 +30,6 @@ #include "debug.h" #include "network.h" #include "notify.h" -#include "pounce.h" #include "prefs.h" #include "privacy.h" #include "prpl.h" @@ -41,6 +40,8 @@ #include "util.h" #include "xmlnode.h" +#define schedule_accounts_save() + typedef struct { PurpleConnectionErrorInfo *current_error; @@ -89,6 +90,7 @@ static void set_current_error(PurpleAccount *account, PurpleConnectionErrorInfo *new_err); +#if 0 /********************************************************************* * Writing to disk * *********************************************************************/ @@ -914,6 +916,7 @@ return ret; } +#endif static void load_accounts(void) @@ -922,6 +925,7 @@ accounts_loaded = TRUE; +#if 0 node = purple_util_read_xml_from_file("accounts.xml", _("accounts")); if (node == NULL) @@ -938,6 +942,7 @@ xmlnode_free(node); _purple_buddy_icons_account_loaded_cb(); +#endif } @@ -1232,8 +1237,13 @@ gc = purple_account_get_connection(account); _purple_connection_destroy(gc); + + /* + XXXFlo: disable this until the UI for requesting a password + from the user works in Instantbird if (!purple_account_get_remember_password(account)) purple_account_set_password(account, NULL); + */ purple_account_set_connection(account, NULL); account->disconnecting = FALSE; @@ -2021,7 +2031,7 @@ p = purple_find_prpl(purple_account_get_protocol_id(account)); - return ((p && p->info->name) ? _(p->info->name) : _("Unknown")); + return ((p && p->info->name) ? p->info->name : _("Unknown")); } PurpleConnection * @@ -2631,9 +2641,6 @@ purple_conversation_destroy(conv); } - /* Remove this account's pounces */ - purple_pounce_destroy_all_by_account(account); - /* This will cause the deletion of an old buddy icon. */ purple_buddy_icons_set_account_icon(account, NULL, 0); @@ -2873,13 +2880,14 @@ purple_accounts_uninit(void) { gpointer handle = purple_accounts_get_handle(); +#if 0 if (save_timer != 0) { purple_timeout_remove(save_timer); save_timer = 0; sync_accounts(); } - +#endif for (; accounts; accounts = g_list_delete_link(accounts, accounts)) purple_account_destroy(accounts->data); Only in libpurple: account.c.orig diff -ru extract/pidgin-2.6.4/libpurple/blist.c libpurple/blist.c --- extract/pidgin-2.6.4/libpurple/blist.c 2009-11-30 04:13:46.000000000 +0100 +++ libpurple/blist.c 2009-12-06 00:38:31.000000000 +0100 @@ -125,6 +125,7 @@ } +#if 0 /********************************************************************* * Writing to disk * *********************************************************************/ @@ -599,15 +600,19 @@ parse_chat(group, cnode); } } +#endif /* TODO: Make static and rename to load_blist */ void purple_blist_load() { +#if 0 xmlnode *purple, *blist, *privacy; +#endif blist_loaded = TRUE; +#if 0 purple = purple_util_read_xml_from_file("blist.xml", _("buddy list")); if (purple == NULL) @@ -669,6 +674,7 @@ /* This tells the buddy icon code to do its thing. */ _purple_buddy_icons_blist_loaded_cb(); +#endif } @@ -3067,7 +3073,7 @@ if (!ops) return; - +#if 0 if (!ops->save_node) { ops->save_node = purple_blist_save_node; overrode = TRUE; @@ -3087,6 +3093,7 @@ purple_debug_warning("blist", "Only some of the blist saving UI ops " "were overridden. This probably is not what you want!\n"); } +#endif } PurpleBlistUiOps * @@ -3207,11 +3214,13 @@ if (purplebuddylist == NULL) return; +#if 0 if (save_timer != 0) { purple_timeout_remove(save_timer); save_timer = 0; purple_blist_sync(); } +#endif purple_blist_destroy(); diff -ru extract/pidgin-2.6.4/libpurple/blist.h libpurple/blist.h --- extract/pidgin-2.6.4/libpurple/blist.h 2009-11-30 04:13:46.000000000 +0100 +++ libpurple/blist.h 2009-10-26 11:32:30.000000000 +0100 @@ -1058,7 +1058,7 @@ * the buddy list is saved automatically, so you should not need to * call this. */ -void purple_blist_schedule_save(void); +/* void purple_blist_schedule_save(void); */ /** * Requests from the user information needed to add a buddy to the diff -ru extract/pidgin-2.6.4/libpurple/cipher.c libpurple/cipher.c --- extract/pidgin-2.6.4/libpurple/cipher.c 2009-11-30 04:13:46.000000000 +0100 +++ libpurple/cipher.c 2009-12-06 00:38:31.000000000 +0100 @@ -57,6 +57,9 @@ #include "signals.h" #include "value.h" +#undef GLIB_MINOR_VERSION +#define GLIB_MINOR_VERSION 15 + #if GLIB_CHECK_VERSION(2,16,0) static void purple_g_checksum_init(PurpleCipherContext *context, GChecksumType type) diff -ru extract/pidgin-2.6.4/libpurple/conversation.c libpurple/conversation.c --- extract/pidgin-2.6.4/libpurple/conversation.c 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/conversation.c 2009-10-25 19:20:32.000000000 +0100 @@ -136,6 +136,7 @@ type = purple_conversation_get_type(conv); +#if 0 /* Always linkfy the text for display, unless we're * explicitly asked to do otheriwse*/ if (!(msgflags & PURPLE_MESSAGE_INVISIBLE)) { @@ -150,6 +151,12 @@ sent = g_strdup(displayed); } else sent = g_strdup(message); +#else + /* send and display as is, linkification has already been + handled by the conversation binding */ + displayed = g_strdup(message); + sent = g_strdup(message); +#endif msgflags |= PURPLE_MESSAGE_SEND; @@ -1001,7 +1008,10 @@ if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) { if ((flags & PURPLE_MESSAGE_RECV) == PURPLE_MESSAGE_RECV) { - purple_conv_im_set_typing_state(PURPLE_CONV_IM(conv), PURPLE_NOT_TYPING); + PurpleConvIm *im = PURPLE_CONV_IM(conv); + purple_conv_im_set_typing_state(im, PURPLE_NOT_TYPING); + purple_conv_im_update_typing(im); + } } diff -ru extract/pidgin-2.6.4/libpurple/core.c libpurple/core.c --- extract/pidgin-2.6.4/libpurple/core.c 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/core.c 2009-10-25 19:40:29.000000000 +0100 @@ -25,7 +25,6 @@ */ #include "internal.h" #include "cipher.h" -#include "certificate.h" #include "cmds.h" #include "connection.h" #include "conversation.h" @@ -38,19 +37,15 @@ #include "network.h" #include "notify.h" #include "plugin.h" -#include "pounce.h" #include "prefs.h" #include "privacy.h" #include "proxy.h" #include "savedstatuses.h" #include "signals.h" #include "smiley.h" -#include "sound.h" -#include "sound-theme-loader.h" #include "sslconn.h" #include "status.h" #include "stun.h" -#include "theme-manager.h" #include "util.h" #ifdef HAVE_DBUS @@ -63,6 +58,10 @@ # include "dbus-bindings.h" #endif +#include + +extern void purple_statenotify_init(void); + struct PurpleCore { char *ui; @@ -73,7 +72,9 @@ static PurpleCoreUiOps *_ops = NULL; static PurpleCore *_core = NULL; +#ifdef STATIC_PROTO_INIT STATIC_PROTO_INIT +#endif gboolean purple_core_init(const char *ui) @@ -117,8 +118,6 @@ * for protocol prefs to work. */ purple_prefs_init(); - purple_debug_init(); - if (ops != NULL) { if (ops->ui_prefs_init != NULL) @@ -140,12 +139,15 @@ */ purple_plugins_init(); +#ifdef STATIC_PROTO_INIT /* Initialize all static protocols. */ static_proto_init(); +#endif - purple_plugins_probe(G_MODULE_SUFFIX); + if (ops != NULL && ops->register_plugins != NULL) + ops->register_plugins(); - purple_theme_manager_init(); + purple_plugins_probe(G_MODULE_SUFFIX); /* The buddy icon code uses the imgstore, so init it early. */ purple_imgstore_init(); @@ -160,33 +162,30 @@ purple_accounts_init(); purple_savedstatuses_init(); purple_notify_init(); - purple_certificate_init(); purple_conversations_init(); purple_blist_init(); purple_log_init(); purple_network_init(); purple_privacy_init(); - purple_pounces_init(); purple_proxy_init(); purple_dnsquery_init(); - purple_sound_init(); purple_ssl_init(); purple_stun_init(); purple_xfers_init(); purple_idle_init(); purple_smileys_init(); + purple_statenotify_init(); +#ifndef WINCE /* * Call this early on to try to auto-detect our IP address and * hopefully save some time later. */ purple_network_get_my_ip(-1); +#endif if (ops != NULL && ops->ui_init != NULL) ops->ui_init(); - /* The UI may have registered some theme types, so refresh them */ - purple_theme_manager_refresh(); - return TRUE; } @@ -204,6 +203,7 @@ /* Transmission ends */ purple_connections_disconnect_all(); +#if 0 /* * Certificates must be destroyed before the SSL plugins, because * PurpleCertificates contain pointers to PurpleCertificateSchemes, @@ -211,6 +211,7 @@ * SSL plugin is uninit. */ purple_certificate_uninit(); +#endif /* The SSL plugins must be uninit before they're unloaded */ purple_ssl_uninit(); @@ -223,7 +224,6 @@ /* Save .xml files, remove signals, etc. */ purple_smileys_uninit(); purple_idle_uninit(); - purple_pounces_uninit(); purple_blist_uninit(); purple_ciphers_uninit(); purple_notify_uninit(); @@ -233,8 +233,6 @@ purple_savedstatuses_uninit(); purple_status_uninit(); purple_accounts_uninit(); - purple_sound_uninit(); - purple_theme_manager_uninit(); purple_xfers_uninit(); purple_proxy_uninit(); purple_dnsquery_uninit(); @@ -271,6 +269,8 @@ wpurple_cleanup(); #endif + xmlCleanupParser(); + _core = NULL; } @@ -403,6 +403,7 @@ return TRUE; } +#if 0 gboolean purple_core_migrate(void) { @@ -772,6 +773,7 @@ g_free(status_file); return TRUE; } +#endif GHashTable* purple_core_get_ui_info() { PurpleCoreUiOps *ops = purple_core_get_ui_ops(); diff -ru extract/pidgin-2.6.4/libpurple/core.h libpurple/core.h --- extract/pidgin-2.6.4/libpurple/core.h 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/core.h 2009-10-25 19:20:32.000000000 +0100 @@ -71,6 +71,11 @@ */ GHashTable* (*get_ui_info)(void); + /** Called during the initialization of the core to give the + * UI a chance to register static plugins. + */ + void (*register_plugins)(void); + void (*_purple_reserved1)(void); void (*_purple_reserved2)(void); void (*_purple_reserved3)(void); @@ -164,7 +169,7 @@ * @return A boolean indicating success or migration failure. On failure, * the application must display an error to the user and then exit. */ -gboolean purple_core_migrate(void); +/* gboolean purple_core_migrate(void); */ /** * Ensures that only one instance is running. If libpurple is built with D-Bus diff -ru extract/pidgin-2.6.4/libpurple/debug.c libpurple/debug.c --- extract/pidgin-2.6.4/libpurple/debug.c 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/debug.c 2009-12-06 00:38:31.000000000 +0100 @@ -31,18 +31,6 @@ static PurpleDebugUiOps *debug_ui_ops = NULL; /* - * This determines whether debug info should be written to the - * console or not. - * - * It doesn't make sense to make this a normal Purple preference - * because it's a command line option. This will always be FALSE, - * unless the user explicitly started the UI with the -d flag. - * It doesn't matter what this value was the last time Purple was - * started, so it doesn't make sense to save it in prefs. - */ -static gboolean debug_enabled = FALSE; - -/* * These determine whether verbose or unsafe debugging are desired. I * don't want to make these purple preferences because their values should * not be remembered across instances of the UI. @@ -50,10 +38,12 @@ static gboolean debug_verbose = FALSE; static gboolean debug_unsafe = FALSE; -static void -purple_debug_vargs(PurpleDebugLevel level, const char *category, - const char *format, va_list args) +void +purple_debug_with_location(PurpleDebugLevel level, const char *category, + const char *file, int line, const char *function, + const char *format, ...) { + va_list args; PurpleDebugUiOps *ops; char *arg_s = NULL; @@ -61,121 +51,88 @@ g_return_if_fail(format != NULL); ops = purple_debug_get_ui_ops(); - - if (!debug_enabled && ((ops == NULL) || (ops->print == NULL) || - (ops->is_enabled && !ops->is_enabled(level, category)))) + if ((ops == NULL) || + (ops->print_with_location == NULL && ops->print == NULL) || + (ops->is_enabled && !ops->is_enabled(level, category))) return; - arg_s = g_strdup_vprintf(format, args); - - if (debug_enabled) { - gchar *ts_s; - const char *mdate; - time_t mtime = time(NULL); - - - mdate = purple_utf8_strftime("%H:%M:%S", localtime(&mtime)); - ts_s = g_strdup_printf("(%s) ", mdate); - - if (category == NULL) - g_print("%s%s", ts_s, arg_s); - else - g_print("%s%s: %s", ts_s, category, arg_s); - - g_free(ts_s); - } + va_start(args, format); - if (ops != NULL && ops->print != NULL) + arg_s = g_strdup_vprintf(format, args); + if (ops->print_with_location != NULL) + ops->print_with_location(level, category, file, line, function, arg_s); + else ops->print(level, category, arg_s); - g_free(arg_s); -} - -void -purple_debug(PurpleDebugLevel level, const char *category, - const char *format, ...) -{ - va_list args; - - g_return_if_fail(level != PURPLE_DEBUG_ALL); - g_return_if_fail(format != NULL); - - va_start(args, format); - purple_debug_vargs(level, category, format, args); - va_end(args); -} -void -purple_debug_misc(const char *category, const char *format, ...) -{ - va_list args; - - g_return_if_fail(format != NULL); - - va_start(args, format); - purple_debug_vargs(PURPLE_DEBUG_MISC, category, format, args); va_end(args); } -void -purple_debug_info(const char *category, const char *format, ...) -{ - va_list args; +/* This is kept for ABI compatibility only. Should be removed once we + * change the version number and thus can safely assume that all old + * plugins will be disabled. + * New code uses purple_debug_with_location. */ +#undef purple_debug +#undef purple_debug_misc +#undef purple_debug_info +#undef purple_debug_warning +#undef purple_debug_error +#undef purple_debug_fatal - g_return_if_fail(format != NULL); - - va_start(args, format); - purple_debug_vargs(PURPLE_DEBUG_INFO, category, format, args); - va_end(args); -} - -void -purple_debug_warning(const char *category, const char *format, ...) +static void +purple_debug_vargs(PurpleDebugLevel level, const char *category, + const char *format, va_list args) { - va_list args; + PurpleDebugUiOps *ops; + char *arg_s = NULL; + g_return_if_fail(level != PURPLE_DEBUG_ALL); g_return_if_fail(format != NULL); - va_start(args, format); - purple_debug_vargs(PURPLE_DEBUG_WARNING, category, format, args); - va_end(args); -} - -void -purple_debug_error(const char *category, const char *format, ...) -{ - va_list args; + ops = purple_debug_get_ui_ops(); - g_return_if_fail(format != NULL); + if ((ops == NULL) || (ops->print == NULL) || + (ops->is_enabled && !ops->is_enabled(level, category))) + return; - va_start(args, format); - purple_debug_vargs(PURPLE_DEBUG_ERROR, category, format, args); - va_end(args); + arg_s = g_strdup_vprintf(format, args); + ops->print(level, category, arg_s); + g_free(arg_s); } void -purple_debug_fatal(const char *category, const char *format, ...) +purple_debug(PurpleDebugLevel level, const char *category, + const char *format, ...) { va_list args; + g_return_if_fail(level != PURPLE_DEBUG_ALL); g_return_if_fail(format != NULL); va_start(args, format); - purple_debug_vargs(PURPLE_DEBUG_FATAL, category, format, args); + purple_debug_vargs(level, category, format, args); va_end(args); } -void -purple_debug_set_enabled(gboolean enabled) -{ - debug_enabled = enabled; -} - -gboolean -purple_debug_is_enabled() -{ - return debug_enabled; -} +#define PURPLE_IMPL_DEBUG_HELPER(name, NAME) \ + void \ + purple_debug_##name(const char *category, const char *format, ...) \ + { \ + va_list args; \ + \ + g_return_if_fail(format != NULL); \ + \ + va_start(args, format); \ + purple_debug_vargs(PURPLE_DEBUG_##NAME, category, format, args); \ + va_end(args); \ + } + +PURPLE_IMPL_DEBUG_HELPER(misc, MISC) +PURPLE_IMPL_DEBUG_HELPER(info, INFO) +PURPLE_IMPL_DEBUG_HELPER(warning, WARNING) +PURPLE_IMPL_DEBUG_HELPER(error, ERROR) +PURPLE_IMPL_DEBUG_HELPER(fatal, FATAL) +/* End of the code kept for ABI compatibility */ void purple_debug_set_ui_ops(PurpleDebugUiOps *ops) @@ -212,24 +169,3 @@ { return debug_ui_ops; } - -void -purple_debug_init(void) -{ - /* Read environment variables once per init */ - if(g_getenv("PURPLE_UNSAFE_DEBUG")) - purple_debug_set_unsafe(TRUE); - - if(g_getenv("PURPLE_VERBOSE_DEBUG")) - purple_debug_set_verbose(TRUE); - - purple_prefs_add_none("/purple/debug"); - - /* - * This pref is obsolete and no longer referenced anywhere. It only - * survives here because it would be an API break if we removed it. - * Remove this when we get to 3.0.0 :) - */ - purple_prefs_add_bool("/purple/debug/timestamps", TRUE); -} - diff -ru extract/pidgin-2.6.4/libpurple/debug.h libpurple/debug.h --- extract/pidgin-2.6.4/libpurple/debug.h 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/debug.h 2009-10-25 19:20:32.000000000 +0100 @@ -50,6 +50,9 @@ { void (*print)(PurpleDebugLevel level, const char *category, const char *arg_s); + void (*print_with_location)(PurpleDebugLevel level, const char *category, + const char *file, int line, + const char *function, const char *arg_s); gboolean (*is_enabled)(PurpleDebugLevel level, const char *category); @@ -66,15 +69,41 @@ /**************************************************************************/ /** @name Debug API */ /**************************************************************************/ + /** * Outputs debug information. * * @param level The debug level. * @param category The category (or @c NULL). + * @param file The file containing the calling code. + * @param line The line number. + * @param function The calling function. * @param format The format string. */ +void purple_debug_with_location(PurpleDebugLevel level, const char *category, + const char *file, int line, + const char *function, const char *format, ...); + +/* The use of __VA_ARGS__ will cause gcc to annoyingly output this warning: + * warning: anonymous variadic macros were introduced in C99 + * Tell it to shut up... + */ +#pragma GCC system_header + +/** + * Outputs debug information. + * + * @param level The debug level. + * @param category The category (or @c NULL). + * @param format The format string. + */ +/* void purple_debug(PurpleDebugLevel level, const char *category, const char *format, ...) G_GNUC_PRINTF(3, 4); +*/ +#define purple_debug(level, category, ...) \ + purple_debug_with_location(level, category, __FILE__, __LINE__, \ + __FUNCTION__, __VA_ARGS__) /** * Outputs misc. level debug information. @@ -87,7 +116,11 @@ * * @see purple_debug() */ +/* void purple_debug_misc(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3); +*/ +#define purple_debug_misc(category, ...) \ + purple_debug(PURPLE_DEBUG_MISC, category, __VA_ARGS__) /** * Outputs info level debug information. @@ -100,7 +133,11 @@ * * @see purple_debug() */ +/* void purple_debug_info(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3); +*/ +#define purple_debug_info(category, ...) \ + purple_debug(PURPLE_DEBUG_INFO, category, __VA_ARGS__) /** * Outputs warning level debug information. @@ -113,7 +150,11 @@ * * @see purple_debug() */ +/* void purple_debug_warning(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3); +*/ +#define purple_debug_warning(category, ...) \ + purple_debug(PURPLE_DEBUG_WARNING, category, __VA_ARGS__) /** * Outputs error level debug information. @@ -126,12 +167,16 @@ * * @see purple_debug() */ +/* void purple_debug_error(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3); +*/ +#define purple_debug_error(category, ...) \ + purple_debug(PURPLE_DEBUG_ERROR, category, __VA_ARGS__) /** * Outputs fatal error level debug information. * - * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_ERROR as + * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_FATAL as * the level. * * @param category The category (or @c NULL). @@ -139,21 +184,11 @@ * * @see purple_debug() */ +/* void purple_debug_fatal(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3); - -/** - * Enable or disable printing debug output to the console. - * - * @param enabled TRUE to enable debug output or FALSE to disable it. - */ -void purple_debug_set_enabled(gboolean enabled); - -/** - * Check if console debug output is enabled. - * - * @return TRUE if debugging is enabled, FALSE if it is not. - */ -gboolean purple_debug_is_enabled(void); +*/ +#define purple_debug_fatal(category, ...) \ + purple_debug(PURPLE_DEBUG_FATAL, category, __VA_ARGS__) /** * Enable or disable verbose debugging. This ordinarily should only be called @@ -220,18 +255,6 @@ /*@}*/ -/**************************************************************************/ -/** @name Debug Subsystem */ -/**************************************************************************/ -/*@{*/ - -/** - * Initializes the debug subsystem. - */ -void purple_debug_init(void); - -/*@}*/ - #ifdef __cplusplus } #endif diff -ru extract/pidgin-2.6.4/libpurple/dnsquery.c libpurple/dnsquery.c --- extract/pidgin-2.6.4/libpurple/dnsquery.c 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/dnsquery.c 2009-12-06 00:38:31.000000000 +0100 @@ -37,9 +37,6 @@ #include #endif -#if (defined(__APPLE__) || defined (__unix__)) && !defined(__osf__) -#define PURPLE_DNSQUERY_USE_FORK -#endif /************************************************************************** * DNS query API **************************************************************************/ @@ -846,7 +843,7 @@ query_data = data; query_data->timeout = 0; - if (purple_dnsquery_ui_resolve(query_data)) + g_return_val_if_fail(purple_dnsquery_ui_resolve(query_data), FALSE); { /* The UI is handling the resolve; we're done */ return FALSE; @@ -927,6 +924,7 @@ return FALSE; } +#if 0 if (!inet_aton(query_data->hostname, &sin.sin_addr)) { struct hostent *hp; gchar *hostname; @@ -965,7 +963,7 @@ hosts = g_slist_append(hosts, g_memdup(&sin, sizeof(sin))); purple_dnsquery_resolved(query_data, hosts); - +#endif return FALSE; } diff -ru extract/pidgin-2.6.4/libpurple/ft.c libpurple/ft.c --- extract/pidgin-2.6.4/libpurple/ft.c 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/ft.c 2009-12-06 00:38:31.000000000 +0100 @@ -214,7 +214,7 @@ void purple_xfer_conversation_write(PurpleXfer *xfer, char *message, gboolean is_error) { PurpleConversation *conv = NULL; - PurpleMessageFlags flags = PURPLE_MESSAGE_SYSTEM; + PurpleMessageFlags flags = PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY; char *escaped; g_return_if_fail(xfer != NULL); Only in libpurple: gettext.c Only in libpurple: gettext.h diff -ru extract/pidgin-2.6.4/libpurple/internal.h libpurple/internal.h --- extract/pidgin-2.6.4/libpurple/internal.h 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/internal.h 2009-10-25 21:34:43.000000000 +0100 @@ -45,23 +45,21 @@ * taken from an email to the texinfo mailing list by Manuel Guerrero. * Thank you Manuel, and thank you Alex's good friend Google. */ + +#include +#include "gettext.h" + +#define _(String) (purple_get_text(PACKAGE, String)) +#define N_(String) (String) +#define ngettext(Singular, Plural, Number) dngettext(PACKAGE, Singular, Plural, Number) +#define dngettext(Domain, Singular, Plural, Number) (purple_get_plural_text(Domain, Singular, Plural, Number)) + #ifdef ENABLE_NLS -# include # include -# define _(String) ((const char *)dgettext(PACKAGE, String)) # ifdef gettext_noop +# undef N_ # define N_(String) gettext_noop (String) -# else -# define N_(String) (String) # endif -#else -# include -# define N_(String) (String) -# ifndef _ -# define _(String) ((const char *)String) -# endif -# define ngettext(Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural)) -# define dngettext(Domain, Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural)) #endif #ifdef HAVE_ENDIAN_H @@ -75,7 +73,12 @@ #define BUF_LEN MSG_LEN #define BUF_LONG BUF_LEN * 2 +#ifndef WINCE #include +#else +#include +#endif + #include #ifndef _WIN32 #include @@ -99,9 +102,10 @@ #include #endif -#include +#include #ifdef PURPLE_PLUGINS +# include # ifdef HAVE_DLFCN_H # include # endif @@ -230,7 +234,7 @@ # endif #endif -#ifdef HAVE_CONFIG_H +#ifdef SIZEOF_TIME_T #if SIZEOF_TIME_T == 4 # define PURPLE_TIME_T_MODIFIER "lu" #elif SIZEOF_TIME_T == 8 diff -ru extract/pidgin-2.6.4/libpurple/log.c libpurple/log.c --- extract/pidgin-2.6.4/libpurple/log.c 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/log.c 2009-12-18 00:17:04.000000000 +0100 @@ -40,7 +40,9 @@ static PurpleLogLogger *html_logger; static PurpleLogLogger *txt_logger; +#if 0 static PurpleLogLogger *old_logger; +#endif struct _purple_logsize_user { char *name; @@ -59,12 +61,14 @@ static char *html_logger_read(PurpleLog *log, PurpleLogReadFlags *flags); static int html_logger_total_size(PurpleLogType type, const char *name, PurpleAccount *account); +#if 0 static GList *old_logger_list(PurpleLogType type, const char *sn, PurpleAccount *account); static int old_logger_total_size(PurpleLogType type, const char *name, PurpleAccount *account); static char * old_logger_read (PurpleLog *log, PurpleLogReadFlags *flags); static int old_logger_size (PurpleLog *log); static void old_logger_get_log_sets(PurpleLogSetCallback cb, GHashTable *sets); static void old_logger_finalize(PurpleLog *log); +#endif static gsize txt_logger_write(PurpleLog *log, PurpleMessageFlags type, @@ -127,7 +131,7 @@ void purple_log_free(PurpleLog *log) { g_return_if_fail(log); - if (log->logger && log->logger->finalize) + if (txt_logger && html_logger && log->logger && log->logger->finalize) log->logger->finalize(log); g_free(log->name); @@ -680,6 +684,7 @@ purple_log_common_is_deletable); purple_log_logger_add(txt_logger); +#if 0 old_logger = purple_log_logger_new("old", _("Old flat format"), 9, NULL, NULL, @@ -691,6 +696,7 @@ NULL, old_logger_get_log_sets); purple_log_logger_add(old_logger); +#endif purple_signal_register(handle, "log-timestamp", #if SIZEOF_TIME_T == 4 @@ -737,9 +743,11 @@ purple_log_logger_free(txt_logger); txt_logger = NULL; +#if 0 purple_log_logger_remove(old_logger); purple_log_logger_free(old_logger); old_logger = NULL; +#endif g_hash_table_destroy(logsize_users); g_hash_table_destroy(logsize_users_decayed); @@ -835,7 +843,7 @@ fclose(image_file); /* Attempt to not leave half-written files around. */ - unlink(path); + g_unlink(path); } else { @@ -1652,6 +1660,7 @@ } +#if 0 /**************** * OLD LOGGER *** ****************/ @@ -2066,3 +2075,4 @@ purple_stringref_unref(data->pathref); g_slice_free(struct old_logger_data, data); } +#endif Only in libpurple: module.ver.in diff -ru extract/pidgin-2.6.4/libpurple/network.c libpurple/network.c --- extract/pidgin-2.6.4/libpurple/network.c 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/network.c 2009-10-25 19:32:47.000000000 +0100 @@ -24,6 +24,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#ifdef _WIN32 +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0501 +#define INCL_WINSOCK_API_TYPEDEFS 1 +#endif + #include "internal.h" #ifndef _WIN32 @@ -32,7 +38,7 @@ #include #include #include -#else +#elif 0 #include #endif @@ -74,17 +80,16 @@ static NMState nm_state = NM_STATE_UNKNOWN; static gboolean have_nm_state = FALSE; -#elif defined _WIN32 +#elif 0 static int current_network_count; /* Mutex for the other global vars */ static GStaticMutex mutex = G_STATIC_MUTEX_INIT; static gboolean network_initialized = FALSE; static HANDLE network_change_handle = NULL; -static int (WSAAPI *MyWSANSPIoctl) ( - HANDLE hLookup, DWORD dwControlCode, LPVOID lpvInBuffer, - DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, - LPDWORD lpcbBytesReturned, LPWSACOMPLETION lpCompletion) = NULL; +static LPFN_WSANSPIOCTL MyWSANSPIoctl = NULL; +#else +static network_available_callback available_callback = NULL; #endif struct _PurpleNetworkListenData { @@ -493,7 +498,7 @@ return ntohs(addr.sin_port); } -#ifdef _WIN32 +#if 0 #ifndef NS_NLA #define NS_NLA 15 #endif @@ -720,9 +725,12 @@ return FALSE; -#elif defined _WIN32 +#elif 0 return (current_network_count > 0 || force_online); #else + if (available_callback) + return (available_callback()); + return TRUE; #endif } @@ -1003,7 +1011,7 @@ #ifdef HAVE_NETWORKMANAGER GError *error = NULL; #endif -#ifdef _WIN32 +#if 0 GError *err = NULL; gint cnt = wpurple_get_connected_network_count(); @@ -1094,7 +1102,7 @@ dbus_g_connection_unref(nm_conn); #endif -#ifdef _WIN32 +#if 0 g_static_mutex_lock(&mutex); network_initialized = FALSE; if (network_change_handle != NULL) { @@ -1127,3 +1135,15 @@ /* TODO: clean up remaining port mappings, note calling purple_upnp_remove_port_mapping from here doesn't quite work... */ } + +void +purple_network_configuration_changed(void) +{ + purple_signal_emit(purple_network_get_handle(), "network-configuration-changed", NULL); +} + +void +purple_network_set_available_callback(network_available_callback cb) +{ + available_callback = cb; +} diff -ru extract/pidgin-2.6.4/libpurple/network.h libpurple/network.h --- extract/pidgin-2.6.4/libpurple/network.h 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/network.h 2009-10-25 19:20:33.000000000 +0100 @@ -296,6 +296,24 @@ */ void purple_network_uninit(void); +/** + * Emits the network-configuration-changed signal + */ +void +purple_network_configuration_changed(void); + +/** + * Function pointer to a function indicating if network is available + */ +typedef gboolean (*network_available_callback)(void); + +/** + * Sets the callback function to be used to query the UI about the + * availability of the network. + */ +void +purple_network_set_available_callback(network_available_callback cb); + /*@}*/ #ifdef __cplusplus diff -ru extract/pidgin-2.6.4/libpurple/notify.c libpurple/notify.c --- extract/pidgin-2.6.4/libpurple/notify.c 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/notify.c 2009-12-01 16:57:52.000000000 +0100 @@ -28,6 +28,7 @@ #include "internal.h" #include "dbus-maybe.h" #include "notify.h" +#include "debug.h" static PurpleNotifyUiOps *notify_ui_ops = NULL; static GList *handles = NULL; @@ -85,6 +86,18 @@ } } + else { + int level; + if (type == PURPLE_NOTIFY_MSG_ERROR) + level = PURPLE_DEBUG_ERROR; + else if (type == PURPLE_NOTIFY_MSG_WARNING) + level = PURPLE_DEBUG_WARNING; + else + level = PURPLE_DEBUG_INFO; + purple_debug(level, "notify", "Notification: %s (%s)", + title ? title : "(null)", + primary ? primary : "(null)"); + } if (cb != NULL) cb(user_data); diff -ru extract/pidgin-2.6.4/libpurple/plugin.c libpurple/plugin.c --- extract/pidgin-2.6.4/libpurple/plugin.c 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/plugin.c 2009-10-25 19:33:41.000000000 +0100 @@ -33,7 +33,6 @@ #include "request.h" #include "signals.h" #include "util.h" -#include "valgrind.h" #include "version.h" typedef struct @@ -799,9 +798,9 @@ void purple_plugin_destroy(PurplePlugin *plugin) { -#ifdef PURPLE_PLUGINS g_return_if_fail(plugin != NULL); +#ifdef PURPLE_PLUGINS if (purple_plugin_is_loaded(plugin)) purple_plugin_unload(plugin); @@ -897,6 +896,17 @@ loader_info->destroy(plugin); } } +#else + if (plugin->info != NULL) { + if (PURPLE_IS_PROTOCOL_PLUGIN(plugin)) + protocol_plugins = g_list_remove(protocol_plugins, plugin); + + if (plugin->info->unload) + plugin->info->unload(plugin); + } + + plugins = g_list_remove(plugins, plugin); +#endif /* !PURPLE_PLUGINS */ g_free(plugin->path); g_free(plugin->error); @@ -904,7 +914,6 @@ PURPLE_DBUS_UNREGISTER_POINTER(plugin); g_free(plugin); -#endif /* !PURPLE_PLUGINS */ } gboolean @@ -1190,7 +1199,9 @@ purple_plugins_init(void) { void *handle = purple_plugins_get_handle(); +#ifdef LIBDIR purple_plugins_add_search_path(LIBDIR); +#endif purple_signal_register(handle, "plugin-load", purple_marshal_VOID__POINTER, @@ -1267,14 +1278,11 @@ void purple_plugins_destroy_all(void) { -#ifdef PURPLE_PLUGINS - while (plugins != NULL) purple_plugin_destroy(plugins->data); - -#endif /* PURPLE_PLUGINS */ } +#if 0 void purple_plugins_save_loaded(const char *key) { @@ -1356,6 +1364,7 @@ g_list_free(files); #endif /* PURPLE_PLUGINS */ } +#endif void diff -ru extract/pidgin-2.6.4/libpurple/plugin.h libpurple/plugin.h --- extract/pidgin-2.6.4/libpurple/plugin.h 2009-11-30 04:13:47.000000000 +0100 +++ libpurple/plugin.h 2009-10-25 19:20:33.000000000 +0100 @@ -29,8 +29,10 @@ #ifndef _PURPLE_PLUGIN_H_ #define _PURPLE_PLUGIN_H_ -#include -#include +#include +#ifdef PURPLE_PLUGINS +# include +#endif #include "signals.h" #include "value.h" @@ -217,6 +219,7 @@ /** * Handles the initialization of modules. */ +#if 0 #if !defined(PURPLE_PLUGINS) || defined(PURPLE_STATIC_PRPL) # define _FUNC_NAME(x) purple_init_##x##_plugin # define PURPLE_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ @@ -237,7 +240,21 @@ return purple_plugin_register(plugin); \ } #endif +#endif +#ifdef PURPLE_STATIC_PRPL +# define _FUNC_NAME(x) purple_init_##x##_plugin +#else +# define _FUNC_NAME(x) purple_plugin_register_self +#endif + +#define PURPLE_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ + gboolean _FUNC_NAME(pluginname)(void) { \ + PurplePlugin *plugin = purple_plugin_new(TRUE, NULL); \ + plugin->info = &(plugininfo); \ + initfunc((plugin)); \ + return purple_plugin_register(plugin); \ + } #ifdef __cplusplus extern "C" { @@ -536,21 +553,6 @@ void purple_plugins_destroy_all(void); /** - * Saves the list of loaded plugins to the specified preference key - * - * @param key The preference key to save the list of plugins to. - */ -void purple_plugins_save_loaded(const char *key); - -/** - * Attempts to load all the plugins in the specified preference key - * that were loaded when purple last quit. - * - * @param key The preference key containing the list of plugins. - */ -void purple_plugins_load_saved(const char *key); - -/** * Probes for plugins in the registered module paths. * * @param ext The extension type to probe for, or @c NULL for all. diff -ru extract/pidgin-2.6.4/libpurple/prefs.c libpurple/prefs.c --- extract/pidgin-2.6.4/libpurple/prefs.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/prefs.c 2009-10-25 19:38:02.000000000 +0100 @@ -40,1337 +40,261 @@ #include "win32dep.h" #endif +static PurplePrefsUiOps *prefs_ui_ops = NULL; + struct pref_cb { PurplePrefCallback func; gpointer data; guint id; void *handle; -}; - -/* TODO: This should use PurpleValues? */ -struct purple_pref { - PurplePrefType type; + void *observer; char *name; - union { - gpointer generic; - gboolean boolean; - int integer; - char *string; - GList *stringlist; - } value; - GSList *callbacks; - struct purple_pref *parent; - struct purple_pref *sibling; - struct purple_pref *first_child; -}; - - -static struct purple_pref prefs = { - PURPLE_PREF_NONE, - NULL, - { NULL }, - NULL, - NULL, - NULL, - NULL }; -static GHashTable *prefs_hash = NULL; static guint save_timer = 0; static gboolean prefs_loaded = FALSE; - - -/********************************************************************* - * Private utility functions * - *********************************************************************/ - -static struct -purple_pref *find_pref(const char *name) -{ - g_return_val_if_fail(name != NULL && name[0] == '/', NULL); - - if (name[1] == '\0') - return &prefs; - else - { - /* When we're initializing, the debug system is - * initialized before the prefs system, but debug - * calls will end up calling prefs functions, so we - * need to deal cleanly here. */ - if (prefs_hash) - return g_hash_table_lookup(prefs_hash, name); - else - return NULL; - } -} - - -/********************************************************************* - * Writing to disk * - *********************************************************************/ - -/* - * This function recursively creates the xmlnode tree from the prefs - * tree structure. Yay recursion! - */ -static void -pref_to_xmlnode(xmlnode *parent, struct purple_pref *pref) -{ - xmlnode *node, *childnode; - struct purple_pref *child; - char buf[21]; - GList *cur; - - /* Create a new node */ - node = xmlnode_new_child(parent, "pref"); - xmlnode_set_attrib(node, "name", pref->name); - - /* Set the type of this node (if type == PURPLE_PREF_NONE then do nothing) */ - if (pref->type == PURPLE_PREF_INT) { - xmlnode_set_attrib(node, "type", "int"); - g_snprintf(buf, sizeof(buf), "%d", pref->value.integer); - xmlnode_set_attrib(node, "value", buf); - } - else if (pref->type == PURPLE_PREF_STRING) { - xmlnode_set_attrib(node, "type", "string"); - xmlnode_set_attrib(node, "value", pref->value.string ? pref->value.string : ""); - } - else if (pref->type == PURPLE_PREF_STRING_LIST) { - xmlnode_set_attrib(node, "type", "stringlist"); - for (cur = pref->value.stringlist; cur != NULL; cur = cur->next) - { - childnode = xmlnode_new_child(node, "item"); - xmlnode_set_attrib(childnode, "value", cur->data ? cur->data : ""); - } - } - else if (pref->type == PURPLE_PREF_PATH) { - char *encoded = g_filename_to_utf8(pref->value.string ? pref->value.string : "", -1, NULL, NULL, NULL); - xmlnode_set_attrib(node, "type", "path"); - xmlnode_set_attrib(node, "value", encoded); - g_free(encoded); - } - else if (pref->type == PURPLE_PREF_PATH_LIST) { - xmlnode_set_attrib(node, "type", "pathlist"); - for (cur = pref->value.stringlist; cur != NULL; cur = cur->next) - { - char *encoded = g_filename_to_utf8(cur->data ? cur->data : "", -1, NULL, NULL, NULL); - childnode = xmlnode_new_child(node, "item"); - xmlnode_set_attrib(childnode, "value", encoded); - g_free(encoded); - } - } - else if (pref->type == PURPLE_PREF_BOOLEAN) { - xmlnode_set_attrib(node, "type", "bool"); - g_snprintf(buf, sizeof(buf), "%d", pref->value.boolean); - xmlnode_set_attrib(node, "value", buf); - } - - /* All My Children */ - for (child = pref->first_child; child != NULL; child = child->sibling) - pref_to_xmlnode(node, child); -} - -static xmlnode * -prefs_to_xmlnode(void) -{ - xmlnode *node; - struct purple_pref *pref, *child; - - pref = &prefs; - - /* Create the root preference node */ - node = xmlnode_new("pref"); - xmlnode_set_attrib(node, "version", "1"); - xmlnode_set_attrib(node, "name", "/"); - - /* All My Children */ - for (child = pref->first_child; child != NULL; child = child->sibling) - pref_to_xmlnode(node, child); - - return node; -} - -static void -sync_prefs(void) -{ - xmlnode *node; - char *data; - - if (!prefs_loaded) - { - /* - * TODO: Call schedule_prefs_save()? Ideally we wouldn't need to. - * (prefs.xml should be loaded when purple_prefs_init is called) - */ - purple_debug_error("prefs", "Attempted to save prefs before " - "they were read!\n"); - return; - } - - node = prefs_to_xmlnode(); - data = xmlnode_to_formatted_str(node, NULL); - purple_util_write_data_to_file("prefs.xml", data, -1); - g_free(data); - xmlnode_free(node); -} +static GSList *callbacks = NULL; static gboolean save_cb(gpointer data) { - sync_prefs(); + PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops(); + g_return_val_if_fail(uiop, FALSE); + uiop->save(); + save_timer = 0; return FALSE; } -static void -schedule_prefs_save(void) -{ - if (save_timer == 0) - save_timer = purple_timeout_add_seconds(5, save_cb, NULL); -} - - /********************************************************************* * Reading from disk * *********************************************************************/ -static GList *prefs_stack = NULL; - -static void -prefs_start_element_handler (GMarkupParseContext *context, - const gchar *element_name, - const gchar **attribute_names, - const gchar **attribute_values, - gpointer user_data, - GError **error) -{ - PurplePrefType pref_type = PURPLE_PREF_NONE; - int i; - const char *pref_name = NULL, *pref_value = NULL; - GString *pref_name_full; - GList *tmp; - - if(!purple_strequal(element_name, "pref") && - !purple_strequal(element_name, "item")) - return; - - for(i = 0; attribute_names[i]; i++) { - if(purple_strequal(attribute_names[i], "name")) { - pref_name = attribute_values[i]; - } else if(purple_strequal(attribute_names[i], "type")) { - if(purple_strequal(attribute_values[i], "bool")) - pref_type = PURPLE_PREF_BOOLEAN; - else if(purple_strequal(attribute_values[i], "int")) - pref_type = PURPLE_PREF_INT; - else if(purple_strequal(attribute_values[i], "string")) - pref_type = PURPLE_PREF_STRING; - else if(purple_strequal(attribute_values[i], "stringlist")) - pref_type = PURPLE_PREF_STRING_LIST; - else if(purple_strequal(attribute_values[i], "path")) - pref_type = PURPLE_PREF_PATH; - else if(purple_strequal(attribute_values[i], "pathlist")) - pref_type = PURPLE_PREF_PATH_LIST; - else - return; - } else if(purple_strequal(attribute_names[i], "value")) { - pref_value = attribute_values[i]; - } - } - - if(purple_strequal(element_name, "item")) { - struct purple_pref *pref; - - pref_name_full = g_string_new(""); - - for(tmp = prefs_stack; tmp; tmp = tmp->next) { - pref_name_full = g_string_prepend(pref_name_full, tmp->data); - pref_name_full = g_string_prepend_c(pref_name_full, '/'); - } - - pref = find_pref(pref_name_full->str); - - if(pref) { - if(pref->type == PURPLE_PREF_STRING_LIST) { - pref->value.stringlist = g_list_append(pref->value.stringlist, - g_strdup(pref_value)); - } else if(pref->type == PURPLE_PREF_PATH_LIST) { - pref->value.stringlist = g_list_append(pref->value.stringlist, - g_filename_from_utf8(pref_value, -1, NULL, NULL, NULL)); - } - } - g_string_free(pref_name_full, TRUE); - } else { - char *decoded; - - if(!pref_name || purple_strequal(pref_name, "/")) - return; - - pref_name_full = g_string_new(pref_name); - - for(tmp = prefs_stack; tmp; tmp = tmp->next) { - pref_name_full = g_string_prepend_c(pref_name_full, '/'); - pref_name_full = g_string_prepend(pref_name_full, tmp->data); - } - - pref_name_full = g_string_prepend_c(pref_name_full, '/'); - - switch(pref_type) { - case PURPLE_PREF_NONE: - purple_prefs_add_none(pref_name_full->str); - break; - case PURPLE_PREF_BOOLEAN: - purple_prefs_set_bool(pref_name_full->str, atoi(pref_value)); - break; - case PURPLE_PREF_INT: - purple_prefs_set_int(pref_name_full->str, atoi(pref_value)); - break; - case PURPLE_PREF_STRING: - purple_prefs_set_string(pref_name_full->str, pref_value); - break; - case PURPLE_PREF_STRING_LIST: - purple_prefs_set_string_list(pref_name_full->str, NULL); - break; - case PURPLE_PREF_PATH: - if (pref_value) { - decoded = g_filename_from_utf8(pref_value, -1, NULL, NULL, NULL); - purple_prefs_set_path(pref_name_full->str, decoded); - g_free(decoded); - } else { - purple_prefs_set_path(pref_name_full->str, NULL); - } - break; - case PURPLE_PREF_PATH_LIST: - purple_prefs_set_path_list(pref_name_full->str, NULL); - break; - } - prefs_stack = g_list_prepend(prefs_stack, g_strdup(pref_name)); - g_string_free(pref_name_full, TRUE); - } -} - -static void -prefs_end_element_handler(GMarkupParseContext *context, - const gchar *element_name, - gpointer user_data, GError **error) -{ - if(prefs_stack && purple_strequal(element_name, "pref")) { - g_free(prefs_stack->data); - prefs_stack = g_list_delete_link(prefs_stack, prefs_stack); - } -} - -static GMarkupParser prefs_parser = { - prefs_start_element_handler, - prefs_end_element_handler, - NULL, - NULL, - NULL -}; - gboolean purple_prefs_load() { - gchar *filename = g_build_filename(purple_user_dir(), "prefs.xml", NULL); - gchar *contents = NULL; - gsize length; - GMarkupParseContext *context; - GError *error = NULL; - - if (!filename) { - prefs_loaded = TRUE; - return FALSE; - } - - purple_debug_info("prefs", "Reading %s\n", filename); - - if(!g_file_get_contents(filename, &contents, &length, &error)) { -#ifdef _WIN32 - gchar *common_appdata = wpurple_get_special_folder(CSIDL_COMMON_APPDATA); -#endif - g_free(filename); - g_error_free(error); - - error = NULL; - -#ifdef _WIN32 - filename = g_build_filename(common_appdata ? common_appdata : "", "purple", "prefs.xml", NULL); - g_free(common_appdata); -#else - filename = g_build_filename(SYSCONFDIR, "purple", "prefs.xml", NULL); -#endif - - purple_debug_info("prefs", "Reading %s\n", filename); - - if (!g_file_get_contents(filename, &contents, &length, &error)) { - purple_debug_error("prefs", "Error reading prefs: %s\n", - error->message); - g_error_free(error); - g_free(filename); - prefs_loaded = TRUE; - - return FALSE; - } - } - - context = g_markup_parse_context_new(&prefs_parser, 0, NULL, NULL); - - if(!g_markup_parse_context_parse(context, contents, length, NULL)) { - g_markup_parse_context_free(context); - g_free(contents); - g_free(filename); - prefs_loaded = TRUE; - - return FALSE; - } - - if(!g_markup_parse_context_end_parse(context, NULL)) { - purple_debug_error("prefs", "Error parsing %s\n", filename); - g_markup_parse_context_free(context); - g_free(contents); - g_free(filename); - prefs_loaded = TRUE; - - return FALSE; - } - - purple_debug_info("prefs", "Finished reading %s\n", filename); - g_markup_parse_context_free(context); - g_free(contents); - g_free(filename); prefs_loaded = TRUE; return TRUE; } - - static void prefs_save_cb(const char *name, PurplePrefType type, gconstpointer val, gpointer user_data) { - - if(!prefs_loaded) + if (!prefs_loaded) return; purple_debug_misc("prefs", "%s changed, scheduling save.\n", name); - schedule_prefs_save(); -} - -static char * -get_path_dirname(const char *name) -{ - char *c, *str; - - str = g_strdup(name); - - if ((c = strrchr(str, '/')) != NULL) { - *c = '\0'; - - if (*str == '\0') { - g_free(str); - - str = g_strdup("/"); - } - } - else { - g_free(str); - - str = g_strdup("."); - } - - return str; -} - -static char * -get_path_basename(const char *name) -{ - const char *c; - - if ((c = strrchr(name, '/')) != NULL) - return g_strdup(c + 1); - - return g_strdup(name); -} - -static char * -pref_full_name(struct purple_pref *pref) -{ - GString *name; - struct purple_pref *parent; - - if(!pref) - return NULL; - - if(pref == &prefs) - return g_strdup("/"); - - name = g_string_new(pref->name); - parent = pref->parent; - - for(parent = pref->parent; parent && parent->name; parent = parent->parent) { - name = g_string_prepend_c(name, '/'); - name = g_string_prepend(name, parent->name); - } - name = g_string_prepend_c(name, '/'); - return g_string_free(name, FALSE); -} - -static struct purple_pref * -find_pref_parent(const char *name) -{ - char *parent_name = get_path_dirname(name); - struct purple_pref *ret = &prefs; - - if(!purple_strequal(parent_name, "/")) { - ret = find_pref(parent_name); - } - - g_free(parent_name); - return ret; -} - -static void -free_pref_value(struct purple_pref *pref) -{ - switch(pref->type) { - case PURPLE_PREF_BOOLEAN: - pref->value.boolean = FALSE; - break; - case PURPLE_PREF_INT: - pref->value.integer = 0; - break; - case PURPLE_PREF_STRING: - case PURPLE_PREF_PATH: - g_free(pref->value.string); - pref->value.string = NULL; - break; - case PURPLE_PREF_STRING_LIST: - case PURPLE_PREF_PATH_LIST: - { - g_list_foreach(pref->value.stringlist, (GFunc)g_free, NULL); - g_list_free(pref->value.stringlist); - } break; - case PURPLE_PREF_NONE: - break; - } + if (save_timer == 0) + save_timer = purple_timeout_add_seconds(6, save_cb, NULL); } -static struct purple_pref * -add_pref(PurplePrefType type, const char *name) -{ - struct purple_pref *parent; - struct purple_pref *me; - struct purple_pref *sibling; - char *my_name; - - parent = find_pref_parent(name); - - if(!parent) - return NULL; - - my_name = get_path_basename(name); - - for(sibling = parent->first_child; sibling; sibling = sibling->sibling) { - if(purple_strequal(sibling->name, my_name)) { - g_free(my_name); - return NULL; - } - } - - me = g_new0(struct purple_pref, 1); - me->type = type; - me->name = my_name; - - me->parent = parent; - if(parent->first_child) { - /* blatant abuse of a for loop */ - for(sibling = parent->first_child; sibling->sibling; - sibling = sibling->sibling); - sibling->sibling = me; - } else { - parent->first_child = me; +#define UIOP(aCall) \ + { \ + PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops(); \ + g_return_if_fail(uiop); \ + \ + uiop->aCall; \ + } + +#define UIOP_return(aCall, aDefault) \ + { \ + PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops(); \ + g_return_val_if_fail(uiop, aDefault); \ + \ + return uiop->aCall; \ } - g_hash_table_insert(prefs_hash, g_strdup(name), (gpointer)me); - - return me; -} - void purple_prefs_add_none(const char *name) -{ - add_pref(PURPLE_PREF_NONE, name); -} + UIOP(add_none(name)) void purple_prefs_add_bool(const char *name, gboolean value) -{ - struct purple_pref *pref = add_pref(PURPLE_PREF_BOOLEAN, name); - - if(!pref) - return; - - pref->value.boolean = value; -} + UIOP(add_bool(name, value)) void purple_prefs_add_int(const char *name, int value) -{ - struct purple_pref *pref = add_pref(PURPLE_PREF_INT, name); - - if(!pref) - return; - - pref->value.integer = value; -} + UIOP(add_int(name, value)) void purple_prefs_add_string(const char *name, const char *value) -{ - struct purple_pref *pref; - - if(value != NULL && !g_utf8_validate(value, -1, NULL)) { - purple_debug_error("prefs", "purple_prefs_add_string: Cannot store invalid UTF8 for string pref %s\n", name); - return; - } - - pref = add_pref(PURPLE_PREF_STRING, name); - - if(!pref) - return; - - pref->value.string = g_strdup(value); -} - -void -purple_prefs_add_string_list(const char *name, GList *value) -{ - struct purple_pref *pref = add_pref(PURPLE_PREF_STRING_LIST, name); - GList *tmp; - - if(!pref) - return; - - for(tmp = value; tmp; tmp = tmp->next) { - if(tmp->data != NULL && !g_utf8_validate(tmp->data, -1, NULL)) { - purple_debug_error("prefs", "purple_prefs_add_string_list: Skipping invalid UTF8 for string list pref %s\n", name); - continue; - } - pref->value.stringlist = g_list_append(pref->value.stringlist, - g_strdup(tmp->data)); - } -} - -void -purple_prefs_add_path(const char *name, const char *value) -{ - struct purple_pref *pref = add_pref(PURPLE_PREF_PATH, name); - - if(!pref) - return; - - pref->value.string = g_strdup(value); -} - -void -purple_prefs_add_path_list(const char *name, GList *value) -{ - struct purple_pref *pref = add_pref(PURPLE_PREF_PATH_LIST, name); - GList *tmp; - - if(!pref) - return; - - for(tmp = value; tmp; tmp = tmp->next) - pref->value.stringlist = g_list_append(pref->value.stringlist, - g_strdup(tmp->data)); -} - - -static void -remove_pref(struct purple_pref *pref) -{ - char *name; - GSList *l; - - if(!pref) - return; - - while(pref->first_child) - remove_pref(pref->first_child); - - if(pref == &prefs) - return; - - if(pref->parent->first_child == pref) { - pref->parent->first_child = pref->sibling; - } else { - struct purple_pref *sib = pref->parent->first_child; - while(sib && sib->sibling != pref) - sib = sib->sibling; - if(sib) - sib->sibling = pref->sibling; - } - - name = pref_full_name(pref); - - if (prefs_loaded) - purple_debug_info("prefs", "removing pref %s\n", name); - - g_hash_table_remove(prefs_hash, name); - g_free(name); - - free_pref_value(pref); - - while((l = pref->callbacks) != NULL) { - pref->callbacks = pref->callbacks->next; - g_free(l->data); - g_slist_free_1(l); - } - g_free(pref->name); - g_free(pref); -} + UIOP(add_string(name, value)) void purple_prefs_remove(const char *name) -{ - struct purple_pref *pref = find_pref(name); - - if(!pref) - return; - - remove_pref(pref); -} - -void -purple_prefs_destroy() -{ - purple_prefs_remove("/"); -} - -static void -do_callbacks(const char* name, struct purple_pref *pref) -{ - GSList *cbs; - struct purple_pref *cb_pref; - for(cb_pref = pref; cb_pref; cb_pref = cb_pref->parent) { - for(cbs = cb_pref->callbacks; cbs; cbs = cbs->next) { - struct pref_cb *cb = cbs->data; - cb->func(name, pref->type, pref->value.generic, cb->data); - } - } -} + UIOP(remove(name)) void purple_prefs_trigger_callback(const char *name) { - struct purple_pref *pref = find_pref(name); - - if(!pref) { - purple_debug_error("prefs", - "purple_prefs_trigger_callback: Unknown pref %s\n", name); - return; - } - - do_callbacks(name, pref); -} + GSList *cbs; -void -purple_prefs_set_generic(const char *name, gpointer value) -{ - struct purple_pref *pref = find_pref(name); + purple_debug_misc("prefs", "trigger callback %s\n", name); - if(!pref) { - purple_debug_error("prefs", - "purple_prefs_set_generic: Unknown pref %s\n", name); - return; + for (cbs = callbacks; cbs; cbs = cbs->next) { + const char *cb_name = ((struct pref_cb *)cbs->data)->name; + size_t len = strlen(cb_name); + if (!strncmp(cb_name, name, len) && + (name[len] == 0 || name[len] == '/' || + (len && name[len - 1] == '/'))) { + /* This test should behave like this: + * name = /toto/tata + * cb_name = /toto/tata --> true + * cb_name = /toto/tatatiti --> false + * cb_name = / --> true + * cb_name = /toto --> true + * cb_name = /toto/ --> true + */ + purple_prefs_observe(cbs->data); + } } - - pref->value.generic = value; - do_callbacks(name, pref); } void purple_prefs_set_bool(const char *name, gboolean value) -{ - struct purple_pref *pref = find_pref(name); - - if(pref) { - if(pref->type != PURPLE_PREF_BOOLEAN) { - purple_debug_error("prefs", - "purple_prefs_set_bool: %s not a boolean pref\n", name); - return; - } - - if(pref->value.boolean != value) { - pref->value.boolean = value; - do_callbacks(name, pref); - } - } else { - purple_prefs_add_bool(name, value); - } -} + UIOP(set_bool(name, value)) void purple_prefs_set_int(const char *name, int value) -{ - struct purple_pref *pref = find_pref(name); - - if(pref) { - if(pref->type != PURPLE_PREF_INT) { - purple_debug_error("prefs", - "purple_prefs_set_int: %s not an integer pref\n", name); - return; - } - - if(pref->value.integer != value) { - pref->value.integer = value; - do_callbacks(name, pref); - } - } else { - purple_prefs_add_int(name, value); - } -} + UIOP(set_int(name, value)) void purple_prefs_set_string(const char *name, const char *value) -{ - struct purple_pref *pref = find_pref(name); - - if(value != NULL && !g_utf8_validate(value, -1, NULL)) { - purple_debug_error("prefs", "purple_prefs_set_string: Cannot store invalid UTF8 for string pref %s\n", name); - return; - } - - if(pref) { - if(pref->type != PURPLE_PREF_STRING && pref->type != PURPLE_PREF_PATH) { - purple_debug_error("prefs", - "purple_prefs_set_string: %s not a string pref\n", name); - return; - } - - if (!purple_strequal(pref->value.string, value)) { - g_free(pref->value.string); - pref->value.string = g_strdup(value); - do_callbacks(name, pref); - } - } else { - purple_prefs_add_string(name, value); - } -} - -void -purple_prefs_set_string_list(const char *name, GList *value) -{ - struct purple_pref *pref = find_pref(name); - if(pref) { - GList *tmp; - - if(pref->type != PURPLE_PREF_STRING_LIST) { - purple_debug_error("prefs", - "purple_prefs_set_string_list: %s not a string list pref\n", - name); - return; - } - - g_list_foreach(pref->value.stringlist, (GFunc)g_free, NULL); - g_list_free(pref->value.stringlist); - pref->value.stringlist = NULL; - - for(tmp = value; tmp; tmp = tmp->next) { - if(tmp->data != NULL && !g_utf8_validate(tmp->data, -1, NULL)) { - purple_debug_error("prefs", "purple_prefs_set_string_list: Skipping invalid UTF8 for string list pref %s\n", name); - continue; - } - pref->value.stringlist = g_list_prepend(pref->value.stringlist, - g_strdup(tmp->data)); - } - pref->value.stringlist = g_list_reverse(pref->value.stringlist); - - do_callbacks(name, pref); - - } else { - purple_prefs_add_string_list(name, value); - } -} - -void -purple_prefs_set_path(const char *name, const char *value) -{ - struct purple_pref *pref = find_pref(name); - - if(pref) { - if(pref->type != PURPLE_PREF_PATH) { - purple_debug_error("prefs", - "purple_prefs_set_path: %s not a path pref\n", name); - return; - } - - if (!purple_strequal(pref->value.string, value)) { - g_free(pref->value.string); - pref->value.string = g_strdup(value); - do_callbacks(name, pref); - } - } else { - purple_prefs_add_path(name, value); - } -} - -void -purple_prefs_set_path_list(const char *name, GList *value) -{ - struct purple_pref *pref = find_pref(name); - if(pref) { - GList *tmp; - - if(pref->type != PURPLE_PREF_PATH_LIST) { - purple_debug_error("prefs", - "purple_prefs_set_path_list: %s not a path list pref\n", - name); - return; - } - - g_list_foreach(pref->value.stringlist, (GFunc)g_free, NULL); - g_list_free(pref->value.stringlist); - pref->value.stringlist = NULL; - - for(tmp = value; tmp; tmp = tmp->next) - pref->value.stringlist = g_list_prepend(pref->value.stringlist, - g_strdup(tmp->data)); - pref->value.stringlist = g_list_reverse(pref->value.stringlist); - - do_callbacks(name, pref); - - } else { - purple_prefs_add_path_list(name, value); - } -} - + UIOP(set_string(name, value)) gboolean purple_prefs_exists(const char *name) -{ - struct purple_pref *pref = find_pref(name); - - if (pref != NULL) - return TRUE; - - return FALSE; -} + UIOP_return(exists(name), FALSE) PurplePrefType purple_prefs_get_type(const char *name) -{ - struct purple_pref *pref = find_pref(name); - - if (pref == NULL) - return PURPLE_PREF_NONE; - - return (pref->type); -} + UIOP_return(get_type(name), PURPLE_PREF_NONE) gboolean purple_prefs_get_bool(const char *name) -{ - struct purple_pref *pref = find_pref(name); - - if(!pref) { - purple_debug_error("prefs", - "purple_prefs_get_bool: Unknown pref %s\n", name); - return FALSE; - } else if(pref->type != PURPLE_PREF_BOOLEAN) { - purple_debug_error("prefs", - "purple_prefs_get_bool: %s not a boolean pref\n", name); - return FALSE; - } - - return pref->value.boolean; -} + UIOP_return(get_bool(name), FALSE) int purple_prefs_get_int(const char *name) -{ - struct purple_pref *pref = find_pref(name); - - if(!pref) { - purple_debug_error("prefs", - "purple_prefs_get_int: Unknown pref %s\n", name); - return 0; - } else if(pref->type != PURPLE_PREF_INT) { - purple_debug_error("prefs", - "purple_prefs_get_int: %s not an integer pref\n", name); - return 0; - } - - return pref->value.integer; -} + UIOP_return(get_int(name), 0) const char * purple_prefs_get_string(const char *name) -{ - struct purple_pref *pref = find_pref(name); - - if(!pref) { - purple_debug_error("prefs", - "purple_prefs_get_string: Unknown pref %s\n", name); - return NULL; - } else if(pref->type != PURPLE_PREF_STRING) { - purple_debug_error("prefs", - "purple_prefs_get_string: %s not a string pref\n", name); - return NULL; - } - - return pref->value.string; -} + UIOP_return(get_string(name), NULL) -GList * -purple_prefs_get_string_list(const char *name) +guint +purple_prefs_connect_callback(void *handle, const char *name, PurplePrefCallback func, gpointer data) { - struct purple_pref *pref = find_pref(name); - GList *ret = NULL, *tmp; - - if(!pref) { - purple_debug_error("prefs", - "purple_prefs_get_string_list: Unknown pref %s\n", name); - return NULL; - } else if(pref->type != PURPLE_PREF_STRING_LIST) { - purple_debug_error("prefs", - "purple_prefs_get_string_list: %s not a string list pref\n", name); - return NULL; - } - - for(tmp = pref->value.stringlist; tmp; tmp = tmp->next) - ret = g_list_prepend(ret, g_strdup(tmp->data)); - ret = g_list_reverse(ret); + struct pref_cb *cb; + static guint cb_id = 0; + PurplePrefsUiOps *uiop = NULL; - return ret; -} + g_return_val_if_fail(name != NULL, 0); + g_return_val_if_fail(func != NULL, 0); -const char * -purple_prefs_get_path(const char *name) -{ - struct purple_pref *pref = find_pref(name); + uiop = purple_prefs_get_ui_ops(); + g_return_val_if_fail(uiop, 0); - if(!pref) { - purple_debug_error("prefs", - "purple_prefs_get_path: Unknown pref %s\n", name); - return NULL; - } else if(pref->type != PURPLE_PREF_PATH) { - purple_debug_error("prefs", - "purple_prefs_get_path: %s not a path pref\n", name); - return NULL; - } + cb = g_new0(struct pref_cb, 1); - return pref->value.string; -} + cb->func = func; + cb->data = data; + cb->id = ++cb_id; + cb->handle = handle; + cb->name = g_strdup(name); -GList * -purple_prefs_get_path_list(const char *name) -{ - struct purple_pref *pref = find_pref(name); - GList *ret = NULL, *tmp; + cb->observer = uiop->add_observer(name, cb); - if(!pref) { - purple_debug_error("prefs", - "purple_prefs_get_path_list: Unknown pref %s\n", name); - return NULL; - } else if(pref->type != PURPLE_PREF_PATH_LIST) { - purple_debug_error("prefs", - "purple_prefs_get_path_list: %s not a path list pref\n", name); - return NULL; + if (cb->observer == NULL) { + purple_debug_error("prefs", "purple_prefs_connect_callback: add observer failed for %s\n", name); + g_free(cb->name); + g_free(cb); + return 0; } - for(tmp = pref->value.stringlist; tmp; tmp = tmp->next) - ret = g_list_prepend(ret, g_strdup(tmp->data)); - ret = g_list_reverse(ret); - - return ret; + callbacks = g_slist_append(callbacks, cb); + return cb->id; } -static void -purple_prefs_rename_node(struct purple_pref *oldpref, struct purple_pref *newpref) +void purple_prefs_observe(gpointer data) { - struct purple_pref *child, *next; - char *oldname, *newname; - - /* if we're a parent, rename the kids first */ - for(child = oldpref->first_child; child != NULL; child = next) - { - struct purple_pref *newchild; - next = child->sibling; - for(newchild = newpref->first_child; newchild != NULL; newchild = newchild->sibling) - { - if(purple_strequal(child->name, newchild->name)) - { - purple_prefs_rename_node(child, newchild); - break; - } - } - if(newchild == NULL) { - /* no rename happened, we weren't able to find the new pref */ - char *tmpname = pref_full_name(child); - purple_debug_error("prefs", "Unable to find rename pref for %s\n", tmpname); - g_free(tmpname); - } - } - - oldname = pref_full_name(oldpref); - newname = pref_full_name(newpref); - - if (oldpref->type != newpref->type) - { - purple_debug_error("prefs", "Unable to rename %s to %s: differing types\n", oldname, newname); - g_free(oldname); - g_free(newname); - return; - } + struct pref_cb *cb = data; + PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops(); + gconstpointer value = NULL; + PurplePrefType type = PURPLE_PREF_NONE; + type = uiop->get_type(cb->name); - purple_debug_info("prefs", "Renaming %s to %s\n", oldname, newname); - g_free(oldname); + purple_debug_misc("prefs", "observe name = %s\n", cb->name); - switch(oldpref->type) { - case PURPLE_PREF_NONE: + switch (type) { + case PURPLE_PREF_INT: + value = GINT_TO_POINTER(uiop->get_int(cb->name)); break; case PURPLE_PREF_BOOLEAN: - purple_prefs_set_bool(newname, oldpref->value.boolean); - break; - case PURPLE_PREF_INT: - purple_prefs_set_int(newname, oldpref->value.integer); + value = GINT_TO_POINTER(uiop->get_bool(cb->name)); break; case PURPLE_PREF_STRING: - purple_prefs_set_string(newname, oldpref->value.string); - break; - case PURPLE_PREF_STRING_LIST: - purple_prefs_set_string_list(newname, oldpref->value.stringlist); - break; - case PURPLE_PREF_PATH: - purple_prefs_set_path(newname, oldpref->value.string); + value = uiop->get_string(cb->name); break; - case PURPLE_PREF_PATH_LIST: - purple_prefs_set_path_list(newname, oldpref->value.stringlist); + case PURPLE_PREF_NONE: break; + default: + purple_debug_error("prefs", "Unexpected type = %i\n", type); } - g_free(newname); - - remove_pref(oldpref); + cb->func(cb->name, type, value, cb->data); } void -purple_prefs_rename(const char *oldname, const char *newname) -{ - struct purple_pref *oldpref, *newpref; - - oldpref = find_pref(oldname); - - /* it's already been renamed, call off the dogs */ - if(!oldpref) - return; - - newpref = find_pref(newname); - - if (newpref == NULL) - { - purple_debug_error("prefs", "Unable to rename %s to %s: new pref not created\n", oldname, newname); - return; - } - - purple_prefs_rename_node(oldpref, newpref); -} - -void -purple_prefs_rename_boolean_toggle(const char *oldname, const char *newname) -{ - struct purple_pref *oldpref, *newpref; - - oldpref = find_pref(oldname); - - /* it's already been renamed, call off the cats */ - if(!oldpref) - return; - - if (oldpref->type != PURPLE_PREF_BOOLEAN) - { - purple_debug_error("prefs", "Unable to rename %s to %s: old pref not a boolean\n", oldname, newname); - return; - } - - if (oldpref->first_child != NULL) /* can't rename parents */ - { - purple_debug_error("prefs", "Unable to rename %s to %s: can't rename parents\n", oldname, newname); - return; - } - - - newpref = find_pref(newname); - - if (newpref == NULL) - { - purple_debug_error("prefs", "Unable to rename %s to %s: new pref not created\n", oldname, newname); - return; - } - - if (oldpref->type != newpref->type) - { - purple_debug_error("prefs", "Unable to rename %s to %s: differing types\n", oldname, newname); - return; - } - - purple_debug_info("prefs", "Renaming and toggling %s to %s\n", oldname, newname); - purple_prefs_set_bool(newname, !(oldpref->value.boolean)); - - remove_pref(oldpref); -} - -guint -purple_prefs_connect_callback(void *handle, const char *name, PurplePrefCallback func, gpointer data) -{ - struct purple_pref *pref; - struct pref_cb *cb; - static guint cb_id = 0; - - g_return_val_if_fail(name != NULL, 0); - g_return_val_if_fail(func != NULL, 0); - - pref = find_pref(name); - if (pref == NULL) { - purple_debug_error("prefs", "purple_prefs_connect_callback: Unknown pref %s\n", name); - return 0; - } - - cb = g_new0(struct pref_cb, 1); - - cb->func = func; - cb->data = data; - cb->id = ++cb_id; - cb->handle = handle; - - pref->callbacks = g_slist_append(pref->callbacks, cb); - - return cb->id; -} - -static gboolean -disco_callback_helper(struct purple_pref *pref, guint callback_id) +purple_prefs_disconnect_callback(guint callback_id) { GSList *cbs; - struct purple_pref *child; - if(!pref) - return FALSE; - - for(cbs = pref->callbacks; cbs; cbs = cbs->next) { + for (cbs = callbacks; cbs; cbs = cbs->next) { struct pref_cb *cb = cbs->data; - if(cb->id == callback_id) { - pref->callbacks = g_slist_delete_link(pref->callbacks, cbs); + if (cb->id == callback_id) { + PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops(); + uiop->remove_observer(cb->name, cb->observer); + + callbacks = g_slist_delete_link(callbacks, cbs); + g_free(cb->name); g_free(cb); - return TRUE; + return; } } - - for(child = pref->first_child; child; child = child->sibling) { - if(disco_callback_helper(child, callback_id)) - return TRUE; - } - - return FALSE; } void -purple_prefs_disconnect_callback(guint callback_id) -{ - disco_callback_helper(&prefs, callback_id); -} - -static void -disco_callback_helper_handle(struct purple_pref *pref, void *handle) +purple_prefs_disconnect_by_handle(void *handle) { GSList *cbs; - struct purple_pref *child; - if(!pref) - return; + g_return_if_fail(handle != NULL); - cbs = pref->callbacks; + cbs = callbacks; while (cbs != NULL) { + PurplePrefsUiOps *uiop; struct pref_cb *cb = cbs->data; - if(cb->handle == handle) { - pref->callbacks = g_slist_delete_link(pref->callbacks, cbs); - g_free(cb); - cbs = pref->callbacks; - } else + if (cb->handle != handle) { cbs = cbs->next; - } - - for(child = pref->first_child; child; child = child->sibling) - disco_callback_helper_handle(child, handle); -} + continue; + } -void -purple_prefs_disconnect_by_handle(void *handle) -{ - g_return_if_fail(handle != NULL); + uiop = purple_prefs_get_ui_ops(); + uiop->remove_observer(cb->name, cb->observer); - disco_callback_helper_handle(&prefs, handle); + callbacks = g_slist_delete_link(callbacks, cbs); + g_free(cb->name); + g_free(cb); + cbs = callbacks; + } } GList * purple_prefs_get_children_names(const char *name) -{ - GList * list = NULL; - struct purple_pref *pref = find_pref(name), *child; - char sep[2] = "\0\0";; - - if (pref == NULL) - return NULL; - - if (name[strlen(name) - 1] != '/') - sep[0] = '/'; - for (child = pref->first_child; child; child = child->sibling) { - list = g_list_append(list, g_strdup_printf("%s%s%s", name, sep, child->name)); - } - return list; -} - -void -purple_prefs_update_old() -{ - purple_prefs_rename("/core", "/purple"); - - /* Remove some no-longer-used prefs */ - purple_prefs_remove("/purple/away/auto_response/enabled"); - purple_prefs_remove("/purple/away/auto_response/idle_only"); - purple_prefs_remove("/purple/away/auto_response/in_active_conv"); - purple_prefs_remove("/purple/away/auto_response/sec_before_resend"); - purple_prefs_remove("/purple/away/auto_response"); - purple_prefs_remove("/purple/away/default_message"); - purple_prefs_remove("/purple/buddies/use_server_alias"); - purple_prefs_remove("/purple/conversations/away_back_on_send"); - purple_prefs_remove("/purple/conversations/send_urls_as_links"); - purple_prefs_remove("/purple/conversations/im/show_login"); - purple_prefs_remove("/purple/conversations/chat/show_join"); - purple_prefs_remove("/purple/conversations/chat/show_leave"); - purple_prefs_remove("/purple/conversations/combine_chat_im"); - purple_prefs_remove("/purple/conversations/use_alias_for_title"); - purple_prefs_remove("/purple/logging/log_signon_signoff"); - purple_prefs_remove("/purple/logging/log_idle_state"); - purple_prefs_remove("/purple/logging/log_away_state"); - purple_prefs_remove("/purple/logging/log_own_states"); - purple_prefs_remove("/purple/status/scores/hidden"); - purple_prefs_remove("/plugins/core/autorecon/hide_connected_error"); - purple_prefs_remove("/plugins/core/autorecon/hide_connecting_error"); - purple_prefs_remove("/plugins/core/autorecon/hide_reconnecting_dialog"); - purple_prefs_remove("/plugins/core/autorecon/restore_state"); - purple_prefs_remove("/plugins/core/autorecon"); - - /* Convert old sounds while_away pref to new 3-way pref. */ - if (purple_prefs_exists("/purple/sound/while_away") && - purple_prefs_get_bool("/purple/sound/while_away")) - { - purple_prefs_set_int("/purple/sound/while_status", 3); - } - purple_prefs_remove("/purple/sound/while_away"); -} + UIOP_return(get_children_names(name), NULL) void * purple_prefs_get_handle(void) @@ -1385,8 +309,6 @@ { void *handle = purple_prefs_get_handle(); - prefs_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); - purple_prefs_connect_callback(handle, "/", prefs_save_cb, NULL); purple_prefs_add_none("/purple"); @@ -1400,31 +322,7 @@ purple_prefs_add_string("/purple/away/idle_reporting", "system"); purple_prefs_add_bool("/purple/away/away_when_idle", TRUE); purple_prefs_add_int("/purple/away/mins_before_away", 5); - - /* Away -> Auto-Reply */ - if (!purple_prefs_exists("/purple/away/auto_response/enabled") || - !purple_prefs_exists("/purple/away/auto_response/idle_only")) - { - purple_prefs_add_string("/purple/away/auto_reply", "awayidle"); - } - else - { - if (!purple_prefs_get_bool("/purple/away/auto_response/enabled")) - { - purple_prefs_add_string("/purple/away/auto_reply", "never"); - } - else - { - if (purple_prefs_get_bool("/purple/away/auto_response/idle_only")) - { - purple_prefs_add_string("/purple/away/auto_reply", "awayidle"); - } - else - { - purple_prefs_add_string("/purple/away/auto_reply", "away"); - } - } - } + purple_prefs_add_string("/purple/away/auto_reply", "awayidle"); /* Buddies */ purple_prefs_add_none("/purple/buddies"); @@ -1437,7 +335,6 @@ purple_prefs_remove("/purple/contact/idle_score"); purple_prefs_load(); - purple_prefs_update_old(); } void @@ -1446,15 +343,22 @@ if (save_timer != 0) { purple_timeout_remove(save_timer); - save_timer = 0; - sync_prefs(); + save_cb(NULL); } purple_prefs_disconnect_by_handle(purple_prefs_get_handle()); prefs_loaded = FALSE; - purple_prefs_destroy(); - g_hash_table_destroy(prefs_hash); - prefs_hash = NULL; +} +void +purple_prefs_set_ui_ops(PurplePrefsUiOps *ops) +{ + prefs_ui_ops = ops; +} + +PurplePrefsUiOps * +purple_prefs_get_ui_ops(void) +{ + return prefs_ui_ops; } diff -ru extract/pidgin-2.6.4/libpurple/prefs.h libpurple/prefs.h --- extract/pidgin-2.6.4/libpurple/prefs.h 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/prefs.h 2009-10-25 19:37:15.000000000 +0100 @@ -38,6 +38,8 @@ PURPLE_PREF_BOOLEAN, /**< Boolean. */ PURPLE_PREF_INT, /**< Integer. */ PURPLE_PREF_STRING, /**< String. */ + /* The 3 following types are unused in libpurple, + and not implemented in Instantbird */ PURPLE_PREF_STRING_LIST, /**< List of strings. */ PURPLE_PREF_PATH, /**< Path. */ PURPLE_PREF_PATH_LIST /**< List of paths. */ @@ -62,11 +64,71 @@ typedef void (*PurplePrefCallback) (const char *name, PurplePrefType type, gconstpointer val, gpointer data); + +/** @copydoc _PurplePrefsUiOps */ +typedef struct _PurplePrefsUiOps PurplePrefsUiOps; + + +/** Prefs UI operations + */ +struct _PurplePrefsUiOps +{ + void (*add_none)(const char *name); + void (*add_bool)(const char *name, gboolean value); + void (*add_int)(const char *name, int value); + void (*add_string)(const char *name, const char *value); + + void (*set_bool)(const char *name, gboolean value); + void (*set_int)(const char *name, int value); + void (*set_string)(const char *name, const char *value); + + gboolean (*get_bool)(const char *name); + int (*get_int)(const char *name); + const char *(*get_string)(const char *name); + + PurplePrefType (*get_type)(const char *name); + GList *(*get_children_names)(const char *name); + + gboolean (*exists)(const char *name); + void (*remove)(const char *name); + + void (*save)(void); + + void *(*add_observer)(const char *name, gpointer data); + void (*remove_observer)(const char *name, void *observer); + + void (*_purple_reserved1)(void); + void (*_purple_reserved2)(void); + void (*_purple_reserved3)(void); + void (*_purple_reserved4)(void); +}; + + #ifdef __cplusplus extern "C" { #endif /**************************************************************************/ +/** @name UI Registration Functions */ +/**************************************************************************/ +/*@{*/ +/** + * Sets the UI operations structure to be used for preferences. + * + * @param ops The UI operations structure. + */ +void purple_prefs_set_ui_ops(PurplePrefsUiOps *ops); + +/** + * Returns the UI operations structure used for preferences. + * + * @return The UI operations structure in use. + */ +PurplePrefsUiOps *purple_prefs_get_ui_ops(void); + +/*@}*/ + +/**************************************************************************/ /** @name Prefs API Preferences are named according to a directory-like structure. Example: "/plugins/core/potato/is_from_idaho" (probably a boolean) */ @@ -122,37 +184,6 @@ void purple_prefs_add_string(const char *name, const char *value); /** - * Add a new string list pref. - * - * @param name The name of the pref - * @param value The initial value to set - * @note This function takes a copy of the strings in the value list. The list - * itself and original copies of the strings are up to the caller to - * free. - */ -void purple_prefs_add_string_list(const char *name, GList *value); - -/** - * Add a new path pref. - * - * @param name The name of the pref - * @param value The initial value to set - */ -void purple_prefs_add_path(const char *name, const char *value); - -/** - * Add a new path list pref. - * - * @param name The name of the pref - * @param value The initial value to set - * @note This function takes a copy of the strings in the value list. The list - * itself and original copies of the strings are up to the caller to - * free. - */ -void purple_prefs_add_path_list(const char *name, GList *value); - - -/** * Remove a pref. * * @param name The name of the pref @@ -160,35 +191,6 @@ void purple_prefs_remove(const char *name); /** - * Rename a pref - * - * @param oldname The old name of the pref - * @param newname The new name for the pref - */ -void purple_prefs_rename(const char *oldname, const char *newname); - -/** - * Rename a boolean pref, toggling it's value - * - * @param oldname The old name of the pref - * @param newname The new name for the pref - */ -void purple_prefs_rename_boolean_toggle(const char *oldname, const char *newname); - -/** - * Remove all prefs. - */ -void purple_prefs_destroy(void); - -/** - * Set raw pref value - * - * @param name The name of the pref - * @param value The value to set - */ -void purple_prefs_set_generic(const char *name, gpointer value); - -/** * Set boolean pref value * * @param name The name of the pref @@ -212,30 +214,6 @@ */ void purple_prefs_set_string(const char *name, const char *value); -/** - * Set string list pref value - * - * @param name The name of the pref - * @param value The value to set - */ -void purple_prefs_set_string_list(const char *name, GList *value); - -/** - * Set path pref value - * - * @param name The name of the pref - * @param value The value to set - */ -void purple_prefs_set_path(const char *name, const char *value); - -/** - * Set path list pref value - * - * @param name The name of the pref - * @param value The value to set - */ -void purple_prefs_set_path_list(const char *name, GList *value); - /** * Check if a pref exists @@ -278,30 +256,6 @@ const char *purple_prefs_get_string(const char *name); /** - * Get string list pref value - * - * @param name The name of the pref - * @return The value of the pref - */ -GList *purple_prefs_get_string_list(const char *name); - -/** - * Get path pref value - * - * @param name The name of the pref - * @return The value of the pref - */ -const char *purple_prefs_get_path(const char *name); - -/** - * Get path list pref value - * - * @param name The name of the pref - * @return The value of the pref - */ -GList *purple_prefs_get_path_list(const char *name); - -/** * Returns a list of children for a pref * * @param name The parent pref @@ -329,6 +283,11 @@ gpointer data); /** + * Call the callback of the observer + */ +void purple_prefs_observe(gpointer data); + +/** * Remove a callback to a pref */ void purple_prefs_disconnect_callback(guint callback_id); @@ -348,11 +307,6 @@ */ gboolean purple_prefs_load(void); -/** - * Rename legacy prefs and delete some that no longer exist. - */ -void purple_prefs_update_old(void); - /*@}*/ #ifdef __cplusplus Only in libpurple/protocols: create-cid.sh Only in libpurple/protocols/gg: Makefile.in diff -ru extract/pidgin-2.6.4/libpurple/protocols/gg/lib/common.c libpurple/protocols/gg/lib/common.c --- extract/pidgin-2.6.4/libpurple/protocols/gg/lib/common.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/gg/lib/common.c 2008-11-14 11:10:23.000000000 +0100 @@ -34,12 +34,12 @@ #include #ifndef _WIN32 #include +#include #endif #include #include #include #include -#include #include "libgadu.h" diff -ru extract/pidgin-2.6.4/libpurple/protocols/gg/lib/events.c libpurple/protocols/gg/lib/events.c --- extract/pidgin-2.6.4/libpurple/protocols/gg/lib/events.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/gg/lib/events.c 2008-11-14 11:10:23.000000000 +0100 @@ -27,6 +27,7 @@ #include #include #include +#include #endif #include "libgadu-config.h" @@ -39,7 +40,6 @@ #include #include #include -#include #ifdef __GG_LIBGADU_HAVE_OPENSSL # include # include diff -ru extract/pidgin-2.6.4/libpurple/protocols/gg/lib/http.c libpurple/protocols/gg/lib/http.c --- extract/pidgin-2.6.4/libpurple/protocols/gg/lib/http.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/gg/lib/http.c 2008-11-14 11:10:23.000000000 +0100 @@ -24,6 +24,7 @@ #include #include #include +#include #endif #include "libgadu-config.h" @@ -40,7 +41,6 @@ #include #include #include -#include #include "compat.h" #include "libgadu.h" diff -ru extract/pidgin-2.6.4/libpurple/protocols/gg/lib/libgadu-config.h libpurple/protocols/gg/lib/libgadu-config.h --- extract/pidgin-2.6.4/libpurple/protocols/gg/lib/libgadu-config.h 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/gg/lib/libgadu-config.h 2008-11-14 11:10:23.000000000 +0100 @@ -1,6 +1,6 @@ /* Local libgadu configuration. */ -#include "config.h" +/*#include "config.h" */ #ifndef __GG_LIBGADU_CONFIG_H #define __GG_LIBGADU_CONFIG_H @@ -11,11 +11,13 @@ #define __GG_LIBGADU_BIGENDIAN #endif /* WORDS_BIGENDIAN */ +#ifndef _WIN32 /* Defined if this machine has va_copy(). */ #define __GG_LIBGADU_HAVE_VA_COPY /* Defined if this machine has __va_copy(). */ #define __GG_LIBGADU_HAVE___VA_COPY +#endif /* Defined if this machine supports long long. */ #undef __GG_LIBGADU_HAVE_LONG_LONG @@ -49,4 +51,18 @@ #define random (long) rand #endif +#ifdef _MSC_VER +typedef unsigned __int32 uint32_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int8 uint8_t; +#define snprintf _snprintf +#include +#define EINPROGRESS WSAEINPROGRESS +#define ECONNRESET WSAECONNRESET +#define ENOTCONN WSAENOTCONN +#define strncasecmp strnicmp +#define strcasecmp stricmp +#define ssize_t SSIZE_T +#endif + #endif /* __GG_LIBGADU_CONFIG_H */ diff -ru extract/pidgin-2.6.4/libpurple/protocols/gg/lib/libgadu.c libpurple/protocols/gg/lib/libgadu.c --- extract/pidgin-2.6.4/libpurple/protocols/gg/lib/libgadu.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/gg/lib/libgadu.c 2009-10-25 19:20:33.000000000 +0100 @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef sun # include #endif @@ -50,7 +51,6 @@ #include #include #include -#include #ifdef __GG_LIBGADU_HAVE_OPENSSL # include # include diff -ru extract/pidgin-2.6.4/libpurple/protocols/gg/lib/pubdir.c libpurple/protocols/gg/lib/pubdir.c --- extract/pidgin-2.6.4/libpurple/protocols/gg/lib/pubdir.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/gg/lib/pubdir.c 2008-11-14 11:10:23.000000000 +0100 @@ -25,7 +25,9 @@ #include #include #include +#ifndef _WIN32 #include +#endif #include "libgadu.h" Only in libpurple/protocols/irc: Makefile.in diff -ru extract/pidgin-2.6.4/libpurple/protocols/irc/cmds.c libpurple/protocols/irc/cmds.c --- extract/pidgin-2.6.4/libpurple/protocols/irc/cmds.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/irc/cmds.c 2009-05-27 23:48:05.000000000 +0200 @@ -23,6 +23,7 @@ #include "internal.h" #include "conversation.h" +#include "core.h" #include "debug.h" #include "notify.h" #include "util.h" @@ -424,7 +425,7 @@ irc->quitting = TRUE; if (!irc->account->disconnecting) - purple_account_set_status(irc->account, "offline", TRUE, NULL); + purple_account_set_enabled(irc->account, purple_core_get_ui(), FALSE); } return 0; diff -ru extract/pidgin-2.6.4/libpurple/protocols/irc/irc.c libpurple/protocols/irc/irc.c --- extract/pidgin-2.6.4/libpurple/protocols/irc/irc.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/irc/irc.c 2009-10-25 19:20:33.000000000 +0100 @@ -28,6 +28,7 @@ #include "accountopt.h" #include "blist.h" #include "conversation.h" +#include "core.h" #include "debug.h" #include "notify.h" #include "prpl.h" @@ -484,8 +485,21 @@ if (irc == NULL) return; - if (irc->gsc || (irc->fd >= 0)) - irc_cmd_quit(irc, "quit", NULL, NULL); + if (irc->gsc || (irc->fd >= 0)) { + const char *version_complete = NULL; + GHashTable *ui_info = purple_core_get_ui_info(); + + if (ui_info) { + const char *ui_name = g_hash_table_lookup(ui_info, "name"); + const char *ui_version = g_hash_table_lookup(ui_info, "version"); + + if (ui_name && ui_version) + version_complete = g_strdup_printf("%s %s", ui_name, ui_version); + } + + irc_cmd_quit(irc, "quit", NULL, version_complete ? &version_complete : NULL); + g_free((void *)version_complete); + } if (gc->inpa) purple_input_remove(gc->inpa); diff -ru extract/pidgin-2.6.4/libpurple/protocols/irc/msgs.c libpurple/protocols/irc/msgs.c --- extract/pidgin-2.6.4/libpurple/protocols/irc/msgs.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/irc/msgs.c 2009-10-25 19:20:33.000000000 +0100 @@ -65,8 +65,16 @@ char *message, *stripped; stripped = data[1] ? irc_mirc2txt(data[1]) : NULL; - message = g_strdup_printf("quit: %s", stripped); - g_free(stripped); + if (g_str_has_prefix(stripped, "Quit: ")) { + // some IRC servers automatically prefix a "Quit:" string. + // there is no point in duplicating it. + message = stripped; + } else if (stripped) { + message = g_strdup_printf(_("quit: %s"), stripped); + g_free(stripped); + } else { + message = g_strdup(_("quit")); + } if (purple_conv_chat_find_user(PURPLE_CONV_CHAT(convo), data[0])) purple_conv_chat_remove_user(PURPLE_CONV_CHAT(convo), data[0], message); diff -ru extract/pidgin-2.6.4/libpurple/protocols/irc/parse.c libpurple/protocols/irc/parse.c --- extract/pidgin-2.6.4/libpurple/protocols/irc/parse.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/irc/parse.c 2009-10-25 19:20:33.000000000 +0100 @@ -564,6 +564,7 @@ buf = irc_format(irc, "vt:", "NOTICE", from, "\001VERSION Purple IRC\001"); irc_send(irc, buf); g_free(buf); + return NULL; } else if (!strncmp(cur, "DCC SEND ", 9)) { irc_dccsend_recv(irc, from, msg + 10); return NULL; Only in libpurple/protocols/jabber: Makefile.in diff -ru extract/pidgin-2.6.4/libpurple/protocols/jabber/buddy.c libpurple/protocols/jabber/buddy.c --- extract/pidgin-2.6.4/libpurple/protocols/jabber/buddy.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/jabber/buddy.c 2009-12-06 00:38:31.000000000 +0100 @@ -97,9 +97,6 @@ const JabberBuddyResource *jbrb = b; JabberBuddyState state_a, state_b; - if (jbra->priority != jbrb->priority) - return jbra->priority > jbrb->priority ? 1 : -1; - /* Fold the states for easier comparison */ switch (jbra->state) { case JABBER_BUDDY_STATE_ONLINE: @@ -142,6 +139,9 @@ } if (state_a == state_b) { + if (jbra->priority != jbrb->priority) + return jbra->priority > jbrb->priority ? 1 : -1; + if (jbra->idle == jbrb->idle) return 0; else if ((jbra->idle && !jbrb->idle) || diff -ru extract/pidgin-2.6.4/libpurple/protocols/jabber/disco.c libpurple/protocols/jabber/disco.c --- extract/pidgin-2.6.4/libpurple/protocols/jabber/disco.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/protocols/jabber/disco.c 2009-12-06 00:38:31.000000000 +0100 @@ -32,7 +32,9 @@ #include "google.h" #include "iq.h" #include "jabber.h" +#ifdef USE_JINGLE #include "jingle/jingle.h" +#endif #include "pep.h" #include "presence.h" #include "roster.h" diff -ru extract/pidgin-2.6.4/libpurple/protocols/jabber/google.c libpurple/protocols/jabber/google.c --- extract/pidgin-2.6.4/libpurple/protocols/jabber/google.c 2009-11-30 04:13:50.000000000 +0100 +++ libpurple/protocols/jabber/google.c 2009-12-06 00:38:31.000000000 +0100 @@ -20,7 +20,9 @@ #include "internal.h" #include "debug.h" +#ifdef USE_VV #include "mediamanager.h" +#endif #include "util.h" #include "privacy.h" #include "dnsquery.h" @@ -33,7 +35,9 @@ #include "iq.h" #include "chat.h" +#ifdef USE_JINGLE #include "jingle/jingle.h" +#endif #ifdef USE_VV diff -ru extract/pidgin-2.6.4/libpurple/protocols/jabber/iq.c libpurple/protocols/jabber/iq.c --- extract/pidgin-2.6.4/libpurple/protocols/jabber/iq.c 2009-11-30 04:13:50.000000000 +0100 +++ libpurple/protocols/jabber/iq.c 2009-12-06 00:38:31.000000000 +0100 @@ -30,7 +30,9 @@ #include "disco.h" #include "google.h" #include "iq.h" +#ifdef USE_JINGLE #include "jingle/jingle.h" +#endif #include "oob.h" #include "roster.h" #include "si.h" @@ -40,7 +42,7 @@ #include "ibb.h" #ifdef _WIN32 -#include "utsname.h" +#include "win32/utsname.h" #endif GHashTable *iq_handlers = NULL; @@ -457,7 +459,9 @@ iq_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); signal_iq_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); +#ifdef USE_JINGLE jabber_iq_register_handler("jingle", JINGLE, jingle_parse); +#endif jabber_iq_register_handler("mailbox", NS_GOOGLE_MAIL_NOTIFY, jabber_gmail_poke); jabber_iq_register_handler("new-mail", NS_GOOGLE_MAIL_NOTIFY, diff -ru extract/pidgin-2.6.4/libpurple/protocols/jabber/jabber.c libpurple/protocols/jabber/jabber.c --- extract/pidgin-2.6.4/libpurple/protocols/jabber/jabber.c 2009-11-30 04:13:50.000000000 +0100 +++ libpurple/protocols/jabber/jabber.c 2009-12-06 00:38:31.000000000 +0100 @@ -66,8 +66,10 @@ #include "pep.h" #include "adhoccommands.h" +#ifdef USE_JINGLE #include "jingle/jingle.h" #include "jingle/rtp.h" +#endif GList *jabber_features = NULL; GList *jabber_identities = NULL; @@ -1433,8 +1435,10 @@ { JabberStream *js = gc->proto_data; +#ifdef USE_JINGLE /* Close all of the open Jingle sessions on this stream */ jingle_terminate_sessions(js); +#endif /* Don't perform any actions on the ssl connection * if we were forcibly disconnected because it will crash @@ -3503,8 +3507,10 @@ /* Bits Of Binary */ jabber_add_feature(NS_BOB, 0); +#ifdef USE_JINGLE /* Jingle features! */ jabber_add_feature(JINGLE, 0); +#endif #ifdef USE_VV jabber_add_feature(NS_GOOGLE_PROTOCOL_SESSION, jabber_audio_enabled); diff -ru extract/pidgin-2.6.4/libpurple/protocols/jabber/jabber.h libpurple/protocols/jabber/jabber.h --- extract/pidgin-2.6.4/libpurple/protocols/jabber/jabber.h 2009-11-30 04:13:50.000000000 +0100 +++ libpurple/protocols/jabber/jabber.h 2009-12-06 00:38:31.000000000 +0100 @@ -59,8 +59,10 @@ #include "connection.h" #include "dnsquery.h" #include "dnssrv.h" +#ifdef USE_VV #include "media.h" #include "mediamanager.h" +#endif #include "roomlist.h" #include "sslconn.h" diff -ru extract/pidgin-2.6.4/libpurple/protocols/jabber/libxmpp.c libpurple/protocols/jabber/libxmpp.c --- extract/pidgin-2.6.4/libpurple/protocols/jabber/libxmpp.c 2009-11-30 04:13:50.000000000 +0100 +++ libpurple/protocols/jabber/libxmpp.c 2009-12-06 00:38:31.000000000 +0100 @@ -347,11 +347,11 @@ PurpleAccountOption *option; /* Translators: 'domain' is used here in the context of Internet domains, e.g. pidgin.im */ - split = purple_account_user_split_new(_("Domain"), NULL, '@'); + split = purple_account_user_split_new(_("Domain"), "gmail.com", '@'); purple_account_user_split_set_reverse(split, FALSE); prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); - split = purple_account_user_split_new(_("Resource"), NULL, '/'); + split = purple_account_user_split_new(_("Resource"), "Instantbird", '/'); purple_account_user_split_set_reverse(split, FALSE); prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); @@ -430,7 +430,9 @@ jabber_data_init(); jabber_bosh_init(); +#ifndef _MSC_VER #warning implement adding and retrieving own features via IPC API +#endif jabber_ibb_init(); jabber_si_init(); diff -ru extract/pidgin-2.6.4/libpurple/protocols/jabber/message.c libpurple/protocols/jabber/message.c --- extract/pidgin-2.6.4/libpurple/protocols/jabber/message.c 2009-11-30 04:13:50.000000000 +0100 +++ libpurple/protocols/jabber/message.c 2009-12-06 00:38:31.000000000 +0100 @@ -124,7 +124,8 @@ * this should be able to be implemented by removing the * user from the conversation like we do with chats now. */ purple_conversation_write(conv, "", buf, - PURPLE_MESSAGE_SYSTEM, time(NULL)); + PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, + time(NULL)); } } serv_got_typing_stopped(jm->js->gc, from); Only in libpurple/protocols: module.ver.in Only in libpurple/protocols/msn: Makefile.in diff -ru extract/pidgin-2.6.4/libpurple/protocols/msn/msg.c libpurple/protocols/msn/msg.c --- extract/pidgin-2.6.4/libpurple/protocols/msn/msg.c 2009-11-30 04:13:50.000000000 +0100 +++ libpurple/protocols/msn/msg.c 2009-10-25 21:39:19.000000000 +0100 @@ -966,6 +966,8 @@ } +#define purple_mkstemp(a, b) NULL + /* TODO: Make these not be such duplicates of each other */ static void got_wink_cb(MsnSlpCall *slpcall, const guchar *data, gsize size) diff -ru extract/pidgin-2.6.4/libpurple/protocols/msn/msn.c libpurple/protocols/msn/msn.c --- extract/pidgin-2.6.4/libpurple/protocols/msn/msn.c 2009-11-30 04:13:50.000000000 +0100 +++ libpurple/protocols/msn/msn.c 2009-12-06 00:38:31.000000000 +0100 @@ -1558,12 +1558,15 @@ data->buddy = buddy; data->group = group; + finish_auth_request(data, NULL); +#if 0 purple_request_input(gc, NULL, _("Authorization Request Message:"), NULL, _("Please authorize me!"), TRUE, FALSE, NULL, _("_OK"), G_CALLBACK(finish_auth_request), _("_Cancel"), G_CALLBACK(cancel_auth_request), purple_connection_get_account(gc), bname, NULL, data); +#endif } static void Only in libpurple/protocols/msn: oim.c.orig Only in libpurple/protocols/msn: servconn.c.orig Only in libpurple/protocols/msn: servconn.c.rej Only in extract/pidgin-2.6.4/libpurple/protocols: mxit Only in libpurple/protocols/myspace: Makefile.in Only in libpurple/protocols: netsoul Only in libpurple/protocols/novell: Makefile.in diff -ru extract/pidgin-2.6.4/libpurple/protocols/novell/nmconn.c libpurple/protocols/novell/nmconn.c --- extract/pidgin-2.6.4/libpurple/protocols/novell/nmconn.c 2009-11-30 04:13:52.000000000 +0100 +++ libpurple/protocols/novell/nmconn.c 2009-04-10 12:48:59.000000000 +0200 @@ -19,15 +19,18 @@ */ #include +#ifndef _MSC_VER #include +#endif #include #include #include #include #include "nmconn.h" +#include "sslconn.h" #ifdef _WIN32 -#include +#include #endif #define NO_ESCAPE(ch) ((ch == 0x20) || (ch >= 0x30 && ch <= 0x39) || \ @@ -187,10 +190,6 @@ } g_slist_free(conn->requests); conn->requests = NULL; - if (conn->ssl_conn) { - g_free(conn->ssl_conn); - conn->ssl_conn = NULL; - } g_free(conn->addr); conn->addr = NULL; g_free(conn); @@ -205,8 +204,8 @@ if (!conn->use_ssl) return (write(conn->fd, buff, len)); - else if (conn->ssl_conn && conn->ssl_conn->write) - return (conn->ssl_conn->write(conn->ssl_conn->data, buff, len)); + else if (conn->ssl_conn) + return (purple_ssl_write(conn->ssl_conn, buff, len)); else return -1; } @@ -219,8 +218,8 @@ if (!conn->use_ssl) return (read(conn->fd, buff, len)); - else if (conn->ssl_conn && conn->ssl_conn->read) - return ((conn->ssl_conn->read)(conn->ssl_conn->data, buff, len)); + else if (conn->ssl_conn) + return (purple_ssl_read(conn->ssl_conn, buff, len)); else return -1; } diff -ru extract/pidgin-2.6.4/libpurple/protocols/novell/nmconn.h libpurple/protocols/novell/nmconn.h --- extract/pidgin-2.6.4/libpurple/protocols/novell/nmconn.h 2009-11-30 04:13:52.000000000 +0100 +++ libpurple/protocols/novell/nmconn.h 2009-04-10 12:48:59.000000000 +0200 @@ -27,9 +27,6 @@ #include "nmfield.h" #include "nmuser.h" -typedef int (*nm_ssl_read_cb) (gpointer ssl_data, void *buff, int len); -typedef int (*nm_ssl_write_cb) (gpointer ssl_data, const void *buff, int len); - struct _NMConn { @@ -58,19 +55,7 @@ gboolean redirect; /* SSL connection */ - NMSSLConn *ssl_conn; - -}; - -struct _NMSSLConn -{ - - /* Data to pass to the callbacks */ - gpointer data; - - /* Callbacks for reading/writing */ - nm_ssl_read_cb read; - nm_ssl_write_cb write; + gpointer ssl_conn; }; diff -ru extract/pidgin-2.6.4/libpurple/protocols/novell/novell.c libpurple/protocols/novell/novell.c --- extract/pidgin-2.6.4/libpurple/protocols/novell/novell.c 2009-11-30 04:13:52.000000000 +0100 +++ libpurple/protocols/novell/novell.c 2009-10-25 19:20:35.000000000 +0100 @@ -1676,7 +1676,7 @@ gc = data; user = gc->proto_data; - user->conn->ssl_conn->data = NULL; + user->conn->ssl_conn = NULL; purple_connection_ssl_error (gc, error); } @@ -2204,14 +2204,10 @@ user->conn->use_ssl = TRUE; - user->conn->ssl_conn = g_new0(NMSSLConn, 1); - user->conn->ssl_conn->read = (nm_ssl_read_cb) purple_ssl_read; - user->conn->ssl_conn->write = (nm_ssl_write_cb) purple_ssl_write; - - user->conn->ssl_conn->data = purple_ssl_connect(user->client_data, - user->conn->addr, user->conn->port, - novell_ssl_connected_cb, novell_ssl_connect_error, gc); - if (user->conn->ssl_conn->data == NULL) { + user->conn->ssl_conn = purple_ssl_connect(user->client_data, + user->conn->addr, user->conn->port, + novell_ssl_connected_cb, novell_ssl_connect_error, gc); + if (user->conn->ssl_conn == NULL) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("SSL support unavailable")); @@ -2232,7 +2228,8 @@ if (user) { conn = user->conn; if (conn && conn->ssl_conn) { - purple_ssl_close(user->conn->ssl_conn->data); + purple_ssl_close(user->conn->ssl_conn); + user->conn->ssl_conn = NULL; } nm_deinitialize_user(user); } Only in libpurple/protocols/null: Makefile.in diff -ru extract/pidgin-2.6.4/libpurple/protocols/null/nullprpl.c libpurple/protocols/null/nullprpl.c --- extract/pidgin-2.6.4/libpurple/protocols/null/nullprpl.c 2009-11-30 04:13:52.000000000 +0100 +++ libpurple/protocols/null/nullprpl.c 2009-10-25 19:20:35.000000000 +0100 @@ -67,6 +67,9 @@ #include "util.h" #include "version.h" +/* Disable gettext for the null-prpl, it will never be translated... */ +#undef _ +#define _(String) (String) #define NULLPRPL_ID "prpl-null" static PurplePlugin *_null_protocol = NULL; @@ -172,7 +175,8 @@ !strcmp(status_id, NULL_STATUS_AWAY) || !strcmp(status_id, NULL_STATUS_OFFLINE)) { purple_debug_info("nullprpl", "%s sees that %s is %s: %s\n", - from_username, to_username, status_id, message); + from_username, to_username, status_id, + message ? message : ""); purple_prpl_got_user_status(from->account, to_username, status_id, (message) ? "message" : NULL, message, NULL); } else { @@ -364,6 +368,9 @@ purple_debug_info("nullprpl", "logging in %s\n", acct->username); + if (!strcmp(acct->username, "crash@test")) + *((int *) NULL) = 42; + purple_connection_update_progress(gc, _("Connecting"), 0, /* which connection step this is */ 2); /* total number of steps */ @@ -522,8 +529,12 @@ static void nullprpl_set_status(PurpleAccount *acct, PurpleStatus *status) { const char *msg = purple_status_get_attr_string(status, "message"); - purple_debug_info("nullprpl", "setting %s's status to %s: %s\n", - acct->username, purple_status_get_name(status), msg); + if (msg) + purple_debug_info("nullprpl", "setting %s's status to %s: %s\n", + acct->username, purple_status_get_name(status), msg); + else + purple_debug_info("nullprpl", "setting %s's status to %s\n", + acct->username, purple_status_get_name(status)); foreach_nullprpl_gc(report_status_change, get_nullprpl_gc(acct->username), NULL); Only in libpurple/protocols/oscar: Makefile.in diff -ru extract/pidgin-2.6.4/libpurple/protocols/oscar/family_locate.c libpurple/protocols/oscar/family_locate.c --- extract/pidgin-2.6.4/libpurple/protocols/oscar/family_locate.c 2009-11-30 04:13:52.000000000 +0100 +++ libpurple/protocols/oscar/family_locate.c 2009-12-06 00:38:31.000000000 +0100 @@ -356,7 +356,7 @@ aim_userinfo_t *aim_locate_finduserinfo(OscarData *od, const char *bn) { aim_userinfo_t *cur = NULL; - if (bn == NULL) + if (bn == NULL || od == NULL) return NULL; cur = od->locate.userinfo; diff -ru extract/pidgin-2.6.4/libpurple/protocols/oscar/libaim.c libpurple/protocols/oscar/libaim.c --- extract/pidgin-2.6.4/libpurple/protocols/oscar/libaim.c 2009-11-30 04:13:52.000000000 +0100 +++ libpurple/protocols/oscar/libaim.c 2009-12-13 23:58:23.000000000 +0100 @@ -138,10 +138,13 @@ NULL }; +gboolean purple_init_icq_plugin(void); + static void init_plugin(PurplePlugin *plugin) { oscar_init(plugin); + purple_init_icq_plugin(); } -PURPLE_INIT_PLUGIN(aim, init_plugin, info); +PURPLE_INIT_PLUGIN(oscar, init_plugin, info) diff -ru extract/pidgin-2.6.4/libpurple/protocols/oscar/libicq.c libpurple/protocols/oscar/libicq.c --- extract/pidgin-2.6.4/libpurple/protocols/oscar/libicq.c 2009-11-30 04:13:52.000000000 +0100 +++ libpurple/protocols/oscar/libicq.c 2009-12-06 00:38:31.000000000 +0100 @@ -25,6 +25,7 @@ */ +#define PURPLE_STATIC_PRPL #include "oscarcommon.h" static GHashTable * diff -ru extract/pidgin-2.6.4/libpurple/protocols/oscar/oscar.c libpurple/protocols/oscar/oscar.c --- extract/pidgin-2.6.4/libpurple/protocols/oscar/oscar.c 2009-11-30 04:13:53.000000000 +0100 +++ libpurple/protocols/oscar/oscar.c 2009-12-06 00:38:31.000000000 +0100 @@ -519,11 +519,18 @@ /* Attempt to send as ASCII */ if (oscar_charset_check(from) == AIM_CHARSET_ASCII) { - *msg = g_convert(from, -1, "ASCII", "UTF-8", NULL, &msglen, NULL); - *charset = AIM_CHARSET_ASCII; - *charsubset = 0x0000; - *msglen_int = msglen; - return; + *msg = g_convert(from, -1, "ASCII", "UTF-8", NULL, &msglen, &err); + if (*msg != NULL) { + *charset = AIM_CHARSET_ASCII; + *charsubset = 0x0000; + *msglen_int = msglen; + return; + } + purple_debug_error("oscar", "Conversion from UTF-8 to ASCII failed: %s.\n", + err->message); + g_error_free(err); + err = NULL; + *msg = g_strdup(from); } /* Only in libpurple/protocols: prpl-rules.mk Only in libpurple/protocols: prpl.mk Only in libpurple/protocols/qq: Makefile.in diff -ru extract/pidgin-2.6.4/libpurple/protocols/qq/buddy_info.c libpurple/protocols/qq/buddy_info.c --- extract/pidgin-2.6.4/libpurple/protocols/qq/buddy_info.c 2009-11-30 04:13:53.000000000 +0100 +++ libpurple/protocols/qq/buddy_info.c 2009-10-25 19:20:36.000000000 +0100 @@ -541,7 +541,7 @@ { gchar *icon_path; const gchar *icon_dir; -#ifdef _WIN32 +#if 0 static char *dir = NULL; if (dir == NULL) { dir = g_build_filename(wpurple_install_dir(), "pixmaps", @@ -559,7 +559,7 @@ icon_dir = purple_prefs_get_string("/plugins/prpl/qq/icon_dir"); if ( icon_dir == NULL || strlen(icon_dir) == 0) { #ifdef _WIN32 - icon_dir = dir; + icon_dir = ""; #else icon_dir = QQ_BUDDY_ICON_DIR; #endif diff -ru extract/pidgin-2.6.4/libpurple/protocols/qq/im.c libpurple/protocols/qq/im.c --- extract/pidgin-2.6.4/libpurple/protocols/qq/im.c 2009-11-30 04:13:53.000000000 +0100 +++ libpurple/protocols/qq/im.c 2009-10-25 19:20:36.000000000 +0100 @@ -42,6 +42,10 @@ #include "send_file.h" #include "utils.h" +#ifdef WINCE +# include +#endif + #define QQ_MSG_IM_MAX 700 /* max length of IM */ enum { diff -ru extract/pidgin-2.6.4/libpurple/protocols/qq/qq_crypt.c libpurple/protocols/qq/qq_crypt.c --- extract/pidgin-2.6.4/libpurple/protocols/qq/qq_crypt.c 2009-11-30 04:13:53.000000000 +0100 +++ libpurple/protocols/qq/qq_crypt.c 2009-10-25 19:20:36.000000000 +0100 @@ -82,7 +82,7 @@ } #else -#define show_binary(args... ) /* nothing */ +#define show_binary(arg1, arg2, arg3) /* nothing */ #endif diff -ru extract/pidgin-2.6.4/libpurple/protocols/qq/send_file.c libpurple/protocols/qq/send_file.c --- extract/pidgin-2.6.4/libpurple/protocols/qq/send_file.c 2009-11-30 04:13:53.000000000 +0100 +++ libpurple/protocols/qq/send_file.c 2009-10-25 19:20:36.000000000 +0100 @@ -38,6 +38,10 @@ #include "qq_network.h" #include "utils.h" +#ifdef _MSC_VER +#define ssize_t SSIZE_T +#endif + enum { QQ_FILE_TRANS_REQ = 0x0035, Only in libpurple/protocols/simple: Makefile.in Only in libpurple/protocols: xpcomModule.cpp.in Only in libpurple/protocols/yahoo: Makefile.in Only in libpurple/protocols/yahoo: Makefile.in~ diff -ru extract/pidgin-2.6.4/libpurple/protocols/yahoo/libyahoo.c libpurple/protocols/yahoo/libyahoo.c --- extract/pidgin-2.6.4/libpurple/protocols/yahoo/libyahoo.c 2009-11-30 04:13:53.000000000 +0100 +++ libpurple/protocols/yahoo/libyahoo.c 2009-12-06 00:38:31.000000000 +0100 @@ -301,6 +301,8 @@ NULL }; +gboolean purple_init_yahoojp_plugin(void); + static void init_plugin(PurplePlugin *plugin) { @@ -347,6 +349,7 @@ purple_signal_connect(purple_get_core(), "uri-handler", plugin, PURPLE_CALLBACK(yahoo_uri_handler), NULL); + purple_init_yahoojp_plugin(); } PURPLE_INIT_PLUGIN(yahoo, init_plugin, info); diff -ru extract/pidgin-2.6.4/libpurple/protocols/yahoo/libyahoojp.c libpurple/protocols/yahoo/libyahoojp.c --- extract/pidgin-2.6.4/libpurple/protocols/yahoo/libyahoojp.c 2009-11-30 04:13:53.000000000 +0100 +++ libpurple/protocols/yahoo/libyahoojp.c 2009-10-25 22:10:26.000000000 +0100 @@ -21,6 +21,7 @@ * */ +#define PURPLE_STATIC_PRPL #include "internal.h" #include diff -ru extract/pidgin-2.6.4/libpurple/protocols/yahoo/libymsg.c libpurple/protocols/yahoo/libymsg.c --- extract/pidgin-2.6.4/libpurple/protocols/yahoo/libymsg.c 2009-11-30 04:13:53.000000000 +0100 +++ libpurple/protocols/yahoo/libymsg.c 2009-12-06 00:38:31.000000000 +0100 @@ -51,6 +51,10 @@ #include "yahoo_picture.h" #include "ycht.h" +#ifdef leave +# undef leave +#endif + /* #define YAHOO_DEBUG */ /* #define TRY_WEBMESSENGER_LOGIN 0 */ @@ -1269,12 +1273,15 @@ static void yahoo_buddy_add_deny_reason_cb(gpointer data) { struct yahoo_add_request *add_req = data; + yahoo_buddy_add_deny_cb(add_req, NULL); + /* purple_request_input(add_req->gc, NULL, _("Authorization denied message:"), NULL, _("No reason given."), TRUE, FALSE, NULL, _("OK"), G_CALLBACK(yahoo_buddy_add_deny_cb), _("Cancel"), G_CALLBACK(yahoo_buddy_add_deny_noreason_cb), purple_connection_get_account(add_req->gc), add_req->who, NULL, add_req); + */ } static void yahoo_buddy_denied_our_add(PurpleConnection *gc, const char *who, const char *reason) diff -ru extract/pidgin-2.6.4/libpurple/proxy.c libpurple/proxy.c --- extract/pidgin-2.6.4/libpurple/proxy.c 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/proxy.c 2009-12-06 00:38:31.000000000 +0100 @@ -218,6 +218,7 @@ global_proxy_info = info; } +#if 0 static PurpleProxyInfo * purple_gnome_proxy_get_info(void) { @@ -366,6 +367,7 @@ return &info; } +#endif #ifdef _WIN32 @@ -2157,9 +2159,11 @@ gpi = NULL; } if (gpi == NULL) { +#if 0 if (purple_running_gnome()) gpi = purple_gnome_proxy_get_info(); else +#endif gpi = purple_global_proxy_get_info(); } @@ -2413,6 +2417,7 @@ } } +#if 0 static void proxy_pref_cb(const char *name, PurplePrefType type, gconstpointer value, gpointer data) @@ -2446,6 +2451,7 @@ else if (purple_strequal(name, "/purple/proxy/password")) purple_proxy_info_set_password(info, value); } +#endif void * purple_proxy_get_handle() @@ -2465,13 +2471,16 @@ /* Proxy */ purple_prefs_add_none("/purple/proxy"); +#if 0 purple_prefs_add_string("/purple/proxy/type", "none"); purple_prefs_add_string("/purple/proxy/host", ""); purple_prefs_add_int("/purple/proxy/port", 0); purple_prefs_add_string("/purple/proxy/username", ""); purple_prefs_add_string("/purple/proxy/password", ""); +#endif purple_prefs_add_bool("/purple/proxy/socks4_remotedns", FALSE); +#if 0 /* Setup callbacks for the preferences. */ handle = purple_proxy_get_handle(); purple_prefs_connect_callback(handle, "/purple/proxy/type", proxy_pref_cb, @@ -2491,6 +2500,7 @@ purple_prefs_trigger_callback("/purple/proxy/port"); purple_prefs_trigger_callback("/purple/proxy/username"); purple_prefs_trigger_callback("/purple/proxy/password"); +#endif } void diff -ru extract/pidgin-2.6.4/libpurple/proxy.h libpurple/proxy.h --- extract/pidgin-2.6.4/libpurple/proxy.h 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/proxy.h 2009-10-25 19:20:36.000000000 +0100 @@ -194,6 +194,13 @@ */ void purple_global_proxy_set_info(PurpleProxyInfo *info); +/** + * Set purple's global proxy information. + * + * @param info The proxy information. + */ +void purple_global_proxy_set_info(PurpleProxyInfo *info); + /*@}*/ /**************************************************************************/ diff -ru extract/pidgin-2.6.4/libpurple/prpl.h libpurple/prpl.h --- extract/pidgin-2.6.4/libpurple/prpl.h 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/prpl.h 2009-12-06 00:38:31.000000000 +0100 @@ -65,7 +65,6 @@ #include "conversation.h" #include "ft.h" #include "imgstore.h" -#include "media.h" #include "notify.h" #include "proxy.h" #include "plugin.h" @@ -73,6 +72,29 @@ #include "status.h" #include "whiteboard.h" +/** extracted from media.h */ +/** Media caps */ +typedef enum { + PURPLE_MEDIA_CAPS_NONE = 0, + PURPLE_MEDIA_CAPS_AUDIO = 1, + PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION = 1 << 1, + PURPLE_MEDIA_CAPS_VIDEO = 1 << 2, + PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION = 1 << 3, + PURPLE_MEDIA_CAPS_AUDIO_VIDEO = 1 << 4, + PURPLE_MEDIA_CAPS_MODIFY_SESSION = 1 << 5, + PURPLE_MEDIA_CAPS_CHANGE_DIRECTION = 1 << 6 +} PurpleMediaCaps; + +/** Media session types */ +typedef enum { + PURPLE_MEDIA_NONE = 0, + PURPLE_MEDIA_RECV_AUDIO = 1 << 0, + PURPLE_MEDIA_SEND_AUDIO = 1 << 1, + PURPLE_MEDIA_RECV_VIDEO = 1 << 2, + PURPLE_MEDIA_SEND_VIDEO = 1 << 3, + PURPLE_MEDIA_AUDIO = PURPLE_MEDIA_RECV_AUDIO | PURPLE_MEDIA_SEND_AUDIO, + PURPLE_MEDIA_VIDEO = PURPLE_MEDIA_RECV_VIDEO | PURPLE_MEDIA_SEND_VIDEO +} PurpleMediaSessionType; /** @copydoc PurpleBuddyIconSpec */ struct _PurpleBuddyIconSpec { Only in libpurple: prpl.h~ Only in libpurple: purple-prefs.js diff -ru extract/pidgin-2.6.4/libpurple/request.c libpurple/request.c --- extract/pidgin-2.6.4/libpurple/request.c 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/request.c 2009-12-01 16:38:32.000000000 +0100 @@ -1160,6 +1160,11 @@ /* -- */ +#define PURPLE_REQUEST_NO_OPS(type, title, description) \ + purple_debug_error("request", "Requesting "type": %s (%s)", \ + title ? title : "(null)", \ + description ? description : "(null)") + void * purple_request_input(void *handle, const char *title, const char *primary, const char *secondary, const char *default_value, @@ -1194,6 +1199,8 @@ return info->ui_handle; } + else + PURPLE_REQUEST_NO_OPS("input", title, primary); return NULL; } @@ -1256,6 +1263,8 @@ return info->ui_handle; } + else + PURPLE_REQUEST_NO_OPS("choice", title, primary); return NULL; } @@ -1307,6 +1316,8 @@ return info->ui_handle; } + else + PURPLE_REQUEST_NO_OPS("action", title, primary); return NULL; } @@ -1344,6 +1355,8 @@ return info->ui_handle; } + else + PURPLE_REQUEST_NO_OPS("fields", title, primary); return NULL; } @@ -1371,6 +1384,8 @@ handles = g_list_append(handles, info); return info->ui_handle; } + else + PURPLE_REQUEST_NO_OPS("file", title, filename); return NULL; } @@ -1398,6 +1413,8 @@ handles = g_list_append(handles, info); return info->ui_handle; } + else + PURPLE_REQUEST_NO_OPS("folder", title, dirname); return NULL; } Only in libpurple: revert.patch diff -ru extract/pidgin-2.6.4/libpurple/smiley.c libpurple/smiley.c --- extract/pidgin-2.6.4/libpurple/smiley.c 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/smiley.c 2009-10-25 19:20:37.000000000 +0100 @@ -60,7 +60,7 @@ static char *smileys_dir = NULL; #define SMILEYS_DEFAULT_FOLDER "custom_smiley" -#define SMILEYS_LOG_ID "smileys" +#define SMILEYS_LOG_ID N_("smileys") #define XML_FILE_NAME "smileys.xml" Only in libpurple: smiley.c~ diff -ru extract/pidgin-2.6.4/libpurple/ssl-nss.c libpurple/ssl-nss.c --- extract/pidgin-2.6.4/libpurple/ssl-nss.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/ssl-nss.c 2009-10-25 19:20:37.000000000 +0100 @@ -21,7 +21,6 @@ */ #include "internal.h" #include "debug.h" -#include "certificate.h" #include "plugin.h" #include "sslconn.h" #include "util.h" @@ -56,9 +55,9 @@ #define PURPLE_SSL_NSS_DATA(gsc) ((PurpleSslNssData *)gsc->private_data) -static const PRIOMethods *_nss_methods = NULL; -static PRDescIdentity _identity; -static PurpleCertificateScheme x509_nss; +/* static const PRIOMethods *_nss_methods = NULL; */ +/* static PRDescIdentity _identity; */ +/* static PurpleCertificateScheme x509_nss; */ /* Thank you, Evolution */ static void @@ -125,13 +124,14 @@ static void ssl_nss_init_nss(void) { +#if 0 char *lib; PR_Init(PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1); NSS_NoDB_Init("."); /* TODO: Fix this so autoconf does the work trying to find this lib. */ #ifndef _WIN32 - lib = g_strdup(LIBDIR "/libnssckbi.so"); + lib = g_strdup("libnssckbi.so"); #else lib = g_strdup("nssckbi.dll"); #endif @@ -154,6 +154,7 @@ _identity = PR_GetUniqueIdentity("Purple"); _nss_methods = PR_GetDefaultIOMethods(); +#endif } static SECStatus @@ -235,11 +236,14 @@ static void ssl_nss_uninit(void) { +#if 0 PR_Cleanup(); _nss_methods = NULL; +#endif } +#if 0 static void ssl_nss_verified_cb(PurpleCertificateVerificationStatus st, gpointer userdata) @@ -316,6 +320,7 @@ return peer_certs; } +#endif static void ssl_nss_handshake_cb(gpointer data, int fd, PurpleInputCondition cond) @@ -347,6 +352,9 @@ purple_input_remove(nss_data->handshake_handler); nss_data->handshake_handler = 0; + gsc->connect_cb(gsc->connect_cb_data, gsc, cond); + +#if 0 /* If a Verifier was given, hand control over to it */ if (gsc->verifier) { GList *peers; @@ -366,6 +374,7 @@ callback */ gsc->connect_cb(gsc->connect_cb_data, gsc, cond); } +#endif } static void @@ -415,6 +424,7 @@ SSL_OptionSet(nss_data->in, SSL_SECURITY, PR_TRUE); SSL_OptionSet(nss_data->in, SSL_HANDSHAKE_AS_CLIENT, PR_TRUE); + SSL_OptionSet(nss_data->in, SSL_ENABLE_SESSION_TICKETS, PR_FALSE); SSL_AuthCertificateHook(nss_data->in, (SSLAuthCertificate)ssl_auth_cert, @@ -467,7 +477,7 @@ static size_t ssl_nss_read(PurpleSslConnection *gsc, void *data, size_t len) { - ssize_t ret; + PRInt32 ret; PurpleSslNssData *nss_data = PURPLE_SSL_NSS_DATA(gsc); ret = PR_Read(nss_data->in, data, len); @@ -481,7 +491,7 @@ static size_t ssl_nss_write(PurpleSslConnection *gsc, const void *data, size_t len) { - ssize_t ret; + PRInt32 ret; PurpleSslNssData *nss_data = PURPLE_SSL_NSS_DATA(gsc); if(!nss_data) @@ -519,6 +529,9 @@ return NULL; } +#if 0 +/* No purple_certificate_* stuff for Instantbird */ + /************************************************************************/ /* X.509 functionality */ /************************************************************************/ @@ -880,6 +893,7 @@ NULL, NULL }; +#endif static PurpleSslOps ssl_ops = { @@ -898,6 +912,13 @@ }; +void purple_nss_init(void) +{ + purple_ssl_set_ops(&ssl_ops); +} + +#if 0 +/* Instantbird does not need the plugin stuff for NSS */ static gboolean plugin_load(PurplePlugin *plugin) { @@ -970,3 +991,4 @@ } PURPLE_INIT_PLUGIN(ssl_nss, init_plugin, info) +#endif diff -ru extract/pidgin-2.6.4/libpurple/sslconn.c libpurple/sslconn.c --- extract/pidgin-2.6.4/libpurple/sslconn.c 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/sslconn.c 2009-10-25 19:20:37.000000000 +0100 @@ -27,11 +27,12 @@ #include "internal.h" -#include "certificate.h" #include "debug.h" #include "request.h" #include "sslconn.h" +extern void purple_nss_init(void); + static gboolean _ssl_initialized = FALSE; static PurpleSslOps *_ssl_ops = NULL; @@ -43,11 +44,14 @@ if (_ssl_initialized) return FALSE; +#if 0 plugin = purple_plugins_find_with_id("core-ssl"); if (plugin != NULL && !purple_plugin_is_loaded(plugin)) purple_plugin_load(plugin); +#endif + purple_nss_init(); ops = purple_ssl_get_ops(); if ((ops == NULL) || (ops->init == NULL) || (ops->uninit == NULL) || @@ -63,12 +67,8 @@ gboolean purple_ssl_is_supported(void) { -#ifdef HAVE_SSL ssl_init(); return (purple_ssl_get_ops() != NULL); -#else - return FALSE; -#endif } static void @@ -131,8 +131,10 @@ gsc->connect_cb = func; gsc->error_cb = error_func; +#if 0 /* TODO: Move this elsewhere */ gsc->verifier = purple_certificate_find_verifier("x509","tls_cached"); +#endif gsc->connect_data = purple_proxy_connect(NULL, account, host, port, purple_ssl_connect_cb, gsc); @@ -222,8 +224,10 @@ if(host) gsc->host = g_strdup(host); +#if 0 /* TODO: Move this elsewhere */ gsc->verifier = purple_certificate_find_verifier("x509","tls_cached"); +#endif ops = purple_ssl_get_ops(); diff -ru extract/pidgin-2.6.4/libpurple/sslconn.h libpurple/sslconn.h --- extract/pidgin-2.6.4/libpurple/sslconn.h 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/sslconn.h 2009-10-25 19:20:37.000000000 +0100 @@ -34,13 +34,13 @@ PURPLE_SSL_CERTIFICATE_INVALID = 3 } PurpleSslErrorType; -#include "certificate.h" #include "proxy.h" #define PURPLE_SSL_DEFAULT_PORT 443 /** @copydoc _PurpleSslConnection */ typedef struct _PurpleSslConnection PurpleSslConnection; +typedef struct _PurpleCertificateVerifier PurpleCertificateVerifier; typedef void (*PurpleSslInputFunction)(gpointer, PurpleSslConnection *, PurpleInputCondition); diff -ru extract/pidgin-2.6.4/libpurple/statenotify.c libpurple/statenotify.c --- extract/pidgin-2.6.4/libpurple/statenotify.c 2009-11-30 04:13:49.000000000 +0100 +++ libpurple/statenotify.c 2009-10-25 19:20:37.000000000 +0100 @@ -13,7 +13,7 @@ #define STATENOTIFY_PLUGIN_ID "core-statenotify" static void -write_status(PurpleBuddy *buddy, const char *message) +write_status(PurpleBuddy *buddy, const char *message, PurpleConvUpdateType type) { PurpleAccount *account = NULL; PurpleConversation *conv; @@ -43,6 +43,7 @@ g_free(escaped); purple_conv_im_write(conv->u.im, NULL, buf, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_ACTIVE_ONLY | PURPLE_MESSAGE_NO_LINKIFY, time(NULL)); + purple_conversation_update(conv, type); } static void @@ -60,9 +61,9 @@ if (purple_prefs_get_bool("/plugins/core/statenotify/notify_away")) { if (available && !old_available) - write_status(buddy, _("%s is no longer away.")); + write_status(buddy, _("%s is no longer away."), PURPLE_CONV_UPDATE_AWAY); else if (!available && old_available) - write_status(buddy, _("%s has gone away.")); + write_status(buddy, _("%s has gone away."), PURPLE_CONV_UPDATE_AWAY); } } @@ -72,9 +73,9 @@ { if (purple_prefs_get_bool("/plugins/core/statenotify/notify_idle")) { if (idle && !old_idle) { - write_status(buddy, _("%s has become idle.")); + write_status(buddy, _("%s has become idle."), PURPLE_CONV_UPDATE_AWAY); } else if (!idle && old_idle) { - write_status(buddy, _("%s is no longer idle.")); + write_status(buddy, _("%s is no longer idle."), PURPLE_CONV_UPDATE_AWAY); } } } @@ -83,16 +84,36 @@ buddy_signon_cb(PurpleBuddy *buddy, void *data) { if (purple_prefs_get_bool("/plugins/core/statenotify/notify_signon")) - write_status(buddy, _("%s has signed on.")); + write_status(buddy, _("%s has signed on."), PURPLE_CONV_ACCOUNT_ONLINE); } static void buddy_signoff_cb(PurpleBuddy *buddy, void *data) { if (purple_prefs_get_bool("/plugins/core/statenotify/notify_signon")) - write_status(buddy, _("%s has signed off.")); + write_status(buddy, _("%s has signed off."), PURPLE_CONV_ACCOUNT_OFFLINE); } +static void +account_signed_off_cb(PurpleConnection *gc, gpointer event) +{ + GList *iter; + + if (!gc || !gc->account) + return; + + for (iter = purple_get_conversations(); iter; iter = iter->next) + { + PurpleConversation *conv = iter->data; + if (purple_conversation_get_account(conv) == gc->account) + { + purple_conversation_update(conv, PURPLE_CONV_ACCOUNT_OFFLINE); + purple_conversation_write(conv, NULL, _("Your account is disconnected."), PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_ACTIVE_ONLY | PURPLE_MESSAGE_NO_LINKIFY, time(NULL)); + } + } +} + +#if 0 static PurplePluginPrefFrame * get_plugin_pref_frame(PurplePlugin *plugin) { @@ -115,6 +136,7 @@ return frame; } +#endif static gboolean plugin_load(PurplePlugin *plugin) @@ -130,9 +152,13 @@ purple_signal_connect(blist_handle, "buddy-signed-off", plugin, PURPLE_CALLBACK(buddy_signoff_cb), NULL); + purple_signal_connect(purple_connections_get_handle(), "signed-off", plugin, + G_CALLBACK(account_signed_off_cb), NULL); + return TRUE; } +#if 0 static PurplePluginUiInfo prefs_info = { get_plugin_pref_frame, @@ -184,6 +210,7 @@ NULL, NULL }; +#endif static void init_plugin(PurplePlugin *plugin) @@ -194,4 +221,14 @@ purple_prefs_add_bool("/plugins/core/statenotify/notify_signon", TRUE); } +#if 0 PURPLE_INIT_PLUGIN(statenotify, init_plugin, info) +#endif + +void purple_statenotify_init(void) +{ + int handle; + + init_plugin(NULL); + plugin_load((PurplePlugin *)&handle); +} diff -ru extract/pidgin-2.6.4/libpurple/upnp.h libpurple/upnp.h --- extract/pidgin-2.6.4/libpurple/upnp.h 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/upnp.h 2008-11-14 11:10:24.000000000 +0100 @@ -61,17 +61,6 @@ */ void purple_upnp_discover(PurpleUPnPCallback cb, gpointer cb_data); -#if 0 -/** - * Retrieve the current UPnP control info, if there is any available. - * This will only be filled in if purple_upnp_discover() had been called, - * and finished discovering. - * - * @return The control URL for the IGD we'll use to use the IGD services - */ -const PurpleUPnPControlInfo* purple_upnp_get_control_info(void); -#endif - /** * Gets the IP address from a UPnP enabled IGD that sits on the local * network, so when getting the network IP, instead of returning the diff -ru extract/pidgin-2.6.4/libpurple/util.c libpurple/util.c --- extract/pidgin-2.6.4/libpurple/util.c 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/util.c 2009-12-06 00:38:31.000000000 +0100 @@ -220,7 +220,7 @@ gchar * purple_base64_encode(const guchar *data, gsize len) { -#if GLIB_CHECK_VERSION(2,12,0) +#if 0 return g_base64_encode(data, len); #else char *out, *rv; @@ -263,7 +263,7 @@ guchar * purple_base64_decode(const char *str, gsize *ret_len) { -#if GLIB_CHECK_VERSION(2,12,0) +#if 0 /* * We want to allow ret_len to be NULL for backward compatibility, * but g_base64_decode() requires a valid length variable. So if @@ -2622,6 +2622,7 @@ /************************************************************************** * Path/Filename Functions **************************************************************************/ +#if 0 const char * purple_home_dir(void) { @@ -2631,17 +2632,14 @@ return wpurple_data_dir(); #endif } +#endif /* Returns the argument passed to -c IFF it was present, or ~/.purple. */ const char * purple_user_dir(void) { - if (custom_user_dir != NULL) - return custom_user_dir; - else if (!user_dir) - user_dir = g_build_filename(purple_home_dir(), ".purple", NULL); - - return user_dir; + g_return_val_if_fail(custom_user_dir != NULL, NULL); + return custom_user_dir; } void purple_util_set_user_dir(const char *dir) @@ -2891,6 +2889,7 @@ return xmlnode_from_file(purple_user_dir(), filename, description, "util"); } +#if 0 /* * Like mkstemp() but returns a file pointer, uses a pre-set template, * uses the semantics of tempnam() for the directory to use and allocates @@ -2939,6 +2938,7 @@ return fp; } +#endif const char * purple_util_get_image_extension(gconstpointer data, size_t len) @@ -3006,6 +3006,7 @@ return filename; } +#if 0 gboolean purple_program_is_valid(const char *program) { @@ -3037,12 +3038,12 @@ return is_valid; } - +#endif gboolean purple_running_gnome(void) { -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(__APPLE__) gchar *tmp = g_find_program_in_path("gnome-open"); if (tmp == NULL) @@ -3060,7 +3061,7 @@ gboolean purple_running_kde(void) { -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(__APPLE__) gchar *tmp = g_find_program_in_path("kfmclient"); const char *session; @@ -3115,7 +3116,7 @@ gboolean purple_strequal(const gchar *left, const gchar *right) { -#if GLIB_CHECK_VERSION(2,16,0) +#if 0 return (g_strcmp0(left, right) == 0); #else return ((left == NULL && right == NULL) || @@ -4694,6 +4695,7 @@ char *msg; int saved_errno = errno; +#ifndef WINCE const char *msg_locale; msg_locale = gai_strerror(errnum); @@ -4706,6 +4708,14 @@ else { gchar *msg_utf8 = g_locale_to_utf8(msg_locale, -1, NULL, NULL, NULL); +#else + const WCHAR *msg_locale; + + msg_locale = gai_strerror(errnum); + if (1) + { + gchar *msg_utf8 = g_utf16_to_utf8(msg_locale, -1, NULL, NULL, NULL); +#endif if (msg_utf8) { /* Stick in the quark table so that we can return a static result */ diff -ru extract/pidgin-2.6.4/libpurple/util.h libpurple/util.h --- extract/pidgin-2.6.4/libpurple/util.h 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/util.h 2009-10-25 19:20:37.000000000 +0100 @@ -624,7 +624,7 @@ * * @see purple_user_dir() */ -const gchar *purple_home_dir(void); +/* const gchar *purple_home_dir(void); */ /** * Returns the purple settings directory in the user's home directory. @@ -725,7 +725,7 @@ * * @return A file pointer to the temporary file, or @c NULL on failure. */ -FILE *purple_mkstemp(char **path, gboolean binary); +/* FILE *purple_mkstemp(char **path, gboolean binary); */ /** * Returns an extension corresponding to the image data's file type. @@ -767,7 +767,7 @@ * * @return TRUE if the program is runable. */ -gboolean purple_program_is_valid(const char *program); +/* gboolean purple_program_is_valid(const char *program); */ /** * Check if running GNOME. diff -ru extract/pidgin-2.6.4/libpurple/win32/libc_interface.c libpurple/win32/libc_interface.c --- extract/pidgin-2.6.4/libpurple/win32/libc_interface.c 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/win32/libc_interface.c 2009-05-08 22:28:19.000000000 +0200 @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -445,27 +444,6 @@ return 0; } -/* sys/time.h */ - -int wpurple_gettimeofday(struct timeval *p, struct timezone *z) { - int res = 0; - struct _timeb timebuffer; - - if (z != 0) { - _tzset(); - z->tz_minuteswest = _timezone/60; - z->tz_dsttime = _daylight; - } - - if (p != 0) { - _ftime(&timebuffer); - p->tv_sec = timebuffer.time; /* seconds since 1-1-1970 */ - p->tv_usec = timebuffer.millitm*1000; /* microseconds */ - } - - return res; -} - /* stdio.h */ int wpurple_rename (const char *oldname, const char *newname) { @@ -986,8 +964,8 @@ * against our table again. */ memset(localtzname, 0, sizeof(localtzname)); - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, - "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones", + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones", 0, KEY_READ, &rootKey) != ERROR_SUCCESS) @@ -998,7 +976,7 @@ for (idx = 0;; idx++) { - char keyname[256]; + WCHAR keyname[256]; char zonename[256]; DWORD namesize; FILETIME lastwrite; @@ -1007,7 +985,7 @@ memset(keyname, 0, sizeof(keyname)); namesize = sizeof(keyname); - if ((r = RegEnumKeyEx(rootKey, + if ((r = RegEnumKeyExW(rootKey, idx, keyname, &namesize, @@ -1022,7 +1000,7 @@ break; } - if ((r = RegOpenKeyEx(rootKey, keyname, 0, KEY_READ, &key)) != ERROR_SUCCESS) + if ((r = RegOpenKeyExW(rootKey, keyname, 0, KEY_READ, &key)) != ERROR_SUCCESS) { purple_debug_warning("wpurple", "could not open registry subkey to identify Windows timezone: %i\n", (int) r); break; @@ -1030,7 +1008,7 @@ memset(zonename, 0, sizeof(zonename)); namesize = sizeof(zonename); - if ((r = RegQueryValueEx(key, "Std", NULL, NULL, zonename, &namesize)) != ERROR_SUCCESS) + if ((r = RegQueryValueExW(key, L"Std", NULL, NULL, zonename, &namesize)) != ERROR_SUCCESS) { purple_debug_warning("wpurple", "could not query value for 'std' to identify Windows timezone: %i\n", (int) r); RegCloseKey(key); @@ -1039,13 +1017,15 @@ if (strcmp(tzname, zonename) == 0) { /* Matched zone */ - strcpy(localtzname, keyname); + char *tmp = g_utf16_to_utf8(keyname, -1, NULL, NULL, NULL); + strcpy(localtzname, tmp); + g_free(tmp); RegCloseKey(key); break; } memset(zonename, 0, sizeof(zonename)); namesize = sizeof(zonename); - if ((r = RegQueryValueEx(key, "Dlt", NULL, NULL, zonename, &namesize)) != ERROR_SUCCESS) + if ((r = RegQueryValueExW(key, L"Dlt", NULL, NULL, zonename, &namesize)) != ERROR_SUCCESS) { purple_debug_warning("wpurple", "could not query value for 'dlt' to identify Windows timezone: %i\n", (int) r); RegCloseKey(key); @@ -1054,7 +1034,9 @@ if (strcmp(tzname, zonename) == 0) { /* Matched DST zone */ - strcpy(localtzname, keyname); + char *tmp = g_utf16_to_utf8(keyname, -1, NULL, NULL, NULL); + strcpy(localtzname, tmp); + g_free(tmp); RegCloseKey(key); break; } diff -ru extract/pidgin-2.6.4/libpurple/win32/libc_interface.h libpurple/win32/libc_interface.h --- extract/pidgin-2.6.4/libpurple/win32/libc_interface.h 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/win32/libc_interface.h 2009-04-18 01:32:55.000000000 +0200 @@ -38,7 +38,9 @@ #define S_IWUSR S_IWRITE #define S_IXUSR S_IEXEC +#ifndef S_ISDIR #define S_ISDIR(m) (((m)&S_IFDIR)==S_IFDIR) +#endif #define F_OK 0 #endif @@ -106,9 +108,11 @@ wpurple_strerror( errornum ) /* unistd.h */ +#undef read #define read( fd, buf, buflen ) \ wpurple_read( fd, buf, buflen ) +#undef write #define write( socket, buf, buflen ) \ wpurple_write( socket, buf, buflen ) @@ -131,7 +135,7 @@ /* sys/time.h */ #define gettimeofday( timeval, timezone ) \ -wpurple_gettimeofday( timeval, timezone ) + g_get_current_time( timeval ) /* stdio.h */ #define snprintf _snprintf diff -ru extract/pidgin-2.6.4/libpurple/win32/libc_internal.h libpurple/win32/libc_internal.h --- extract/pidgin-2.6.4/libpurple/win32/libc_internal.h 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/win32/libc_internal.h 2009-10-25 19:20:37.000000000 +0100 @@ -23,7 +23,9 @@ #ifndef _LIBC_INTERNAL_ #define _LIBC_INTERNAL_ #include - +#ifdef WINCE +# include +#endif #ifdef __cplusplus extern "C" { @@ -128,7 +130,7 @@ #else # include #endif -int wpurple_gettimeofday(struct timeval *p, struct timezone *z); +/* int wpurple_gettimeofday(struct timeval *p, struct timezone *z); */ /* time.h */ struct tm *wpurple_localtime_r(const time_t *time, struct tm *resultp); diff -ru extract/pidgin-2.6.4/libpurple/win32/win32dep.c libpurple/win32/win32dep.c --- extract/pidgin-2.6.4/libpurple/win32/win32dep.c 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/win32/win32dep.c 2009-10-25 19:20:37.000000000 +0100 @@ -22,7 +22,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA * */ +#ifndef _WIN32_IE #define _WIN32_IE 0x500 +#endif + #include "internal.h" #include @@ -85,6 +88,10 @@ BOOL did_load = FALSE; FARPROC proc = 0; +#ifdef WINCE + return NULL; /* FIXME: ansi/wide mismatch, unlikely to work */ +#endif + if(!(hmod = GetModuleHandle(dllname))) { purple_debug_warning("wpurple", "%s not already loaded; loading it...\n", dllname); if(!(hmod = LoadLibrary(dllname))) { @@ -151,6 +158,7 @@ return retval; } +#if 0 const char *wpurple_install_dir(void) { static gboolean initialized = FALSE; @@ -415,6 +423,7 @@ return result; } +#endif void wpurple_init(void) { WORD wVersionRequested; @@ -424,7 +433,7 @@ g_thread_init(NULL); purple_debug_info("wpurple", "wpurple_init start\n"); - purple_debug_info("wpurple", "libpurple version: " DISPLAY_VERSION "\n"); + // purple_debug_info("wpurple", "libpurple version: " DISPLAY_VERSION "\n"); purple_debug_info("wpurple", "Glib:%u.%u.%u\n", glib_major_version, glib_minor_version, glib_micro_version); diff -ru extract/pidgin-2.6.4/libpurple/win32/win32dep.h libpurple/win32/win32dep.h --- extract/pidgin-2.6.4/libpurple/win32/win32dep.h 2009-11-30 04:13:54.000000000 +0100 +++ libpurple/win32/win32dep.h 2009-04-28 19:27:36.000000000 +0200 @@ -54,18 +54,17 @@ **/ /* Windows helper functions */ FARPROC wpurple_find_and_loadproc(const char *dllname, const char *procedure); -gboolean wpurple_read_reg_dword(HKEY rootkey, const char *subkey, const char *valname, LPDWORD result); -char *wpurple_read_reg_string(HKEY rootkey, const char *subkey, const char *valname); /* needs to be g_free'd */ -gboolean wpurple_write_reg_string(HKEY rootkey, const char *subkey, const char *valname, const char *value); +/* gboolean wpurple_read_reg_dword(HKEY rootkey, const char *subkey, const char *valname, LPDWORD result); */ +/* char *wpurple_read_reg_string(HKEY rootkey, const char *subkey, const char *valname); / * needs to be g_free'd */ +/* gboolean wpurple_write_reg_string(HKEY rootkey, const char *subkey, const char *valname, const char *value); */ char *wpurple_escape_dirsep(const char *filename); /* needs to be g_free'd */ -GIOChannel *wpurple_g_io_channel_win32_new_socket(int socket); /* Until we get the post-2.8 glib win32 giochannel implementation working, use the thread-based one */ /* Determine Purple paths */ gchar *wpurple_get_special_folder(int folder_type); /* needs to be g_free'd */ -const char *wpurple_install_dir(void); -const char *wpurple_lib_dir(void); -const char *wpurple_locale_dir(void); -const char *wpurple_data_dir(void); +/* const char *wpurple_install_dir(void); */ +/* const char *wpurple_lib_dir(void); */ +/* const char *wpurple_locale_dir(void); */ +/* const char *wpurple_data_dir(void); */ /* init / cleanup */ void wpurple_init(void); @@ -80,9 +79,9 @@ /* * Purple specific */ -#define DATADIR wpurple_install_dir() -#define LIBDIR wpurple_lib_dir() -#define LOCALEDIR wpurple_locale_dir() +/* #define DATADIR wpurple_install_dir() */ +/* #define LIBDIR wpurple_lib_dir() */ +/* #define LOCALEDIR wpurple_locale_dir() */ #ifdef __cplusplus }