# HG changeset patch
# Node ID 004b32f92351
# Parent  170078e728c0
diff --git a/libpurple/protocols/bonjour/bonjour.c b/libpurple/protocols/bonjour/bonjour.c
--- a/libpurple/protocols/bonjour/bonjour.c
+++ b/libpurple/protocols/bonjour/bonjour.c
@@ -95,8 +95,7 @@
 }
 
 static void
-bonjour_login(PurpleAccount *account)
-{
+bonjour_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *account) {
 	PurpleConnection *gc = purple_account_get_connection(account);
 	BonjourData *bd;
 	PurpleStatus *status;
@@ -162,7 +161,8 @@
 }
 
 static void
-bonjour_close(PurpleConnection *connection)
+bonjour_close(G_GNUC_UNUSED PurpleProtocol *protocol,
+              PurpleConnection *connection)
 {
 	PurpleGroup *bonjour_group;
 	BonjourData *bd = purple_connection_get_protocol_data(connection);
@@ -325,7 +325,8 @@
 }
 
 static GList *
-bonjour_status_types(PurpleAccount *account)
+bonjour_status_types(G_GNUC_UNUSED PurpleProtocol *protocol,
+                     PurpleAccount *account)
 {
 	GList *status_types = NULL;
 	PurpleStatusType *type;
diff --git a/libpurple/protocols/demo/purpledemoprotocol.c b/libpurple/protocols/demo/purpledemoprotocol.c
--- a/libpurple/protocols/demo/purpledemoprotocol.c
+++ b/libpurple/protocols/demo/purpledemoprotocol.c
@@ -36,7 +36,9 @@
  * PurpleProtocol Implementation
  *****************************************************************************/
 static void
-purple_demo_protocol_login(PurpleAccount *account) {
+purple_demo_protocol_login(G_GNUC_UNUSED PurpleProtocol *protocol,
+                           PurpleAccount *account)
+{
 	PurpleConnection *connection = NULL;
 
 	connection = purple_account_get_connection(account);
@@ -46,7 +48,9 @@
 }
 
 static GList *
-purple_demo_protocol_status_types(PurpleAccount *account) {
+purple_demo_protocol_status_types(G_GNUC_UNUSED PurpleProtocol *protocol,
+                                  PurpleAccount *account)
+{
 	PurpleStatusType *type = NULL;
 	GList *status_types = NULL;
 
diff --git a/libpurple/protocols/facebook/facebook.c b/libpurple/protocols/facebook/facebook.c
--- a/libpurple/protocols/facebook/facebook.c
+++ b/libpurple/protocols/facebook/facebook.c
@@ -1008,8 +1008,7 @@
 }
 
 static void
-fb_login(PurpleAccount *acct)
-{
+fb_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *acct) {
 	const gchar *pass;
 	const gchar *user;
 	FbApi *api;
@@ -1113,8 +1112,7 @@
 }
 
 static void
-fb_close(PurpleConnection *gc)
-{
+fb_close(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleConnection *gc) {
 	FbApi *api;
 	FbData *fata;
 
@@ -1130,8 +1128,7 @@
 }
 
 static GList *
-fb_status_types(PurpleAccount *acct)
-{
+fb_status_types(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *acct) {
 	PurpleStatusType *type;
 	GList *types = NULL;
 
diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c
--- a/libpurple/protocols/gg/gg.c
+++ b/libpurple/protocols/gg/gg.c
@@ -781,8 +781,8 @@
 	}
 }
 
-static void ggp_login(PurpleAccount *account)
-{
+static void
+ggp_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *account) {
 	PurpleConnection *gc = purple_account_get_connection(account);
 	struct gg_login_params *glp;
 	GGPInfo *info;
@@ -905,8 +905,8 @@
 	}
 }
 
-static void ggp_close(PurpleConnection *gc)
-{
+static void
+ggp_close(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleConnection *gc) {
 	PurpleAccount *account;
 	GGPInfo *info;;
 
diff --git a/libpurple/protocols/gg/status.h b/libpurple/protocols/gg/status.h
--- a/libpurple/protocols/gg/status.h
+++ b/libpurple/protocols/gg/status.h
@@ -38,7 +38,7 @@
 void ggp_status_setup(PurpleConnection *gc);
 void ggp_status_cleanup(PurpleConnection *gc);
 
-GList * ggp_status_types(PurpleAccount *account);
+GList *ggp_status_types(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *account);
 int ggp_status_from_purplestatus(PurpleStatus *status, gchar **message);
 const gchar * ggp_status_to_purplestatus(int status);
 const gchar * ggp_status_get_name(const gchar *purple_status);
diff --git a/libpurple/protocols/gg/status.c b/libpurple/protocols/gg/status.c
--- a/libpurple/protocols/gg/status.c
+++ b/libpurple/protocols/gg/status.c
@@ -81,7 +81,9 @@
 	return ggp_utf8_strndup(msg, GG_STATUS_DESCR_MAXSIZE);
 }
 
-GList * ggp_status_types(PurpleAccount *account)
+GList *
+ggp_status_types(G_GNUC_UNUSED PurpleProtocol *protocol,
+                 PurpleAccount *account)
 {
 	GList *types = NULL;
 
diff --git a/libpurple/protocols/irc/irc.c b/libpurple/protocols/irc/irc.c
--- a/libpurple/protocols/irc/irc.c
+++ b/libpurple/protocols/irc/irc.c
@@ -40,11 +40,11 @@
 
 static void irc_ison_buddy_init(char *name, struct irc_buddy *ib, GList **list);
 
-static GList *irc_status_types(PurpleAccount *account);
+static GList *irc_status_types(PurpleProtocol *protocol, PurpleAccount *account);
 /* static GList *irc_chat_info(PurpleConnection *gc); */
-static void irc_login(PurpleAccount *account);
+static void irc_login(PurpleProtocol *protocol, PurpleAccount *account);
 static void irc_login_cb(GObject *source, GAsyncResult *res, gpointer user_data);
-static void irc_close(PurpleConnection *gc);
+static void irc_close(PurpleProtocol *protocol, PurpleConnection *gc);
 static int irc_im_send(PurpleProtocolIM *im, PurpleConnection *gc, PurpleMessage *msg);
 static int irc_chat_send(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int id, PurpleMessage *msg);
 static void irc_chat_join(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, GHashTable *data);
@@ -424,7 +424,9 @@
 	return g_list_append(NULL, split);
 }
 
-static GList *irc_status_types(PurpleAccount *account)
+static GList *
+irc_status_types(G_GNUC_UNUSED PurpleProtocol *protocol,
+                 PurpleAccount *account)
 {
 	PurpleStatusType *type;
 	GList *types = NULL;
@@ -522,8 +524,8 @@
 	return defaults;
 }
 
-static void irc_login(PurpleAccount *account)
-{
+static void
+irc_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *account) {
 	PurpleConnection *gc;
 	struct irc_conn *irc;
 	char **userparts;
@@ -672,8 +674,8 @@
 	}
 }
 
-static void irc_close(PurpleConnection *gc)
-{
+static void
+irc_close(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleConnection *gc) {
 	struct irc_conn *irc = purple_connection_get_protocol_data(gc);
 
 	if (irc == NULL)
diff --git a/libpurple/protocols/jabber/jabber.h b/libpurple/protocols/jabber/jabber.h
--- a/libpurple/protocols/jabber/jabber.h
+++ b/libpurple/protocols/jabber/jabber.h
@@ -369,9 +369,9 @@
 const char* jabber_list_emblem(PurpleProtocolClient *client, PurpleBuddy *b);
 char *jabber_status_text(PurpleProtocolClient *client, PurpleBuddy *b);
 void jabber_tooltip_text(PurpleProtocolClient *client, PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full);
-GList *jabber_status_types(PurpleAccount *account);
-void jabber_login(PurpleAccount *account);
-void jabber_close(PurpleConnection *gc);
+GList *jabber_status_types(PurpleProtocol *protocol, PurpleAccount *account);
+void jabber_login(PurpleProtocol *protocol, PurpleAccount *account);
+void jabber_close(PurpleProtocol *protocol, PurpleConnection *gc);
 void jabber_idle_set(PurpleProtocolServer *protocol_server, PurpleConnection *gc, int idle);
 void jabber_blocklist_parse_push(JabberStream *js, const char *from,
                                  JabberIqType type, const char *id,
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -998,8 +998,7 @@
 }
 
 void
-jabber_login(PurpleAccount *account)
-{
+jabber_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *account) {
 	PurpleConnection *gc = purple_account_get_connection(account);
 	JabberStream *js;
 	PurpleImage *image;
@@ -1496,12 +1495,15 @@
 	JabberStream *js;
 
 	if (purple_connection_get_state(gc) != PURPLE_CONNECTION_CONNECTED) {
-		if (purple_connection_get_state(gc) != PURPLE_CONNECTION_CONNECTING)
-			jabber_login(account);
+		if (purple_connection_get_state(gc) != PURPLE_CONNECTION_CONNECTING) {
+			jabber_login(PURPLE_PROTOCOL(protocol_server), account);
+		}
+
 		js = purple_connection_get_protocol_data(gc);
 		js->unregistration = TRUE;
 		js->unregistration_cb = cb;
 		js->unregistration_user_data = user_data;
+
 		return;
 	}
 
@@ -1524,8 +1526,8 @@
  * termination before destroying everything. That seems like it would require
  * changing the semantics of protocol's close(), so it's a good idea for 3.0.0.
  */
-void jabber_close(PurpleConnection *gc)
-{
+void
+jabber_close(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleConnection *gc) {
 	JabberStream *js = purple_connection_get_protocol_data(gc);
 
 	/* Close all of the open Jingle sessions on this stream */
@@ -2222,7 +2224,9 @@
 	}
 }
 
-GList *jabber_status_types(PurpleAccount *account)
+GList *
+jabber_status_types(G_GNUC_UNUSED PurpleProtocol *protocol,
+                    PurpleAccount *account)
 {
 	PurpleStatusType *type;
 	GList *types = NULL;
diff --git a/libpurple/protocols/novell/novell.c b/libpurple/protocols/novell/novell.c
--- a/libpurple/protocols/novell/novell.c
+++ b/libpurple/protocols/novell/novell.c
@@ -2185,8 +2185,7 @@
  ******************************************************************************/
 
 static void
-novell_login(PurpleAccount * account)
-{
+novell_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount * account) {
 	PurpleConnection *gc;
 	NMUser *user = NULL;
 	const char *server;
@@ -2241,8 +2240,7 @@
 }
 
 static void
-novell_close(PurpleConnection * gc)
-{
+novell_close(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleConnection * gc) {
 	NMUser *user;
 	NMConn *conn;
 
@@ -3009,7 +3007,8 @@
 }
 
 static GList *
-novell_status_types(PurpleAccount *account)
+novell_status_types(G_GNUC_UNUSED PurpleProtocol *protocol,
+                    PurpleAccount *account)
 {
 	GList *status_types = NULL;
 	PurpleStatusType *type;
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -3222,7 +3222,9 @@
   }
 }
 
-static GList *mw_protocol_status_types(PurpleAccount *acct)
+static GList *
+mw_protocol_status_types(G_GNUC_UNUSED PurpleProtocol *protocol,
+                         PurpleAccount *acct)
 {
 	GList *types = NULL;
 	PurpleStatusType *type;
@@ -3520,10 +3522,10 @@
 }
 
 
-static void mw_protocol_login(PurpleAccount *acct);
-
-
-static void mw_protocol_login(PurpleAccount *account) {
+static void
+mw_protocol_login(G_GNUC_UNUSED PurpleProtocol *protocol,
+                  PurpleAccount *account)
+{
   PurpleConnection *gc;
   struct mwPurpleProtocolData *pd;
 
@@ -3611,7 +3613,10 @@
 }
 
 
-static void mw_protocol_close(PurpleConnection *gc) {
+static void
+mw_protocol_close(G_GNUC_UNUSED PurpleProtocol *protocol,
+                  PurpleConnection *gc)
+{
   struct mwPurpleProtocolData *pd;
 
   g_return_if_fail(gc != NULL);
diff --git a/libpurple/protocols/silc/silc.c b/libpurple/protocols/silc/silc.c
--- a/libpurple/protocols/silc/silc.c
+++ b/libpurple/protocols/silc/silc.c
@@ -65,7 +65,8 @@
 }
 
 static GList *
-silcpurple_away_states(PurpleAccount *account)
+silcpurple_away_states(G_GNUC_UNUSED PurpleProtocol *protocol,
+                       PurpleAccount *account)
 {
 	PurpleStatusType *type;
 	GList *types = NULL;
@@ -575,7 +576,8 @@
 }
 
 static void
-silcpurple_login(PurpleAccount *account)
+silcpurple_login(G_GNUC_UNUSED PurpleProtocol *protocol,
+                 PurpleAccount *account)
 {
 	SilcClient client;
 	PurpleConnection *gc;
@@ -712,7 +714,7 @@
 }
 
 static void
-silcpurple_close(PurpleConnection *gc)
+silcpurple_close(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleConnection *gc)
 {
 	SilcPurple sg = purple_connection_get_protocol_data(gc);
 	SilcPurpleTask task;
diff --git a/libpurple/protocols/zephyr/zephyr.c b/libpurple/protocols/zephyr/zephyr.c
--- a/libpurple/protocols/zephyr/zephyr.c
+++ b/libpurple/protocols/zephyr/zephyr.c
@@ -672,8 +672,8 @@
 	return g_strdup(realm);
 }
 
-static void zephyr_login(PurpleAccount * account)
-{
+static void
+zephyr_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount * account) {
 	PurpleConnection *gc;
 	zephyr_account *zephyr;
 	ZephyrLoginFunc login;
@@ -850,8 +850,8 @@
 	g_free(fname);
 }
 
-static void zephyr_close(PurpleConnection * gc)
-{
+static void
+zephyr_close(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleConnection * gc) {
 	zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
 
 	g_list_free_full(zephyr->pending_zloc_names, g_free);
@@ -1060,7 +1060,9 @@
 	}
 }
 
-static GList *zephyr_status_types(PurpleAccount *account)
+static GList *
+zephyr_status_types(G_GNUC_UNUSED PurpleProtocol *protocol,
+                    PurpleAccount *account)
 {
 	PurpleStatusType *type;
 	GList *types = NULL;
diff --git a/libpurple/purpleprotocol.h b/libpurple/purpleprotocol.h
--- a/libpurple/purpleprotocol.h
+++ b/libpurple/purpleprotocol.h
@@ -141,11 +141,11 @@
 	PurpleBuddyIconSpec *(*get_buddy_icon_spec)(PurpleProtocol *protocol);
 	PurpleWhiteboardOps *(*get_whiteboard_ops)(PurpleProtocol *protocol);
 
-	void (*login)(PurpleAccount *account);
+	void (*login)(PurpleProtocol *protocol, PurpleAccount *account);
 
-	void (*close)(PurpleConnection *connection);
+	void (*close)(PurpleProtocol *protocol, PurpleConnection *connection);
 
-	GList *(*status_types)(PurpleAccount *account);
+	GList *(*status_types)(PurpleProtocol *protocol, PurpleAccount *account);
 
 	/*< private >*/
 	gpointer reserved[4];
diff --git a/libpurple/purpleprotocol.c b/libpurple/purpleprotocol.c
--- a/libpurple/purpleprotocol.c
+++ b/libpurple/purpleprotocol.c
@@ -531,7 +531,7 @@
 
 	klass = PURPLE_PROTOCOL_GET_CLASS(protocol);
 	if(klass != NULL && klass->login != NULL) {
-		klass->login(account);
+		klass->login(protocol, account);
 	}
 }
 
@@ -544,7 +544,7 @@
 
 	klass = PURPLE_PROTOCOL_GET_CLASS(protocol);
 	if(klass != NULL && klass->close != NULL) {
-		klass->close(gc);
+		klass->close(protocol, gc);
 	}
 }
 
@@ -559,7 +559,7 @@
 
 	klass = PURPLE_PROTOCOL_GET_CLASS(protocol);
 	if(klass != NULL && klass->status_types != NULL) {
-		return klass->status_types(account);
+		return klass->status_types(protocol, account);
 	}
 
 	return NULL;
