libpurple/protocols/zephyr/zephyr.c

branch
soc.2013.gobjectification.plugins
changeset 36714
ec178f7d66da
parent 36684
ecc74498e088
child 36716
94a965c18f01
--- a/libpurple/protocols/zephyr/zephyr.c	Fri Sep 13 20:12:39 2013 +0530
+++ b/libpurple/protocols/zephyr/zephyr.c	Fri Sep 13 20:32:33 2013 +0530
@@ -2961,6 +2961,13 @@
 }
 
 
+PURPLE_DEFINE_TYPE_EXTENDED(
+	ZephyrProtocol, zephyr_protocol, PURPLE_TYPE_PROTOCOL, 0,
+	PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_INTERFACE,
+		                              zephyr_protocol_interface_init)
+);
+
+
 static PurplePluginInfo *plugin_query(GError **error)
 {
 	return purple_plugin_info_new(
@@ -2982,6 +2989,8 @@
 static gboolean
 plugin_load(PurplePlugin *plugin, GError **error)
 {
+	zephyr_protocol_register_type(plugin);
+
 	my_protocol = purple_protocols_add(ZEPHYR_TYPE_PROTOCOL, error);
 	if (!my_protocol)
 		return FALSE;
@@ -3003,7 +3012,5 @@
 	return TRUE;
 }
 
-static PurplePlugin *my_plugin;
-PURPLE_PROTOCOL_DEFINE(my_plugin, ZephyrProtocol, zephyr_protocol);
-PURPLE_PLUGIN_INIT_VAL(my_plugin, zephyr, plugin_query, plugin_load,
-                       plugin_unload);
+
+PURPLE_PLUGIN_INIT(zephyr, plugin_query, plugin_load, plugin_unload);

mercurial