diff --git a/libpurple/connection.h b/libpurple/connection.h
--- a/libpurple/connection.h
+++ b/libpurple/connection.h
@@ -114,15 +114,15 @@
 	PURPLE_CONNECTION_CONNECTING
 } PurpleConnectionState;
 
-#define PURPLE_CONNECTION_ERROR purple_connection_error_quark()
-
 /**
- * purple_connection_error_quark:
+ * PURPLE_CONNECTION_ERROR:
  *
  * Error domain for Purple connection errors. Errors in this domain will be
  * from the #PurpleConnectionError enum.
+ *
+ * Since: 3.0.0
  */
-GQuark purple_connection_error_quark(void);
+#define PURPLE_CONNECTION_ERROR (g_quark_from_static_string("purple-connection-error"))
 
 /**
  * PurpleConnectionError:
# HG changeset patch
# Node ID cde5798a4e27
# Parent  b60171ce4589
diff --git a/libpurple/connection.c b/libpurple/connection.c
--- a/libpurple/connection.c
+++ b/libpurple/connection.c
@@ -39,21 +39,14 @@
 #include "signals.h"
 #include "util.h"
 
-G_DEFINE_QUARK(purple-connection-error-quark, purple_connection_error);
-
 /**
  * PurpleConnection:
  *
  * Represents an active connection on an account.
  */
-struct _PurpleConnection
-{
+struct _PurpleConnection {
 	GObject gparent;
-};
 
-/* Private data for a connection */
-typedef struct
-{
 	PurpleProtocol *protocol;     /* The protocol.                     */
 	PurpleConnectionFlags flags;  /* Connection flags.                 */
 
@@ -88,9 +81,7 @@
 	guint disconnect_timeout;  /* Timer used for nasty stack tricks. */
 } PurpleConnectionPrivate;
 
-/* GObject property enums */
-enum
-{
+enum {
 	PROP_0,
 	PROP_PROTOCOL,
 	PROP_FLAGS,
@@ -101,7 +92,7 @@
 	PROP_LAST
 };
 
-static GParamSpec *properties[PROP_LAST];
+static GParamSpec *properties[PROP_LAST] = {NULL, };
 
 static GList *connections = NULL;
 static GList *connections_connecting = NULL;
@@ -114,7 +105,7 @@
 purple_connection_error_info_new(PurpleConnectionError type,
                                  const gchar *description);
 
-G_DEFINE_TYPE_WITH_PRIVATE(PurpleConnection, purple_connection, G_TYPE_OBJECT)
+G_DEFINE_TYPE(PurpleConnection, purple_connection, G_TYPE_OBJECT)
 
 /**************************************************************************
  * Connection API
@@ -123,10 +114,8 @@
 send_keepalive(gpointer data)
 {
 	PurpleConnection *gc = data;
-	PurpleConnectionPrivate *priv = purple_connection_get_instance_private(gc);
 
-	purple_protocol_server_keepalive(PURPLE_PROTOCOL_SERVER(priv->protocol),
-	                                 gc);
+	purple_protocol_server_keepalive(PURPLE_PROTOCOL_SERVER(gc->protocol), gc);
 
 	return TRUE;
 }
@@ -134,22 +123,18 @@
 static void
 update_keepalive(PurpleConnection *gc, gboolean on)
 {
-	PurpleConnectionPrivate *priv = purple_connection_get_instance_private(gc);
-
-	if (!PURPLE_PROTOCOL_IMPLEMENTS(priv->protocol, SERVER, keepalive))
+	if(!PURPLE_PROTOCOL_IMPLEMENTS(gc->protocol, SERVER, keepalive)) {
 		return;
+	}
 
-	if (on && !priv->keepalive)
-	{
-		int interval = purple_protocol_server_get_keepalive_interval(PURPLE_PROTOCOL_SERVER(priv->protocol));
+	if(on && !gc->keepalive) {
+		int interval = purple_protocol_server_get_keepalive_interval(PURPLE_PROTOCOL_SERVER(gc->protocol));
 		purple_debug_info("connection", "Activating keepalive to %d seconds.", interval);
-		priv->keepalive = g_main_context_find_source_by_id(NULL, g_timeout_add_seconds(interval, send_keepalive, gc));
-	}
-	else if (!on && priv->keepalive)
-	{
+		gc->keepalive = g_main_context_find_source_by_id(NULL, g_timeout_add_seconds(interval, send_keepalive, gc));
+	} else if (!on && gc->keepalive) {
 		purple_debug_info("connection", "Deactivating keepalive.\n");
-		g_source_destroy(priv->keepalive);
-		priv->keepalive = NULL;
+		g_source_destroy(gc->keepalive);
+		gc->keepalive = NULL;
 	}
 }
 
@@ -166,28 +151,25 @@
 void
 purple_connection_set_state(PurpleConnection *gc, PurpleConnectionState state)
 {
-	PurpleConnectionPrivate *priv = NULL;
 	PurpleConnectionUiOps *ops;
 
 	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
 
-	priv = purple_connection_get_instance_private(gc);
+	if(gc->state == state) {
+		return;
+	}
 
-	if (priv->state == state)
-		return;
-
-	priv->state = state;
+	gc->state = state;
 
 	ops = purple_connections_get_ui_ops();
 
-	if (priv->state == PURPLE_CONNECTION_CONNECTING) {
+	if(gc->state == PURPLE_CONNECTION_CONNECTING) {
 		connections_connecting = g_list_append(connections_connecting, gc);
-	}
-	else {
+	} else {
 		connections_connecting = g_list_remove(connections_connecting, gc);
 	}
 
-	if (priv->state == PURPLE_CONNECTION_CONNECTED) {
+	if(gc->state == PURPLE_CONNECTION_CONNECTED) {
 		PurpleAccount *account;
 		PurplePresence *presence;
 		gboolean emit_online = FALSE;
@@ -200,8 +182,9 @@
 		/* Set the time the account came online */
 		purple_presence_set_login_time(presence, time(NULL));
 
-		if (ops != NULL && ops->connected != NULL)
+		if(ops != NULL && ops->connected != NULL) {
 			ops->connected(gc);
+		}
 
 		purple_blist_add_account(account);
 
@@ -224,190 +207,137 @@
 		if(emit_online) {
 			purple_signal_emit(handle, "online");
 		}
-	}
-	else if (priv->state == PURPLE_CONNECTION_DISCONNECTED) {
-		if (ops != NULL && ops->disconnected != NULL)
+	} else if(gc->state == PURPLE_CONNECTION_DISCONNECTED) {
+		if(ops != NULL && ops->disconnected != NULL) {
 			ops->disconnected(gc);
+		}
 	}
 
-	if (!priv->is_finalizing)
+	if(!gc->is_finalizing) {
 		g_object_notify_by_pspec(G_OBJECT(gc), properties[PROP_STATE]);
+	}
 }
 
 void
 purple_connection_set_flags(PurpleConnection *gc, PurpleConnectionFlags flags)
 {
-	PurpleConnectionPrivate *priv = NULL;
-
 	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
 
-	priv = purple_connection_get_instance_private(gc);
-	priv->flags = flags;
+	gc->flags = flags;
 
-	if (!priv->is_finalizing)
+	if(!gc->is_finalizing) {
 		g_object_notify_by_pspec(G_OBJECT(gc), properties[PROP_FLAGS]);
+	}
 }
 
 void
