pidgin: 96dcdf2b: jabber: Use purple_connection_get_prpl()...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Fri Nov 6 05:01:00 EST 2009


-----------------------------------------------------------------
Revision: 96dcdf2b8e12fa30ea7dd2ff9d0569ad3aad73c9
Ancestor: 5e37d508d34f238984d76cdef067fe902db7a131
Author: darkrain42 at pidgin.im
Date: 2009-11-06T09:13:28
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/96dcdf2b8e12fa30ea7dd2ff9d0569ad3aad73c9

Modified files:
        libpurple/protocols/jabber/iq.c
        libpurple/protocols/jabber/jabber.c
        libpurple/protocols/jabber/jabber.h
        libpurple/protocols/jabber/libxmpp.c
        libpurple/protocols/jabber/message.c
        libpurple/protocols/jabber/presence.c

ChangeLog: 

jabber: Use purple_connection_get_prpl() instead of jabber_plugin.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/iq.c	871bd3b7b0a14fb37a0546784bc277df88678167
+++ libpurple/protocols/jabber/iq.c	2abb1398ed899ddde8f6b9ab56fa46c58fd4426e
@@ -342,7 +342,7 @@ void jabber_iq_parse(JabberStream *js, x
 		return;
 	}
 
-	signal_return = GPOINTER_TO_INT(purple_signal_emit_return_1(jabber_plugin,
+	signal_return = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_connection_get_prpl(js->gc),
 			"jabber-receiving-iq", js->gc, iq_type, id, from, packet));
 	if (signal_return)
 		return;
