diff plugins/oscar.c @ 1047:ece2d1543b20

[gaim-migrate @ 1057] Plugins now use GModule. Protocol plugins can be dynamically updated. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 01 Nov 2000 22:30:36 +0000
parents 8a4290984d1e
children 49799527aebf
line wrap: on
line diff
--- a/plugins/oscar.c	Wed Nov 01 11:34:56 2000 +0000
+++ b/plugins/oscar.c	Wed Nov 01 22:30:36 2000 +0000
@@ -1372,6 +1372,8 @@
 	gtk_widget_show(button);
 }
 
+static struct prpl *my_protocol = NULL;
+
 void oscar_init(struct prpl *ret) {
 	ret->protocol = PROTO_OSCAR;
 	ret->name = oscar_name;
@@ -1405,6 +1407,8 @@
 	ret->chat_whisper = oscar_chat_whisper;
 	ret->chat_send = oscar_chat_send;
 	ret->keepalive = oscar_keepalive;
+
+	my_protocol = ret;
 }
 
 char *name() {
@@ -1415,7 +1419,13 @@
 	return "Allows gaim to use the Oscar protocol";
 }
 
-int gaim_plugin_init(void *handle) {
+char *gaim_plugin_init(GModule *handle) {
 	load_protocol(oscar_init);
-	return 0;
+	return NULL;
 }
+
+void gaim_plugin_remove() {
+	struct prpl *p = find_prpl(PROTO_OSCAR);
+	if (p == my_protocol)
+		unload_protocol(p);
+}