-purple_connection_set_display_name(PurpleConnection *gc, const char *name)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_set_display_name(PurpleConnection *gc, const gchar *name) {
 	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
 
-	priv = purple_connection_get_instance_private(gc);
-	g_free(priv->display_name);
-	priv->display_name = g_strdup(name);
+	g_free(gc->display_name);
+	gc->display_name = g_strdup(name);
 
 	g_object_notify_by_pspec(G_OBJECT(gc), properties[PROP_DISPLAY_NAME]);
 }
 
 void
-purple_connection_set_protocol_data(PurpleConnection *gc, void *proto_data)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_set_protocol_data(PurpleConnection *gc, void *proto_data) {
 	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
 
-	priv = purple_connection_get_instance_private(gc);
-	priv->proto_data = proto_data;
+	gc->proto_data = proto_data;
 }
 
 PurpleConnectionState
-purple_connection_get_state(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_get_state(PurpleConnection *gc) {
 	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), PURPLE_CONNECTION_DISCONNECTED);
 
-	priv = purple_connection_get_instance_private(gc);
-	return priv->state;
+	return gc->state;
 }
 
 PurpleConnectionFlags
-purple_connection_get_flags(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_get_flags(PurpleConnection *gc) {
 	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), 0);
 
-	priv = purple_connection_get_instance_private(gc);
-	return priv->flags;
+	return gc->flags;
 }
 
 gboolean
-purple_connection_is_disconnecting(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_is_disconnecting(PurpleConnection *gc) {
 	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), TRUE);
 
-	priv = purple_connection_get_instance_private(gc);
-	return priv->is_finalizing;
+	return gc->is_finalizing;
 }
 
 PurpleAccount *
-purple_connection_get_account(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_get_account(PurpleConnection *gc) {
 	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), NULL);
 
-	priv = purple_connection_get_instance_private(gc);
-	return priv->account;
+	return gc->account;
 }
 
 PurpleProtocol *
