summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Sales de Andrade <qulogic@pidgin.im>2008-08-01 05:16:39 +0000
committerElliott Sales de Andrade <qulogic@pidgin.im>2008-08-01 05:16:39 +0000
commit107955514662f871ca4cb6ba1305f4d39343be16 (patch)
tree4a0b467985471789ca25662773b53d4c1d55384b
parentf6885c2b7f46493e4a492e12bf8359bb59253650 (diff)
parentf82cf769374cd935994deebe6a6ecb43df43609d (diff)
downloadpidgin-107955514662f871ca4cb6ba1305f4d39343be16.tar.gz
merge of '67df298c2b9b899c736a1fa8a120ac13d34a20e1'
and 'fc45c1d8ff30da6254cad9fd6f215a4ac0e2774a'
-rw-r--r--ChangeLog.win321
-rw-r--r--libpurple/plugins/perl/common/Prefs.xs20
-rw-r--r--libpurple/plugins/perl/perl-handlers.c205
-rw-r--r--libpurple/plugins/perl/perl-handlers.h21
-rw-r--r--libpurple/plugins/perl/perl.c28
-rw-r--r--libpurple/plugins/perl/scripts/plugin_pref.pl17
-rw-r--r--libpurple/protocols/jabber/Makefile.mingw4
-rw-r--r--libpurple/protocols/jabber/libxmpp.c7
-rw-r--r--libpurple/win32/global.mak2
-rw-r--r--pidgin/win32/nsis/pidgin-installer.nsi4
-rw-r--r--pidgin/win32/winpidgin.c72
11 files changed, 304 insertions, 77 deletions
diff --git a/ChangeLog.win32 b/ChangeLog.win32
index 92dfda0c4e..5f16051d03 100644
--- a/ChangeLog.win32
+++ b/ChangeLog.win32
@@ -2,6 +2,7 @@ version 2.5.0 (??/??/2008):
* Don't install the GSSAPI SASL plugin on NT4 to avoid an error popup.
* Upgrade to Perl 5.10 (System Perl runtime must be upgraded for Perl
plugins to continue to work).
+ * Upgrade SILC to use the 1.1.7 toolkit
version 2.4.3 (07/01/2008):
* No changes
diff --git a/libpurple/plugins/perl/common/Prefs.xs b/libpurple/plugins/perl/common/Prefs.xs
index b1bf4959ba..24669f27fa 100644
--- a/libpurple/plugins/perl/common/Prefs.xs
+++ b/libpurple/plugins/perl/common/Prefs.xs
@@ -1,4 +1,5 @@
#include "module.h"
+#include "../perl-handlers.h"
MODULE = Purple::Prefs PACKAGE = Purple::Prefs PREFIX = purple_prefs_
PROTOTYPES: ENABLE
@@ -62,13 +63,28 @@ PPCODE:
void
purple_prefs_destroy()
+guint
+purple_prefs_connect_callback(plugin, name, callback, data = 0);
+ Purple::Plugin plugin
+ const char *name
+ SV *callback
+ SV *data
+CODE:
+ RETVAL = purple_perl_prefs_connect_callback(plugin, name, callback, data);
+OUTPUT:
+ RETVAL
+
void
-purple_prefs_disconnect_by_handle(handle)
- void * handle
+purple_prefs_disconnect_by_handle(plugin)
+ Purple::Plugin plugin
+CODE:
+ purple_perl_pref_cb_clear_for_plugin(plugin);
void
purple_prefs_disconnect_callback(callback_id)
guint callback_id
+CODE:
+ purple_perl_prefs_disconnect_callback(callback_id);
gboolean
purple_prefs_exists(name)
diff --git a/libpurple/plugins/perl/perl-handlers.c b/libpurple/plugins/perl/perl-handlers.c
index 1ed58500b2..50917ddfa9 100644
--- a/libpurple/plugins/perl/perl-handlers.c
+++ b/libpurple/plugins/perl/perl-handlers.c
@@ -5,9 +5,10 @@
#include "signals.h"
extern PerlInterpreter *my_perl;
-static GList *cmd_handlers = NULL;
-static GList *signal_handlers = NULL;
-static GList *timeout_handlers = NULL;
+static GSList *cmd_handlers = NULL;
+static GSList *signal_handlers = NULL;
+static GSList *timeout_handlers = NULL;
+static GSList *pref_handlers = NULL;
/* perl < 5.8.0 doesn't define PERL_MAGIC_ext */
#ifndef PERL_MAGIC_ext
@@ -70,7 +71,7 @@ purple_perl_plugin_actions(PurplePlugin *plugin, gpointer context)
STRLEN na;
dSP;
- gps = (PurplePerlScript *)plugin->info->extra_info;
+ gps = plugin->info->extra_info;
ENTER;
SAVETMPS;
@@ -131,7 +132,7 @@ purple_perl_gtk_get_plugin_frame(PurplePlugin *plugin)
STRLEN na;
dSP;
- gps = (PurplePerlScript *)plugin->info->extra_info;
+ gps = plugin->info->extra_info;
ENTER;
SAVETMPS;
@@ -212,7 +213,7 @@ destroy_timeout_handler(PurplePerlTimeoutHandler *handler)
{
gboolean ret = FALSE;
- timeout_handlers = g_list_remove(timeout_handlers, handler);
+ timeout_handlers = g_slist_remove(timeout_handlers, handler);
if (handler->iotag > 0)
ret = purple_timeout_remove(handler->iotag);
@@ -231,7 +232,7 @@ destroy_timeout_handler(PurplePerlTimeoutHandler *handler)
static void
destroy_signal_handler(PurplePerlSignalHandler *handler)
{
- signal_handlers = g_list_remove(signal_handlers, handler);
+ signal_handlers = g_slist_remove(signal_handlers, handler);
if (handler->callback != NULL)
SvREFCNT_dec(handler->callback);
@@ -246,7 +247,7 @@ destroy_signal_handler(PurplePerlSignalHandler *handler)
static gboolean
perl_timeout_cb(gpointer data)
{
- PurplePerlTimeoutHandler *handler = (PurplePerlTimeoutHandler *)data;
+ PurplePerlTimeoutHandler *handler = data;
gboolean ret = FALSE;
STRLEN na;
@@ -282,7 +283,7 @@ typedef void *DATATYPE;
static void *
perl_signal_cb(va_list args, void *data)
{
- PurplePerlSignalHandler *handler = (PurplePerlSignalHandler *)data;
+ PurplePerlSignalHandler *handler = data;
void *ret_val = NULL;
int i;
int count;
@@ -414,10 +415,10 @@ static PurplePerlSignalHandler *
find_signal_handler(PurplePlugin *plugin, void *instance, const char *signal)
{
PurplePerlSignalHandler *handler;
- GList *l;
+ GSList *l;
for (l = signal_handlers; l != NULL; l = l->next) {
- handler = (PurplePerlSignalHandler *)l->data;
+ handler = l->data;
if (handler->plugin == plugin &&
handler->instance == instance &&
@@ -447,9 +448,9 @@ purple_perl_timeout_add(PurplePlugin *plugin, int seconds, SV *callback, SV *dat
handler->data = (data != NULL && data != &PL_sv_undef
? newSVsv(data) : NULL);
- timeout_handlers = g_list_append(timeout_handlers, handler);
+ timeout_handlers = g_slist_append(timeout_handlers, handler);
- handler->iotag = purple_timeout_add(seconds * 1000, perl_timeout_cb, handler);
+ handler->iotag = purple_timeout_add_seconds(seconds, perl_timeout_cb, handler);
return handler->iotag;
}
@@ -457,15 +458,13 @@ purple_perl_timeout_add(PurplePlugin *plugin, int seconds, SV *callback, SV *dat
gboolean
purple_perl_timeout_remove(guint handle)
{
- GList *l, *l_next;
+ PurplePerlTimeoutHandler *handler;
+ GSList *l, *l_next;
for (l = timeout_handlers; l != NULL; l = l_next) {
- PurplePerlTimeoutHandler *handler;
-
+ handler = l->data;
l_next = l->next;
- handler = (PurplePerlTimeoutHandler *)l->data;
-
if (handler->iotag == handle)
return destroy_timeout_handler(handler);
}
@@ -478,15 +477,13 @@ purple_perl_timeout_remove(guint handle)
void
purple_perl_timeout_clear_for_plugin(PurplePlugin *plugin)
{
- GList *l, *l_next;
+ PurplePerlTimeoutHandler *handler;
+ GSList *l, *l_next;
for (l = timeout_handlers; l != NULL; l = l_next) {
- PurplePerlTimeoutHandler *handler;
-
+ handler = l->data;
l_next = l->next;
- handler = (PurplePerlTimeoutHandler *)l->data;
-
if (handler->plugin == plugin)
destroy_timeout_handler(handler);
}
@@ -516,7 +513,7 @@ purple_perl_signal_connect(PurplePlugin *plugin, void *instance,
handler->data = (data != NULL &&
data != &PL_sv_undef ? newSVsv(data) : NULL);
- signal_handlers = g_list_append(signal_handlers, handler);
+ signal_handlers = g_slist_append(signal_handlers, handler);
purple_signal_connect_priority_vargs(instance, signal, plugin,
PURPLE_CALLBACK(perl_signal_cb),
@@ -544,12 +541,11 @@ void
purple_perl_signal_clear_for_plugin(PurplePlugin *plugin)
{
PurplePerlSignalHandler *handler;
- GList *l, *l_next;
+ GSList *l, *l_next;
for (l = signal_handlers; l != NULL; l = l_next) {
l_next = l->next;
-
- handler = (PurplePerlSignalHandler *)l->data;
+ handler = l->data;
if (handler->plugin == plugin)
destroy_signal_handler(handler);
@@ -570,7 +566,7 @@ perl_cmd_cb(PurpleConversation *conv, const gchar *command,
int i = 0, count, ret_value = PURPLE_CMD_RET_OK;
STRLEN na;
SV *cmdSV, *tmpSV, *convSV;
- PurplePerlCmdHandler *handler = (PurplePerlCmdHandler *)data;
+ PurplePerlCmdHandler *handler = data;
dSP;
ENTER;
@@ -645,7 +641,7 @@ purple_perl_cmd_register(PurplePlugin *plugin, const gchar *command,
else
handler->data = NULL;
- cmd_handlers = g_list_append(cmd_handlers, handler);
+ cmd_handlers = g_slist_append(cmd_handlers, handler);
handler->id = purple_cmd_register(command, args, priority, flag, prpl_id,
PURPLE_CMD_FUNC(perl_cmd_cb), helpstr,
@@ -657,7 +653,7 @@ purple_perl_cmd_register(PurplePlugin *plugin, const gchar *command,
static void
destroy_cmd_handler(PurplePerlCmdHandler *handler)
{
- cmd_handlers = g_list_remove(cmd_handlers, handler);
+ cmd_handlers = g_slist_remove(cmd_handlers, handler);
if (handler->callback != NULL)
SvREFCNT_dec(handler->callback);
@@ -673,11 +669,11 @@ destroy_cmd_handler(PurplePerlCmdHandler *handler)
void
purple_perl_cmd_clear_for_plugin(PurplePlugin *plugin)
{
- GList *l, *l_next;
+ PurplePerlCmdHandler *handler;
+ GSList *l, *l_next;
for (l = cmd_handlers; l != NULL; l = l_next) {
- PurplePerlCmdHandler *handler = (PurplePerlCmdHandler *)l->data;
-
+ handler = l->data;
l_next = l->next;
if (handler->plugin == plugin)
@@ -688,10 +684,11 @@ purple_perl_cmd_clear_for_plugin(PurplePlugin *plugin)
static PurplePerlCmdHandler *
find_cmd_handler(PurpleCmdId id)
{
- GList *l;
+ PurplePerlCmdHandler *handler;
+ GSList *l;
for (l = cmd_handlers; l != NULL; l = l->next) {
- PurplePerlCmdHandler *handler = (PurplePerlCmdHandler *)l->data;
+ handler = (PurplePerlCmdHandler *)l->data;
if (handler->id == id)
return handler;
@@ -715,3 +712,141 @@ purple_perl_cmd_unregister(PurpleCmdId id)
purple_cmd_unregister(id);
destroy_cmd_handler(handler);
}
+
+static void
+perl_pref_cb(const char *name, PurplePrefType type, gconstpointer value,
+ gpointer data)
+{
+ PurplePerlPrefsHandler *handler = data;
+ STRLEN na;
+
+ dSP;
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(sp);
+ XPUSHs(sv_2mortal(newSVpv(name, 0)));
+
+ XPUSHs(sv_2mortal(newSViv(type)));
+
+ switch(type) {
+ case PURPLE_PREF_INT:
+ XPUSHs(sv_2mortal(newSViv(GPOINTER_TO_INT(value))));
+ break;
+ case PURPLE_PREF_BOOLEAN:
+ XPUSHs((GPOINTER_TO_INT(value) == FALSE) ? &PL_sv_no : &PL_sv_yes);
+ break;
+ case PURPLE_PREF_STRING:
+ case PURPLE_PREF_PATH:
+ XPUSHs(sv_2mortal(newSVGChar(value)));
+ break;
+ case PURPLE_PREF_STRING_LIST:
+ case PURPLE_PREF_PATH_LIST:
+ {
+ AV* av = newAV();
+ const GList *l = value;
+
+ /* Append stuff backward to preserve order */
+ while (l && l->next) l = l->next;
+ while (l) {
+ av_push(av, sv_2mortal(newSVGChar(l->data)));
+ l = l->prev;
+ }
+ XPUSHs(sv_2mortal(newRV_noinc((SV *) av)));
+ } break;
+ default:
+ case PURPLE_PREF_NONE:
+ XPUSHs(&PL_sv_undef);
+ break;
+ }
+
+ XPUSHs((SV *)handler->data);
+ PUTBACK;
+ call_sv(handler->callback, G_EVAL | G_VOID | G_DISCARD);
+ SPAGAIN;
+
+ if (SvTRUE(ERRSV)) {
+ purple_debug_error("perl",
+ "Perl prefs callback function exited abnormally: %s\n",
+ SvPV(ERRSV, na));
+ }
+
+ PUTBACK;
+ FREETMPS;
+ LEAVE;
+}
+
+guint
+purple_perl_prefs_connect_callback(PurplePlugin *plugin, const char *name,
+ SV *callback, SV *data)
+{
+ PurplePerlPrefsHandler *handler;
+
+ if (plugin == NULL) {
+ croak("Invalid handle in adding perl prefs handler.\n");
+ return 0;
+ }
+
+ handler = g_new0(PurplePerlPrefsHandler, 1);
+
+ handler->plugin = plugin;
+ handler->callback = (callback != NULL && callback != &PL_sv_undef
+ ? newSVsv(callback) : NULL);
+ handler->data = (data != NULL && data != &PL_sv_undef
+ ? newSVsv(data) : NULL);
+
+ pref_handlers = g_slist_prepend(pref_handlers, handler);
+
+ handler->iotag = purple_prefs_connect_callback(plugin, name, perl_pref_cb, handler);
+
+ return handler->iotag;
+}
+
+static void
+destroy_prefs_handler(PurplePerlPrefsHandler *handler)
+{
+ pref_handlers = g_slist_remove(pref_handlers, handler);
+
+ if (handler->iotag > 0)
+ purple_prefs_disconnect_callback(handler->iotag);
+
+ if (handler->callback != NULL)
+ SvREFCNT_dec(handler->callback);
+
+ if (handler->data != NULL)
+ SvREFCNT_dec(handler->data);
+
+ g_free(handler);
+}
+
+void purple_perl_prefs_disconnect_callback(guint callback_id)
+{
+ GSList *l, *l_next;
+ PurplePerlPrefsHandler *handler;
+
+ for (l = pref_handlers; l != NULL; l = l_next) {
+ l_next = l->next;
+ handler = l->data;
+
+ if (handler->iotag == callback_id) {
+ destroy_prefs_handler(handler);
+ return;
+ }
+ }
+
+ purple_debug_info("perl", "No prefs handler found with handle %u.\n",
+ callback_id);
+}
+
+void purple_perl_pref_cb_clear_for_plugin(PurplePlugin *plugin)
+{
+ GSList *l, *l_next;
+ PurplePerlPrefsHandler *handler;
+
+ for (l = pref_handlers; l != NULL; l = l_next) {
+ l_next = l->next;
+ handler = l->data;
+
+ if (handler->plugin == plugin)
+ destroy_prefs_handler(handler);
+ }
+}
diff --git a/libpurple/plugins/perl/perl-handlers.h b/libpurple/plugins/perl/perl-handlers.h
index c71bc93136..c0079d2fb9 100644
--- a/libpurple/plugins/perl/perl-handlers.h
+++ b/libpurple/plugins/perl/perl-handlers.h
@@ -15,8 +15,8 @@ typedef struct
PurpleCmdId id;
SV *callback;
SV *data;
- char *prpl_id;
- char *cmd;
+ gchar *prpl_id;
+ gchar *cmd;
PurplePlugin *plugin;
} PurplePerlCmdHandler;
@@ -31,7 +31,7 @@ typedef struct
typedef struct
{
- char *signal;
+ gchar *signal;
SV *callback;
SV *data;
void *instance;
@@ -39,8 +39,17 @@ typedef struct
} PurplePerlSignalHandler;
+typedef struct
+{
+ SV *callback;
+ SV *data;
+ PurplePlugin *plugin;
+ int iotag;
+
+} PurplePerlPrefsHandler;
+
void purple_perl_plugin_action_cb(PurplePluginAction * gpa);
-GList *purple_perl_plugin_actions(PurplePlugin *plugin, gpointer context);
+GList *purple_perl_plugin_actions(PurplePlugin *plugin, gpointer context);
PurplePluginPrefFrame *purple_perl_get_plugin_frame(PurplePlugin *plugin);
@@ -69,4 +78,8 @@ PurpleCmdId purple_perl_cmd_register(PurplePlugin *plugin, const gchar *cmd,
void purple_perl_cmd_unregister(PurpleCmdId id);
void purple_perl_cmd_clear_for_plugin(PurplePlugin *plugin);
+guint purple_perl_prefs_connect_callback(PurplePlugin *plugin, const char *name, SV *callback, SV *data);
+void purple_perl_prefs_disconnect_callback(guint callback_id);
+void purple_perl_pref_cb_clear_for_plugin(PurplePlugin *plugin);
+
#endif /* _PURPLE_PERL_HANDLERS_H_ */
diff --git a/libpurple/plugins/perl/perl.c b/libpurple/plugins/perl/perl.c
index b86d30f341..44e9fc3b62 100644
--- a/libpurple/plugins/perl/perl.c
+++ b/libpurple/plugins/perl/perl.c
@@ -251,7 +251,7 @@ probe_perl_plugin(PurplePlugin *plugin)
char *args[] = {"", plugin->path };
char **argv = args;
- int argc = 2;
+ int argc = 2, ret;
PerlInterpreter *prober;
gboolean status = TRUE;
HV *plugin_info;
@@ -285,9 +285,29 @@ probe_perl_plugin(PurplePlugin *plugin)
}
#endif
- perl_parse(prober, xs_init, argc, argv, NULL);
+ ret = perl_parse(prober, xs_init, argc, argv, NULL);
- perl_run(prober);
+ if (ret != 0) {
+ STRLEN len;
+ const char * errmsg = "Unknown error";
+ if (SvTRUE(ERRSV))
+ errmsg = SvPV(ERRSV, len);
+ purple_debug_error("perl", "Unable to parse plugin %s (%d:%s)\n",
+ plugin->path, ret, errmsg);
+ goto cleanup;
+ }
+
+ ret = perl_run(prober);
+
+ if (ret != 0) {
+ STRLEN len;
+ const char * errmsg = "Unknown error";
+ if (SvTRUE(ERRSV))
+ errmsg = SvPV(ERRSV, len);
+ purple_debug_error("perl", "Unable to run perl interpreter on plugin %s (%d:%s)\n",
+ plugin->path, ret, errmsg);
+ goto cleanup;
+ }
plugin_info = perl_get_hv("PLUGIN_INFO", FALSE);
@@ -435,6 +455,7 @@ probe_perl_plugin(PurplePlugin *plugin)
}
}
+ cleanup:
PL_perl_destruct_level = 1;
PERL_SET_CONTEXT(prober);
perl_destruct(prober);
@@ -557,6 +578,7 @@ unload_perl_plugin(PurplePlugin *plugin)
purple_perl_cmd_clear_for_plugin(plugin);
purple_perl_signal_clear_for_plugin(plugin);
purple_perl_timeout_clear_for_plugin(plugin);
+ purple_perl_pref_cb_clear_for_plugin(plugin);
destroy_package(gps->package);
diff --git a/libpurple/plugins/perl/scripts/plugin_pref.pl b/libpurple/plugins/perl/scripts/plugin_pref.pl
index a30b3e1476..fc9bf93b58 100644
--- a/libpurple/plugins/perl/scripts/plugin_pref.pl
+++ b/libpurple/plugins/perl/scripts/plugin_pref.pl
@@ -44,8 +44,8 @@ sub foo {
$ppref = Purple::PluginPref->new_with_name_and_label(
"/plugins/core/perl_test/choice", "Choice Preference");
$ppref->set_type(1);
- $ppref->add_choice("ch0", $frame);
- $ppref->add_choice("ch1", $frame);
+ $ppref->add_choice("ch0", "ch0-val");
+ $ppref->add_choice("ch1", "ch1-val");
$frame->add($ppref);
$ppref = Purple::PluginPref->new_with_name_and_label(
@@ -56,12 +56,17 @@ sub foo {
return $frame;
}
+sub pref_cb {
+ my ($pref, $type, $value, $data) = @_;
+
+ print "pref changed: [$pref]($type)=$value data=$data\n";
+}
+
sub plugin_init {
return %PLUGIN_INFO;
}
-
# This is the sub defined in %PLUGIN_INFO to be called when the plugin is loaded
# Note: The plugin has a reference to itself on top of the argument stack.
sub plugin_load {
@@ -75,7 +80,11 @@ sub plugin_load {
Purple::Prefs::add_bool("/plugins/core/perl_test/bool", 1);
Purple::Prefs::add_string("/plugins/core/perl_test/choice", "ch1");
Purple::Prefs::add_string("/plugins/core/perl_test/text", "Foobar");
-
+
+ Purple::Prefs::connect_callback($plugin, "/plugins/core/perl_test", \&pref_cb, "none");
+ Purple::Prefs::connect_callback($plugin, "/plugins/core/perl_test/bool", \&pref_cb, "bool");
+ Purple::Prefs::connect_callback($plugin, "/plugins/core/perl_test/choice", \&pref_cb, "choice");
+ Purple::Prefs::connect_callback($plugin, "/plugins/core/perl_test/text", \&pref_cb, "text");
print "\n\n" . "#" x 80 . "\n\n";
}
diff --git a/libpurple/protocols/jabber/Makefile.mingw b/libpurple/protocols/jabber/Makefile.mingw
index 5540a1c3ff..9a46c6afff 100644
--- a/libpurple/protocols/jabber/Makefile.mingw
+++ b/libpurple/protocols/jabber/Makefile.mingw
@@ -88,10 +88,6 @@ INCLUDE_PATHS += -I$(CYRUS_SASL_TOP)/include
LIB_PATHS += -L$(CYRUS_SASL_TOP)/bin
LIBS += -llibsasl
CYRUS_SASL_DLLS = \
- $(CYRUS_SASL_TOP)/bin/comerr32.dll \
- $(CYRUS_SASL_TOP)/bin/gssapi32.dll \
- $(CYRUS_SASL_TOP)/bin/k5sprt32.dll \
- $(CYRUS_SASL_TOP)/bin/krb5_32.dll \
$(CYRUS_SASL_TOP)/bin/libsasl.dll
CYRUS_SASL_PLUGINS = \
diff --git a/libpurple/protocols/jabber/libxmpp.c b/libpurple/protocols/jabber/libxmpp.c
index 2db847c019..dd81c2c0a9 100644
--- a/libpurple/protocols/jabber/libxmpp.c
+++ b/libpurple/protocols/jabber/libxmpp.c
@@ -194,6 +194,7 @@ init_plugin(PurplePlugin *plugin)
{
#ifdef HAVE_CYRUS_SASL
#ifdef _WIN32
+ UINT old_error_mode;
gchar *sasldir;
#endif
int ret;
@@ -250,10 +251,16 @@ init_plugin(PurplePlugin *plugin)
sasldir = g_build_filename(wpurple_install_dir(), "sasl2", NULL);
sasl_set_path(SASL_PATH_TYPE_PLUGIN, sasldir);
g_free(sasldir);
+ /* Suppress error popups for failing to load sasl plugins */
+ old_error_mode = SetErrorMode(SEM_FAILCRITICALERRORS);
#endif
if ((ret = sasl_client_init(NULL)) != SASL_OK) {
purple_debug_error("xmpp", "Error (%d) initializing SASL.\n", ret);
}
+#ifdef _WIN32
+ /* Restore the original error mode */
+ SetErrorMode(old_error_mode);
+#endif
#endif
jabber_register_commands();
diff --git a/libpurple/win32/global.mak b/libpurple/win32/global.mak
index b2bc4cc32e..60366fc195 100644
--- a/libpurple/win32/global.mak
+++ b/libpurple/win32/global.mak
@@ -20,7 +20,7 @@ MEANWHILE_TOP ?= $(WIN32_DEV_TOP)/meanwhile-1.0.2_daa1
NSPR_TOP ?= $(WIN32_DEV_TOP)/nspr-4.6.4
NSS_TOP ?= $(WIN32_DEV_TOP)/nss-3.11.4
PERL_LIB_TOP ?= $(WIN32_DEV_TOP)/perl-5.10.0
-SILC_TOOLKIT ?= $(WIN32_DEV_TOP)/silc-toolkit-1.1.5
+SILC_TOOLKIT ?= $(WIN32_DEV_TOP)/silc-toolkit-1.1.7
TCL_LIB_TOP ?= $(WIN32_DEV_TOP)/tcl-8.4.5
GSTREAMER_TOP ?= $(WIN32_DEV_TOP)/gstreamer-0.10.13
diff --git a/pidgin/win32/nsis/pidgin-installer.nsi b/pidgin/win32/nsis/pidgin-installer.nsi
index a4071faae2..c219a33ca8 100644
--- a/pidgin/win32/nsis/pidgin-installer.nsi
+++ b/pidgin/win32/nsis/pidgin-installer.nsi
@@ -515,10 +515,6 @@ Section $(PIDGIN_SECTION_TITLE) SecPidgin
Delete "$INSTDIR\libsilc-1-1-2.dll"
;GSSAPI
Delete "$INSTDIR\sasl2\saslGSSAPI.dll"
- Delete "$INSTDIR\gssapi32.dll"
- Delete "$INSTDIR\k5sprt32.dll"
- Delete "$INSTDIR\krb5_32.dll"
- Delete "$INSTDIR\comerr32.dll"
${EndIf}
SetOutPath "$INSTDIR"
diff --git a/pidgin/win32/winpidgin.c b/pidgin/win32/winpidgin.c
index 25692af281..7e14883866 100644
--- a/pidgin/win32/winpidgin.c
+++ b/pidgin/win32/winpidgin.c
@@ -441,45 +441,77 @@ static void winpidgin_set_locale() {
_putenv(envstr);
}
-static void winpidgin_add_perl_to_path() {
+
+static void winpidgin_add_stuff_to_path() {
char perl_path[MAX_PATH + 1];
- DWORD plen = sizeof(perl_path);
+ char *ppath = NULL;
+ char mit_kerberos_path[MAX_PATH + 1];
+ char *mpath = NULL;
+ DWORD plen;
printf("%s", "Looking for Perl... ");
+ plen = sizeof(perl_path);
if (read_reg_string(HKEY_LOCAL_MACHINE, "SOFTWARE\\Perl", "",
(LPBYTE) &perl_path, &plen)) {
- const char *path = getenv("PATH");
- /* Enough to add "PATH=" + ";" + perl_path + "\\bin" + \0 */
-
/* We *could* check for perl510.dll, but it seems unnecessary. */
-
printf("found in '%s'.\n", perl_path);
- if (perl_path[strlen(perl_path) - 1] != '\\') {
+ if (perl_path[strlen(perl_path) - 1] != '\\')
strcat(perl_path, "\\");
- }
strcat(perl_path, "bin");
- if (!strstr(path, perl_path)) {
- int newlen = (path ? strlen(path) : 0) + strlen(perl_path) + 10;
- char *newpath = malloc(newlen);
+ ppath = perl_path;
+ } else
+ printf("%s", "not found.\n");
+
+ printf("%s", "Looking for MIT Kerberos... ");
+
+ plen = sizeof(mit_kerberos_path);
+ if (read_reg_string(HKEY_LOCAL_MACHINE, "SOFTWARE\\MIT\\Kerberos", "InstallDir",
+ (LPBYTE) &mit_kerberos_path, &plen)) {
+ /* We *could* check for gssapi32.dll */
+ printf("found in '%s'.\n", mit_kerberos_path);
+
+ if (mit_kerberos_path[strlen(mit_kerberos_path) - 1] != '\\')
+ strcat(mit_kerberos_path, "\\");
+ strcat(mit_kerberos_path, "bin");
+
+ mpath = mit_kerberos_path;
+ } else
+ printf("%s", "not found.\n");
+
+ if (ppath != NULL || mpath != NULL) {
+ const char *path = getenv("PATH");
+ BOOL add_ppath = ppath != NULL && (path == NULL || !strstr(path, ppath));
+ BOOL add_mpath = mpath != NULL && (path == NULL || !strstr(path, mpath));
+ char *newpath;
+ int newlen;
+
+ if (add_ppath || add_mpath) {
+ /* Enough to add "PATH=" + path + ";" + ppath + ";" + mpath + \0 */
+ newlen = 6 + (path ? strlen(path) + 1 : 0);
+ if (add_ppath)
+ newlen += strlen(ppath) + 1;
+ if (add_mpath)
+ newlen += strlen(mpath) + 1;
+ newpath = malloc(newlen);
*newpath = '\0';
- _snprintf(newpath, newlen, "PATH=%s%s%s",
+ _snprintf(newpath, newlen, "PATH=%s%s%s%s%s%s",
path ? path : "",
path ? ";" : "",
- perl_path);
+ add_ppath ? ppath : "",
+ add_ppath ? ";" : "",
+ add_mpath ? mpath : "",
+ add_mpath ? ";" : "");
- printf("Adding Perl to PATH: %s\n", newpath);
+ printf("New PATH: %s\n", newpath);
_putenv(newpath);
free(newpath);
- } else
- printf("%s\n", "Perl already in PATH.");
- } else
- printf("%s", "not found.\n");
-
+ }
+ }
}
#define PIDGIN_WM_FOCUS_REQUEST (WM_APP + 13)
@@ -672,7 +704,7 @@ WinMain (struct HINSTANCE__ *hInstance, struct HINSTANCE__ *hPrevInstance,
winpidgin_set_locale();
- winpidgin_add_perl_to_path();
+ winpidgin_add_stuff_to_path();
/* If help, version or multiple flag used, do not check Mutex */
if (!strstr(lpszCmdLine, "-h") && !strstr(lpszCmdLine, "-v"))