changeset 16726:fc80e7b2540d

Check for RC4 in libpurple on plugin initialization.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Wed, 09 May 2007 04:43:24 +0000
parents 58cd11fcd84f
children cd4a6bd9f69e
files libpurple/protocols/myspace/myspace.c
diffstat 1 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c	Sun May 06 06:48:30 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Wed May 09 04:43:24 2007 +0000
@@ -59,8 +59,24 @@
 
 static void init_plugin(PurplePlugin *plugin) 
 {
-    purple_notify_message(plugin, PURPLE_NOTIFY_MSG_INFO, "Hello World!",
-                        "This is the Hello World! plugin :)", NULL, NULL, NULL);
+}
+
+/** 
+ * Load the plugin.
+ */
+static gboolean msim_load(PurplePlugin *plugin)
+{
+#ifdef MSIM_USE_PURPLE_RC4
+	/* If compiled to use RC4 from libpurple, check if it is really there. */
+	if (!purple_ciphers_find_cipher("rc4"))
+	{
+		purple_debug_error("msim", "compiled with MSIM_USE_PURPLE_RC4 but rc4 not in libpurple - not loading MySpaceIM plugin!\n");
+		purple_notify_error(plugin, "Missing Cipher", "The RC4 cipher could not be found",
+				"Recompile without MSIM_USE_PURPLE_RC4, or upgrade to a libpurple with RC4 support. MySpaceIM plugin will not be loaded.");
+		return FALSE;
+	}
+#endif
+	return TRUE;
 }
 
 /**
@@ -1775,7 +1791,7 @@
     "Jeff Connelly <myspaceim@xyzzy.cjb.net>",        /**< author         */
     "http://developer.pidgin.im/wiki/MySpaceIM/",     /**< homepage       */
 
-    NULL,                                             /**< load           */
+    msim_load,                                        /**< load           */
     NULL,                                             /**< unload         */
     NULL,                                             /**< destroy        */
     NULL,                                             /**< ui_info        */