@@ -367,7 +367,7 @@ void jabber_iq_parse(JabberStream *js, x
 		g_free(key);
 
 		if (signal_ref > 0) {
-			signal_return = GPOINTER_TO_INT(purple_signal_emit_return_1(jabber_plugin, "jabber-watched-iq",
+			signal_return = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_connection_get_prpl(js->gc), "jabber-watched-iq",
 					js->gc, iq_type, id, from, child));
 			if (signal_return)
 				return;
============================================================
--- libpurple/protocols/jabber/jabber.c	e2bab77cc3d28cbd42ff54d096592091f2bc651d
+++ libpurple/protocols/jabber/jabber.c	9861db333983ecf98713755a830bd9aa5e004514
@@ -68,10 +68,9 @@
 #include "jingle/jingle.h"
 #include "jingle/rtp.h"
 
-PurplePlugin *jabber_plugin = NULL;
 GList *jabber_features = NULL;
 GList *jabber_identities = NULL;
-GSList *jabber_cmds = NULL;
+static GSList *jabber_cmds = NULL;
 
 static void jabber_unregister_account_cb(JabberStream *js);
 static void try_srv_connect(JabberStream *js);
@@ -255,7 +254,7 @@ void jabber_process_packet(JabberStream 
 {
 	const char *xmlns;
 
-	purple_signal_emit(jabber_plugin, "jabber-receiving-xmlnode", js->gc, packet);
+	purple_signal_emit(purple_connection_get_prpl(js->gc), "jabber-receiving-xmlnode", js->gc, packet);
 
 	/* if the signal leaves us with a null packet, we're done */
 	if(NULL == *packet)
@@ -419,7 +418,7 @@ void jabber_send_raw(JabberStream *js, c
 	/* If we've got a security layer, we need to encode the data,
 	 * splitting it on the maximum buffer length negotiated */
 
-	purple_signal_emit(jabber_plugin, "jabber-sending-text", js->gc, &data);
+	purple_signal_emit(purple_connection_get_prpl(js->gc), "jabber-sending-text", js->gc, &data);
 	if (data == NULL)
 		return;
 
@@ -489,7 +488,7 @@ void jabber_send(JabberStream *js, xmlno
 
 void jabber_send(JabberStream *js, xmlnode *packet)
 {
-	purple_signal_emit(jabber_plugin, "jabber-sending-xmlnode", js->gc, &packet);
+	purple_signal_emit(purple_connection_get_prpl(js->gc), "jabber-sending-xmlnode", js->gc, &packet);
 }
 
 static gboolean jabber_keepalive_timeout(PurpleConnection *gc)
@@ -3405,8 +3404,6 @@ jabber_init_plugin(PurplePlugin *plugin)
 								unspecified */
 	const gchar *ui_name = NULL;
 
-	jabber_plugin = plugin;
-
 	ui_type = ui_info ? g_hash_table_lookup(ui_info, "client_type") : NULL;
 	if (ui_type) {
 		if (strcmp(ui_type, "pc") == 0 ||
@@ -3496,9 +3493,9 @@ void
 }
 
 void
-jabber_uninit_plugin(void)
+jabber_uninit_plugin(PurplePlugin *plugin)
 {
-	purple_plugin_ipc_unregister_all(jabber_plugin);
+	purple_plugin_ipc_unregister_all(plugin);
 
 	jabber_features_destroy();
 	jabber_identities_destroy();
============================================================
--- libpurple/protocols/jabber/jabber.h	db366b6d4a17ecf18d089f64811c671dc2034e5e
+++ libpurple/protocols/jabber/jabber.h	1b99b42b03fc5ed9ecf6a64ab3cd60e9e2091376
@@ -81,8 +81,6 @@ typedef struct _JabberStream JabberStrea
 /* Index into attention_types list */
 #define JABBER_BUZZ 0
 
-extern PurplePlugin *jabber_plugin;
-
 typedef enum {
 	JABBER_STREAM_OFFLINE,
 	JABBER_STREAM_CONNECTING,
@@ -384,6 +382,6 @@ void jabber_init_plugin(PurplePlugin *pl
 void jabber_unregister_commands(void);
 
 void jabber_init_plugin(PurplePlugin *plugin);
-void jabber_uninit_plugin(void);
+void jabber_uninit_plugin(PurplePlugin *plugin);
 
 #endif /* PURPLE_JABBER_H_ */
============================================================
--- libpurple/protocols/jabber/libxmpp.c	8b915eeb8d40f8ce332d7e9a5af73c665fd0f23e
+++ libpurple/protocols/jabber/libxmpp.c	e4ce89ddf64f9bdc73ad047f91e3b3443dae13d7
@@ -227,7 +227,7 @@ static gboolean unload_plugin(PurplePlug
 	jabber_unregister_commands();
 
 	/* Stay on target...stay on target... Almost there... */
-	jabber_uninit_plugin();
+	jabber_uninit_plugin(plugin);
 
 	return TRUE;
 }
============================================================
--- libpurple/protocols/jabber/message.c	762e96afab799c10137fc842befb6fefce65cd96
+++ libpurple/protocols/jabber/message.c	e783a4f7f3ff8a604c7fe5b52fc343c7dc1e1067
@@ -545,7 +545,7 @@ void jabber_message_parse(JabberStream *
 	to   = xmlnode_get_attrib(packet, "to");
 	type = xmlnode_get_attrib(packet, "type");
 
-	signal_return = GPOINTER_TO_INT(purple_signal_emit_return_1(jabber_plugin,
+	signal_return = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_connection_get_prpl(js->gc),
 			"jabber-receiving-message", js->gc, type, id, from, to, packet));
 	if (signal_return)
 		return;
============================================================
--- libpurple/protocols/jabber/presence.c	d3b10339a2c49f067027f23498b3cd6238d43a98
+++ libpurple/protocols/jabber/presence.c	da6a06862a683b1316e6ae5f8dacccf03d14d522
@@ -518,7 +518,7 @@ void jabber_presence_parse(JabberStream 
 	jb = jabber_buddy_find(js, from, TRUE);
 	g_return_if_fail(jb != NULL);
 
-	signal_return = GPOINTER_TO_INT(purple_signal_emit_return_1(jabber_plugin,
+	signal_return = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_connection_get_prpl(js->gc),
 			"jabber-receiving-presence", js->gc, type, from, packet));
 	if (signal_return)
 		return;


More information about the Commits mailing list