changeset 10156:0dbeb6d1e258

[gaim-migrate @ 11236] Some PRPL callbacks are required or Gaim go boom. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 04 Nov 2004 04:40:57 +0000
parents e05a325ac5a6
children 0de7eee583e6
files src/plugin.c
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugin.c	Thu Nov 04 04:10:32 2004 +0000
+++ b/src/plugin.c	Thu Nov 04 04:40:57 2004 +0000
@@ -246,8 +246,21 @@
 			plugin->info->major_version != GAIM_MAJOR_VERSION ||
 			plugin->info->minor_version > GAIM_MINOR_VERSION)
 	{
-		gaim_debug(GAIM_DEBUG_ERROR, "plugins", "%s is unloadable: API version mismatch %d.%d.x (need %d.%d.x)\n",
-				   plugin->path, plugin->info->major_version, plugin->info->minor_version, GAIM_MAJOR_VERSION, GAIM_MINOR_VERSION);
+		gaim_debug_error("plugins", "%s is unloadable: API version mismatch %d.%d.x (need %d.%d.x)\n",
+						 plugin->path, plugin->info->major_version, plugin->info->minor_version,
+						 GAIM_MAJOR_VERSION, GAIM_MINOR_VERSION);
+		gaim_plugin_destroy(plugin);
+		return NULL;
+	}
+
+	/* If plugin is a PRPL, make sure it implements the required functions */
+	if ((plugin->info->type == GAIM_PLUGIN_PROTOCOL) && (
+		(GAIM_PLUGIN_PROTOCOL_INFO(plugin)->list_icon == NULL) ||
+		(GAIM_PLUGIN_PROTOCOL_INFO(plugin)->login == NULL) ||
+		(GAIM_PLUGIN_PROTOCOL_INFO(plugin)->close == NULL)))
+	{
+		gaim_debug_error("plugins", "%s is unloadable: Does not implement all required functions\n",
+						 plugin->path);
 		gaim_plugin_destroy(plugin);
 		return NULL;
 	}