-purple_connection_get_protocol(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_get_protocol(PurpleConnection *gc) {
 	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), NULL);
 
-	priv = purple_connection_get_instance_private(gc);
-	return priv->protocol;
+	return gc->protocol;
 }
 
 const char *
-purple_connection_get_password(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_get_password(PurpleConnection *gc) {
 	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), NULL);
 
-	priv = purple_connection_get_instance_private(gc);
-	return priv->password;
+	return gc->password;
 }
 
 GSList *
-purple_connection_get_active_chats(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_get_active_chats(PurpleConnection *gc) {
 	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), NULL);
 
-	priv = purple_connection_get_instance_private(gc);
-	return priv->active_chats;
+	return gc->active_chats;
 }
 
 const char *
-purple_connection_get_display_name(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_get_display_name(PurpleConnection *gc) {
 	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), NULL);
 
-	priv = purple_connection_get_instance_private(gc);
-	return priv->display_name;
+	return gc->display_name;
 }
 
 void *
-purple_connection_get_protocol_data(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_get_protocol_data(PurpleConnection *gc) {
 	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), NULL);
 
-	priv = purple_connection_get_instance_private(gc);
-	return priv->proto_data;
+	return gc->proto_data;
 }
 
 void
-_purple_connection_add_active_chat(PurpleConnection *gc, PurpleChatConversation *chat)
+_purple_connection_add_active_chat(PurpleConnection *gc,
+                                   PurpleChatConversation *chat)
 {
-	PurpleConnectionPrivate *priv = NULL;
-
 	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
 
-	priv = purple_connection_get_instance_private(gc);
-	priv->active_chats = g_slist_append(priv->active_chats, chat);
+	gc->active_chats = g_slist_append(gc->active_chats, chat);
 }
 
 void
-_purple_connection_remove_active_chat(PurpleConnection *gc, PurpleChatConversation *chat)
+_purple_connection_remove_active_chat(PurpleConnection *gc,
+                                      PurpleChatConversation *chat)
 {
-	PurpleConnectionPrivate *priv = NULL;
-
 	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
 
-	priv = purple_connection_get_instance_private(gc);
-	priv->active_chats = g_slist_remove(priv->active_chats, chat);
+	gc->active_chats = g_slist_remove(gc->active_chats, chat);
 }
 
 gboolean
-_purple_connection_wants_to_die(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+_purple_connection_wants_to_die(PurpleConnection *gc) {
 	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), FALSE);
 
-	priv = purple_connection_get_instance_private(gc);
-	return priv->wants_to_die;
+	return gc->wants_to_die;
 }
 
 void
 purple_connection_update_progress(PurpleConnection *gc, const char *text,
-								size_t step, size_t count)
+                                  size_t step, size_t count)
 {
 	PurpleConnectionUiOps *ops;
 
@@ -418,13 +348,13 @@
 
 	ops = purple_connections_get_ui_ops();
 
-	if (ops != NULL && ops->connect_progress != NULL)
+	if(ops != NULL && ops->connect_progress != NULL) {
 		ops->connect_progress(gc, text, step, count);
+	}
 }
 
 void
-purple_connection_notice(PurpleConnection *gc, const char *text)
-{
+purple_connection_notice(PurpleConnection *gc, const char *text) {
 	PurpleConnectionUiOps *ops;
 
 	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
@@ -432,94 +362,89 @@
 
 	ops = purple_connections_get_ui_ops();
 
-	if (ops != NULL && ops->notice != NULL)
+	if(ops != NULL && ops->notice != NULL) {
 		ops->notice(gc, text);
+	}
 }
 
 static gboolean
-purple_connection_disconnect_cb(gpointer data)
-{
-	PurpleAccount *account;
+purple_connection_disconnect_cb(gpointer data) {
+	PurpleAccount *account = data;
 	PurpleConnection *gc;
 
-	account = data;
 	gc = purple_account_get_connection(account);
 
-	if (PURPLE_IS_CONNECTION(gc)) {
-		PurpleConnectionPrivate *priv;
-		priv = purple_connection_get_instance_private(gc);
-		priv->disconnect_timeout = 0;
+	if(PURPLE_IS_CONNECTION(gc)) {
+		gc->disconnect_timeout = 0;
 	}
 
 	purple_account_disconnect(account);
+
 	return FALSE;
 }
 
 void
-purple_connection_error (PurpleConnection *gc,
-                         PurpleConnectionError reason,
-                         const char *description)
+purple_connection_error(PurpleConnection *gc,
+                        PurpleConnectionError reason,
+                        const char *description)
 {
-	PurpleConnectionPrivate *priv = NULL;
 	PurpleConnectionUiOps *ops;
 
 	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
-	priv = purple_connection_get_instance_private(gc);
 
 	/* This sanity check relies on PURPLE_CONNECTION_ERROR_OTHER_ERROR
 	 * being the last member of the PurpleConnectionError enum in
 	 * connection.h; if other reasons are added after it, this check should
 	 * be updated.
 	 */
-	if (reason > PURPLE_CONNECTION_ERROR_OTHER_ERROR) {
+	if(reason > PURPLE_CONNECTION_ERROR_OTHER_ERROR) {
 		purple_debug_error("connection",
 			"purple_connection_error: reason %u isn't a "
 			"valid reason\n", reason);
 		reason = PURPLE_CONNECTION_ERROR_OTHER_ERROR;
 	}
 
-	if (description == NULL) {
+	if(description == NULL) {
 		purple_debug_error("connection", "purple_connection_error called with NULL description\n");
 		description = _("Unknown error");
 	}
 
 	/* If we've already got one error, we don't need any more */
-	if (purple_connection_get_error_info(gc))
+	if(purple_connection_get_error_info(gc)) {
 		return;
+	}
 
-	priv->wants_to_die = purple_connection_error_is_fatal (reason);
+	gc->wants_to_die = purple_connection_error_is_fatal(reason);
 
-	purple_debug_info("connection", "Connection error on %p (reason: %u description: %s)\n",
+	purple_debug_info("connection",
+	                  "Connection error on %p (reason: %u description: %s)\n",
 	                  gc, reason, description);
 
 	ops = purple_connections_get_ui_ops();
 
-	if (ops && ops->report_disconnect)
+	if(ops && ops->report_disconnect) {
 		ops->report_disconnect(gc, reason, description);
+	}
 
-	priv->error_info = purple_connection_error_info_new(reason, description);
+	gc->error_info = purple_connection_error_info_new(reason, description);
 
 	purple_signal_emit(purple_connections_get_handle(), "connection-error",
-		gc, reason, description);
+	                   gc, reason, description);
 
-	priv->disconnect_timeout = g_timeout_add(0, purple_connection_disconnect_cb,
-			purple_connection_get_account(gc));
+	gc->disconnect_timeout = g_timeout_add(0, purple_connection_disconnect_cb,
+	                                       purple_connection_get_account(gc));
 }
 
 PurpleConnectionErrorInfo *
-purple_connection_get_error_info(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+purple_connection_get_error_info(PurpleConnection *gc) {
 	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), NULL);
 
-	priv = purple_connection_get_instance_private(gc);
-	return priv->error_info;
+	return gc->error_info;
 }
 
 void
-purple_connection_ssl_error (PurpleConnection *gc,
-                             PurpleSslErrorType ssl_error)
+purple_connection_ssl_error(PurpleConnection *gc,
+                            PurpleSslErrorType ssl_error)
 {
 	PurpleConnectionError reason;
 	const gchar *message;
@@ -548,16 +473,15 @@
 }
 
 void
-purple_connection_g_error(PurpleConnection *pc, const GError *error)
-{
+purple_connection_g_error(PurpleConnection *pc, const GError *error) {
 	PurpleConnectionError reason;
 
-	if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+	if(g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
 		/* Not a connection error. Ignore. */
 		return;
 	}
 
-	if (error->domain == G_TLS_ERROR) {
+	if(error->domain == G_TLS_ERROR) {
 		switch (error->code) {
 			case G_TLS_ERROR_UNAVAILABLE:
 				reason = PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT;
@@ -587,17 +511,14 @@
 }
 
 void
-purple_connection_take_error(PurpleConnection *pc, GError *error)
-{
+purple_connection_take_error(PurpleConnection *pc, GError *error) {
 	purple_connection_g_error(pc, error);
 	g_error_free(error);
 }
 
 gboolean
-purple_connection_error_is_fatal (PurpleConnectionError reason)
-{
-	switch (reason)
-	{
+purple_connection_error_is_fatal(PurpleConnectionError reason) {
+	switch (reason) {
 		case PURPLE_CONNECTION_ERROR_NETWORK_ERROR:
 		case PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR:
 			return FALSE;
@@ -622,28 +543,25 @@
 	}
 }
 
-void purple_connection_update_last_received(PurpleConnection *gc)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
+void
+purple_connection_update_last_received(PurpleConnection *gc) {
 	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
-	priv = purple_connection_get_instance_private(gc);
 
 	/*
 	 * For safety, actually this function shouldn't be called when the
 	 * keepalive mechanism is inactive.
 	 */
-	if (priv->keepalive) {
+	if(gc->keepalive) {
 		/* The #GTimeoutSource API doesn't expose a function to reset when a
 		 * #GTimeoutSource will dispatch the next time, but because it works to
 		 * directly call g_source_set_ready_time() on a #GTimeoutSource, and since
 		 * it seems unlikely that the implementation will change, we just do that
 		 * for now as a workaround for this API shortcoming.
 		 */
-		gint64 seconds_from_now = purple_protocol_server_get_keepalive_interval(PURPLE_PROTOCOL_SERVER(priv->protocol));
+		gint64 seconds_from_now = purple_protocol_server_get_keepalive_interval(PURPLE_PROTOCOL_SERVER(gc->protocol));
 
 		g_source_set_ready_time(
-			priv->keepalive,
+			gc->keepalive,
 			g_get_monotonic_time() + (seconds_from_now * G_USEC_PER_SEC)
 		);
 	}
@@ -659,7 +577,7 @@
 
 	err = g_new(PurpleConnectionErrorInfo, 1);
 
-	err->type        = type;
+	err->type = type;
 	err->description = g_strdup(description);
 
 	return err;
@@ -682,11 +600,10 @@
 }
 
 GType
-purple_connection_ui_ops_get_type(void)
-{
+purple_connection_ui_ops_get_type(void) {
 	static GType type = 0;
 
-	if (type == 0) {
+	if(type == 0) {
 		type = g_boxed_type_register_static("PurpleConnectionUiOps",
 				(GBoxedCopyFunc)purple_connection_ui_ops_copy,
 				(GBoxedFreeFunc)g_free);
@@ -704,8 +621,7 @@
 }
 
 static void
-purple_connection_error_info_free(PurpleConnectionErrorInfo *err)
-{
+purple_connection_error_info_free(PurpleConnectionErrorInfo *err) {
 	g_return_if_fail(err != NULL);
 
 	g_free(err->description);
@@ -713,8 +629,7 @@
 }
 
 GType
-purple_connection_error_info_get_type(void)
-{
+purple_connection_error_info_get_type(void) {
 	static GType type = 0;
 
 	if (type == 0) {
@@ -730,17 +645,15 @@
  * GObject code
  **************************************************************************/
 
-/* Set method for GObject properties */
 static void
-purple_connection_set_property(GObject *obj, guint param_id, const GValue *value,
-		GParamSpec *pspec)
+purple_connection_set_property(GObject *obj, guint param_id,
+                               const GValue *value, GParamSpec *pspec)
 {
 	PurpleConnection *gc = PURPLE_CONNECTION(obj);
-	PurpleConnectionPrivate *priv = purple_connection_get_instance_private(gc);
 
 	switch (param_id) {
 		case PROP_PROTOCOL:
-			priv->protocol = g_value_get_object(value);
+			gc->protocol = g_value_get_object(value);
 			break;
 		case PROP_FLAGS:
 			purple_connection_set_flags(gc, g_value_get_flags(value));
@@ -749,11 +662,11 @@
 			purple_connection_set_state(gc, g_value_get_enum(value));
 			break;
 		case PROP_ACCOUNT:
-			priv->account = g_value_get_object(value);
+			gc->account = g_value_get_object(value);
 			break;
 		case PROP_PASSWORD:
-			g_free(priv->password);
-			priv->password = g_value_dup_string(value);
+			g_free(gc->password);
+			gc->password = g_value_dup_string(value);
 			break;
 		case PROP_DISPLAY_NAME:
 			purple_connection_set_display_name(gc, g_value_get_string(value));
@@ -764,10 +677,9 @@
 	}
 }
 
-/* Get method for GObject properties */
 static void
 purple_connection_get_property(GObject *obj, guint param_id, GValue *value,
-		GParamSpec *pspec)
+                               GParamSpec *pspec)
 {
 	PurpleConnection *gc = PURPLE_CONNECTION(obj);
 
@@ -796,18 +708,14 @@
 	}
 }
 
-/* GObject initialization function */
 static void
-purple_connection_init(PurpleConnection *gc)
-{
+purple_connection_init(PurpleConnection *gc) {
 	purple_connection_set_state(gc, PURPLE_CONNECTION_CONNECTING);
 	connections = g_list_append(connections, gc);
 }
 
-/* Called when done constructing */
 static void
-purple_connection_constructed(GObject *object)
-{
+purple_connection_constructed(GObject *object) {
 	PurpleConnection *gc = PURPLE_CONNECTION(object);
 	PurpleAccount *account;
 
@@ -820,18 +728,15 @@
 	purple_signal_emit(purple_connections_get_handle(), "signing-on", gc);
 }
 
-/* GObject finalize function */
 static void
-purple_connection_finalize(GObject *object)
-{
+purple_connection_finalize(GObject *object) {
 	PurpleConnection *gc = PURPLE_CONNECTION(object);
-	PurpleConnectionPrivate *priv = purple_connection_get_instance_private(gc);
 	PurpleAccount *account;
 	GSList *buddies;
 	gboolean remove = FALSE;
 	gpointer handle;
 
-	priv->is_finalizing = TRUE;
+	gc->is_finalizing = TRUE;
 
 	account = purple_connection_get_account(gc);
 	handle = purple_connections_get_handle();
@@ -843,11 +748,12 @@
 
 	purple_signal_emit(handle, "signing-off", gc);
 
-	g_slist_free_full(priv->active_chats, (GDestroyNotify)purple_chat_conversation_leave);
+	g_slist_free_full(gc->active_chats,
+	                  (GDestroyNotify)purple_chat_conversation_leave);
 
 	update_keepalive(gc, FALSE);
 
-	purple_protocol_close(priv->protocol, gc);
+	purple_protocol_close(gc->protocol, gc);
 
 	/* Clear out the proto data that was freed in the protocol's close method */
 	buddies = purple_blist_find_buddies(account, NULL);
@@ -861,8 +767,9 @@
 
 	purple_connection_set_state(gc, PURPLE_CONNECTION_DISCONNECTED);
 
-	if (remove)
+	if(remove) {
 		purple_blist_remove_account(account);
+	}
 
 	purple_signal_emit(handle, "signed-off", gc);
 
@@ -879,78 +786,81 @@
 
 	purple_account_set_connection(account, NULL);
 
-	if (priv->error_info)
-		purple_connection_error_info_free(priv->error_info);
+	if(gc->error_info) {
+		purple_connection_error_info_free(gc->error_info);
+	}
 
-	if (priv->disconnect_timeout > 0)
-		g_source_remove(priv->disconnect_timeout);
+	if(gc->disconnect_timeout > 0) {
+		g_source_remove(gc->disconnect_timeout);
+	}
 
-	purple_str_wipe(priv->password);
-	g_free(priv->display_name);
+	purple_str_wipe(gc->password);
+	g_free(gc->display_name);
 
 	G_OBJECT_CLASS(purple_connection_parent_class)->finalize(object);
 }
 
-/* Class initializer function */
-static void purple_connection_class_init(PurpleConnectionClass *klass)
-{
+static void
+purple_connection_class_init(PurpleConnectionClass *klass) {
 	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
 
+	obj_class->get_property = purple_connection_get_property;
+	obj_class->set_property = purple_connection_set_property;
 	obj_class->finalize = purple_connection_finalize;
 	obj_class->constructed = purple_connection_constructed;
 
-	/* Setup properties */
-	obj_class->get_property = purple_connection_get_property;
-	obj_class->set_property = purple_connection_set_property;
+	properties[PROP_PROTOCOL] = g_param_spec_object(
+		"protocol", "Protocol",
+		"The protocol that the connection is using.",
+		PURPLE_TYPE_PROTOCOL,
+		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
 
-	properties[PROP_PROTOCOL] = g_param_spec_object("protocol", "Protocol",
-				"The protocol that the connection is using.",
-				PURPLE_TYPE_PROTOCOL,
-				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
-				G_PARAM_STATIC_STRINGS);
-
-	properties[PROP_FLAGS] = g_param_spec_flags("flags", "Connection flags",
-				"The flags of the connection.",
-				PURPLE_TYPE_CONNECTION_FLAGS, 0,
-				G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+	properties[PROP_FLAGS] = g_param_spec_flags(
+		"flags", "Connection flags",
+		"The flags of the connection.",
+		PURPLE_TYPE_CONNECTION_FLAGS, 0,
+		G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
 
-	properties[PROP_STATE] = g_param_spec_enum("state", "Connection state",
-				"The current state of the connection.",
-				PURPLE_TYPE_CONNECTION_STATE, PURPLE_CONNECTION_DISCONNECTED,
-				G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	properties[PROP_ACCOUNT] = g_param_spec_object("account", "Account",
-				"The account using the connection.", PURPLE_TYPE_ACCOUNT,
-				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
-				G_PARAM_STATIC_STRINGS);
+	properties[PROP_STATE] = g_param_spec_enum(
+		"state", "Connection state",
+		"The current state of the connection.",
+		PURPLE_TYPE_CONNECTION_STATE, PURPLE_CONNECTION_DISCONNECTED,
+		G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
 
-	properties[PROP_PASSWORD] = g_param_spec_string("password", "Password",
-				"The password used for connection.", NULL,
-				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
-				G_PARAM_STATIC_STRINGS);
+	properties[PROP_ACCOUNT] = g_param_spec_object(
+		"account", "Account",
+		"The account using the connection.", PURPLE_TYPE_ACCOUNT,
+		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
 
-	properties[PROP_DISPLAY_NAME] = g_param_spec_string("display-name",
-				"Display name",
-				"Your name that appears to other people.", NULL,
-				G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+	properties[PROP_PASSWORD] = g_param_spec_string(
+		"password", "Password",
+		"The password used for connection.", NULL,
+		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
+	properties[PROP_DISPLAY_NAME] = g_param_spec_string(
+		"display-name", "Display name",
+		"Your name that appears to other people.", NULL,
+		G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
 
 	g_object_class_install_properties(obj_class, PROP_LAST, properties);
 }
 
 void
-_purple_connection_new(PurpleAccount *account, gboolean is_registration, const gchar *password)
+_purple_connection_new(PurpleAccount *account, gboolean is_registration,
+                       const gchar *password)
 {
 	PurpleConnection *gc;
 	PurpleProtocol *protocol;
 
 	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
 
-	if (!purple_account_is_disconnected(account))
+	if(!purple_account_is_disconnected(account)) {
 		return;
+	}
 
 	protocol = purple_account_get_protocol(account);
 
-	if (protocol == NULL) {
+	if(protocol == NULL) {
 		gchar *message;
 
 		message = g_strdup_printf(_("Missing protocol for %s"),
@@ -959,58 +869,63 @@
 			_("Connection Error"), message, NULL,
 			purple_request_cpar_from_account(account));
 		g_free(message);
+
 		return;
 	}
 
-	if (is_registration) {
-		if (!PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, register_user)) {
+	if(is_registration) {
+		if(!PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, register_user)) {
 			return;
 		}
 	} else {
-		if (((password == NULL) || (*password == '\0')) &&
-			!(purple_protocol_get_options(protocol) & OPT_PROTO_NO_PASSWORD) &&
-			!(purple_protocol_get_options(protocol) & OPT_PROTO_PASSWORD_OPTIONAL))
+		if(((password == NULL) || (*password == '\0')) &&
+		   !(purple_protocol_get_options(protocol) & OPT_PROTO_NO_PASSWORD) &&
+		   !(purple_protocol_get_options(protocol) & OPT_PROTO_PASSWORD_OPTIONAL))
 		{
 			purple_debug_error("connection", "Cannot connect to account %s without "
 							 "a password.\n", purple_account_get_username(account));
+
 			return;
 		}
 	}
 
 	if(PURPLE_IS_PROTOCOL_FACTORY(protocol)) {
-		gc = purple_protocol_factory_connection_new(
-			PURPLE_PROTOCOL_FACTORY(protocol), account, password);
+		PurpleProtocolFactory *factory = PURPLE_PROTOCOL_FACTORY(protocol);
+
+		gc = purple_protocol_factory_connection_new(factory, account,
+		                                            password);
 	} else {
-		gc = g_object_new(PURPLE_TYPE_CONNECTION,
-				"protocol",  protocol,
-				"account",   account,
-				"password",  password,
-				NULL);
+		gc = g_object_new(
+			PURPLE_TYPE_CONNECTION,
+			"protocol", protocol,
+			"account", account,
+			"password", password,
+			NULL);
 	}
 
 	g_return_if_fail(gc != NULL);
 
-	if (is_registration) {
-		PurpleConnectionPrivate *priv;
+	if(is_registration) {
 		purple_debug_info("connection", "Registering.  gc = %p\n", gc);
 
 		/* set this so we don't auto-reconnect after registering */
-		priv = purple_connection_get_instance_private(gc);
-		priv->wants_to_die = TRUE;
+		gc->wants_to_die = TRUE;
 
 		purple_protocol_server_register_user(PURPLE_PROTOCOL_SERVER(protocol),
 		                                     account);
 	} else {
 		purple_debug_info("connection", "Connecting. gc = %p\n", gc);
 
-		purple_signal_emit(purple_accounts_get_handle(), "account-connecting", account);
+		purple_signal_emit(purple_accounts_get_handle(), "account-connecting",
+		                   account);
 		purple_protocol_login(protocol, account);
 	}
 }
 
 void
 _purple_connection_new_unregister(PurpleAccount *account, const char *password,
-		PurpleAccountUnregistrationCb cb, gpointer user_data)
+                                  PurpleAccountUnregistrationCb cb,
+                                  gpointer user_data)
 {
 	/* Lots of copy/pasted code to avoid API changes. You might want to integrate that into the previous function when possible. */
 	PurpleConnection *gc;
@@ -1020,7 +935,7 @@
 
 	protocol = purple_account_get_protocol(account);
 
-	if (protocol == NULL) {
+	if(protocol == NULL) {
 		gchar *message;
 
 		message = g_strdup_printf(_("Missing protocol for %s"),
@@ -1031,30 +946,33 @@
 		return;
 	}
 
-	if (!purple_account_is_disconnected(account)) {
+	if(!purple_account_is_disconnected(account)) {
 		purple_protocol_server_unregister_user(PURPLE_PROTOCOL_SERVER(protocol),
 		                                       account, cb, user_data);
 		return;
 	}
 
-	if (((password == NULL) || (*password == '\0')) &&
-		!(purple_protocol_get_options(protocol) & OPT_PROTO_NO_PASSWORD) &&
-		!(purple_protocol_get_options(protocol) & OPT_PROTO_PASSWORD_OPTIONAL))
+	if(((password == NULL) || (*password == '\0')) &&
+	   !(purple_protocol_get_options(protocol) & OPT_PROTO_NO_PASSWORD) &&
+	   !(purple_protocol_get_options(protocol) & OPT_PROTO_PASSWORD_OPTIONAL))
 	{
 		purple_debug_error("connection", "Cannot connect to account %s without "
 						   "a password.\n", purple_account_get_username(account));
+
 		return;
 	}
 
 	if(PURPLE_IS_PROTOCOL_FACTORY(protocol)) {
-		gc = purple_protocol_factory_connection_new(
-			PURPLE_PROTOCOL_FACTORY(protocol), account, password);
+		PurpleProtocolFactory *factory = PURPLE_PROTOCOL_FACTORY(protocol);
+		gc = purple_protocol_factory_connection_new(factory, account,
+		                                            password);
 	} else {
-		gc = g_object_new(PURPLE_TYPE_CONNECTION,
-				"protocol",  protocol,
-				"account",   account,
-				"password",  password,
-				NULL);
+		gc = g_object_new(
+			PURPLE_TYPE_CONNECTION,
+			"protocol", protocol,
+			"account", account,
+			"password", password,
+			NULL);
 	}
 
 	g_return_if_fail(gc != NULL);
@@ -1070,41 +988,39 @@
  **************************************************************************/
 
 void
-_purple_assert_connection_is_valid(PurpleConnection *gc,
-	const gchar *file, int line)
+_purple_assert_connection_is_valid(PurpleConnection *gc, const gchar *file,
+                                   int line)
 {
-	if (gc && g_list_find(purple_connections_get_all(), gc))
+	if(gc && g_list_find(purple_connections_get_all(), gc)) {
 		return;
+	}
 
 	purple_debug_fatal("connection", "PURPLE_ASSERT_CONNECTION_IS_VALID(%p)"
 		" failed at %s:%d", gc, file, line);
+
+	/* ugh - gk 2021-10-28 */
 	exit(-1);
 }
 
 void
-purple_connections_disconnect_all(void)
-{
+purple_connections_disconnect_all(void) {
 	GList *l;
 	PurpleConnection *gc;
-	PurpleConnectionPrivate *priv;
 
-	while ((l = purple_connections_get_all()) != NULL) {
+	while((l = purple_connections_get_all()) != NULL) {
 		gc = l->data;
-		priv = purple_connection_get_instance_private(gc);
-		priv->wants_to_die = TRUE;
-		purple_account_disconnect(priv->account);
+		gc->wants_to_die = TRUE;
+		purple_account_disconnect(gc->account);
 	}
 }
 
 GList *
-purple_connections_get_all(void)
-{
+purple_connections_get_all(void) {
 	return connections;
 }
 
 GList *
-purple_connections_get_connecting(void)
-{
+purple_connections_get_connecting(void) {
 	return connections_connecting;
 }
 
@@ -1114,20 +1030,17 @@
 }
 
 void
-purple_connections_set_ui_ops(PurpleConnectionUiOps *ops)
-{
+purple_connections_set_ui_ops(PurpleConnectionUiOps *ops) {
 	connection_ui_ops = ops;
 }
 
 PurpleConnectionUiOps *
-purple_connections_get_ui_ops(void)
-{
+purple_connections_get_ui_ops(void) {
 	return connection_ui_ops;
 }
 
 void
-purple_connections_init(void)
-{
+purple_connections_init(void) {
 	void *handle = purple_connections_get_handle();
 
 	purple_signal_register(handle, "online", purple_marshal_VOID, G_TYPE_NONE,
@@ -1160,17 +1073,14 @@
 	purple_signal_register(handle, "autojoin",
 	                       purple_marshal_BOOLEAN__POINTER, G_TYPE_NONE, 1,
 	                       PURPLE_TYPE_CONNECTION);
-
 }
 
 void
-purple_connections_uninit(void)
-{
+purple_connections_uninit(void) {
 	purple_signals_unregister_by_instance(purple_connections_get_handle());
 }
 
 void *
-purple_connections_get_handle(void)
-{
+purple_connections_get_handle(void) {
 	return &connections_handle;
 }
