diff --git a/libpurple/protocols/ircv3/purpleircv3connection.h b/libpurple/protocols/ircv3/purpleircv3connection.h
--- a/libpurple/protocols/ircv3/purpleircv3connection.h
+++ b/libpurple/protocols/ircv3/purpleircv3connection.h
@@ -31,14 +31,10 @@
 
 #define PURPLE_IRCV3_TYPE_CONNECTION (purple_ircv3_connection_get_type())
 G_DECLARE_FINAL_TYPE(PurpleIRCv3Connection, purple_ircv3_connection,
-                     PURPLE_IRCV3, CONNECTION, GObject)
+                     PURPLE_IRCV3, CONNECTION, PurpleConnection)
 
 G_GNUC_INTERNAL void purple_ircv3_connection_register(GPluginNativePlugin *plugin);
 
-G_GNUC_INTERNAL PurpleIRCv3Connection *purple_ircv3_connection_new(PurpleAccount *account);
-
-G_GNUC_INTERNAL PurpleAccount *purple_ircv3_connection_get_account(PurpleIRCv3Connection *connection);
-
 G_GNUC_INTERNAL GCancellable *purple_ircv3_connection_get_cancellable(PurpleIRCv3Connection *connection);
 
 G_GNUC_INTERNAL gboolean purple_ircv3_connection_valid(PurpleIRCv3Connection *connection, GError **error);
# HG changeset patch
# Node ID b9dc751fc9b6
# Parent  cf2659b7ae57
diff --git a/libpurple/protocols/ircv3/purpleircv3connection.c b/libpurple/protocols/ircv3/purpleircv3connection.c
--- a/libpurple/protocols/ircv3/purpleircv3connection.c
+++ b/libpurple/protocols/ircv3/purpleircv3connection.c
@@ -25,17 +25,15 @@
 
 enum {
 	PROP_0,
-	PROP_ACCOUNT,
 	PROP_CANCELLABLE,
 	N_PROPERTIES,
 };
 static GParamSpec *properties[N_PROPERTIES] = {NULL, };
 
 struct _PurpleIRCv3Connection {
-	GObject parent;
+	PurpleConnection parent;
 
 	GError *validate_error;
-	PurpleAccount *account;
 
 	GSocketConnection *connection;
 	GCancellable *cancellable;
@@ -49,42 +47,30 @@
 };
 
 G_DEFINE_DYNAMIC_TYPE(PurpleIRCv3Connection, purple_ircv3_connection,
-                      G_TYPE_OBJECT)
+                      PURPLE_TYPE_CONNECTION)
 
 /******************************************************************************
  * Helpers
  *****************************************************************************/
 static void
-purple_ircv3_connection_set_account(PurpleIRCv3Connection *connection,
-                                    PurpleAccount *account)
-{
-	g_return_if_fail(PURPLE_IRCV3_IS_CONNECTION(connection));
-
-	if(g_set_object(&connection->account, account)) {
-		g_object_notify_by_pspec(G_OBJECT(connection),
-		                         properties[PROP_ACCOUNT]);
-	}
-}
-
-static void
 purple_ircv3_connection_send_user_command(PurpleIRCv3Connection *connection) {
-	PurpleConnection *purple_connection = NULL;
+	PurpleAccount *account = NULL;
 	const char *identname = NULL;
 	const char *nickname = NULL;
 	const char *realname = NULL;
 
-	purple_connection = purple_account_get_connection(connection->account);
-	nickname = purple_connection_get_display_name(purple_connection);
+	account = purple_connection_get_account(PURPLE_CONNECTION(connection));
+	nickname = purple_connection_get_display_name(PURPLE_CONNECTION(connection));
 
 	/* The stored value could be an empty string, so pass a default of empty
 	 * string and then if it was empty, set our correct fallback.
 	 */
-	identname = purple_account_get_string(connection->account, "ident", "");
+	identname = purple_account_get_string(account, "ident", "");
 	if(identname == NULL || *identname == '\0') {
 		identname = nickname;
 	}
 
-	realname = purple_account_get_string(connection->account, "real-name", "");
+	realname = purple_account_get_string(account, "real-name", "");
 	if(realname == NULL || *realname == '\0') {
 		realname = nickname;
 	}
@@ -95,11 +81,9 @@
 
 static void
 purple_ircv3_connection_send_nick_command(PurpleIRCv3Connection *connection) {
-	PurpleConnection *purple_connection = NULL;
 	const char *nickname = NULL;
 
-	purple_connection = purple_account_get_connection(connection->account);
-	nickname = purple_connection_get_display_name(purple_connection);
+	nickname = purple_connection_get_display_name(PURPLE_CONNECTION(connection));
 
 	purple_ircv3_connection_writef(connection, "NICK %s", nickname);
 }
@@ -111,8 +95,7 @@
 purple_ircv3_connection_read_cb(GObject *source, GAsyncResult *result,
                                 gpointer data)
 {
-	PurpleIRCv3Connection *connection = NULL;
-	PurpleConnection *purple_connection = data;
+	PurpleIRCv3Connection *connection = data;
 	GDataInputStream *istream = G_DATA_INPUT_STREAM(source);
 	GError *error = NULL;
 	gchar *line = NULL;
@@ -129,7 +112,7 @@
 			g_prefix_error(&error, "%s", _("Lost connection with server: "));
 		}
 
-		purple_connection_take_error(purple_connection, error);
+		purple_connection_take_error(PURPLE_CONNECTION(connection), error);
 
 		/* In the off chance that line was returned, make sure we free it. */
 		g_free(line);
@@ -137,8 +120,6 @@
 		return;
 	}
 
-	connection = g_object_get_data(G_OBJECT(purple_connection),
-	                               PURPLE_IRCV3_CONNECTION_KEY);
 	purple_ircv3_parser_parse(connection->parser, line, &error, connection);
 
 	g_free(line);
@@ -148,7 +129,7 @@
 	                                    G_PRIORITY_DEFAULT,
 	                                    connection->cancellable,
 	                                    purple_ircv3_connection_read_cb,
-	                                    purple_connection);
+	                                    connection);
 }
 
 static void
@@ -164,15 +145,11 @@
 	                                                        &error);
 
 	if(!success) {
-		PurpleConnection *purple_connection = NULL;
-
-		purple_connection = purple_account_get_connection(connection->account);
-
 		purple_queued_output_stream_clear_queue(stream);
 
 		g_prefix_error(&error, "%s", _("Lost connection with server: "));
 
-		purple_connection_take_error(purple_connection, error);
+		purple_connection_take_error(PURPLE_CONNECTION(connection), error);
 
 		return;
 	}
@@ -182,8 +159,7 @@
 purple_ircv3_connection_connected_cb(GObject *source, GAsyncResult *result,
                                      gpointer data)
 {
-	PurpleIRCv3Connection *connection = NULL;
-	PurpleConnection *purple_connection = data;
+	PurpleIRCv3Connection *connection = data;
 	GError *error = NULL;
 	GInputStream *istream = NULL;
 	GOutputStream *ostream = NULL;
@@ -195,16 +171,13 @@
 	if(conn == NULL || error != NULL) {
 		g_prefix_error(&error, "%s", _("Unable to connect: "));
 
-		purple_connection_take_error(purple_connection, error);
+		purple_connection_take_error(PURPLE_CONNECTION(connection), error);
 
 		return;
 	}
 
 	/* Grab our protocol specific connection data. */
-	connection = g_object_get_data(G_OBJECT(purple_connection),
-	                               PURPLE_IRCV3_CONNECTION_KEY);
-
-	purple_connection_set_state(purple_connection,
+	purple_connection_set_state(PURPLE_CONNECTION(connection),
 	                            PURPLE_CONNECTION_CONNECTED);
 
 	g_message("Successfully connected to %s", connection->server_name);
@@ -229,7 +202,7 @@
 	                                    G_PRIORITY_DEFAULT,
 	                                    connection->cancellable,
 	                                    purple_ircv3_connection_read_cb,
-	                                    purple_connection);
+	                                    connection);
 
 	/* Send our registration commands. */
 	purple_ircv3_connection_send_user_command(connection);
@@ -246,10 +219,6 @@
 	PurpleIRCv3Connection *connection = PURPLE_IRCV3_CONNECTION(obj);
 
 	switch(param_id) {
-		case PROP_ACCOUNT:
-			g_value_set_object(value,
-			                   purple_ircv3_connection_get_account(connection));
-			break;
 		case PROP_CANCELLABLE:
 			g_value_set_object(value,
 			                   purple_ircv3_connection_get_cancellable(connection));
@@ -264,13 +233,7 @@
 purple_ircv3_connection_set_property(GObject *obj, guint param_id,
                                      const GValue *value, GParamSpec *pspec)
 {
-	PurpleIRCv3Connection *connection = PURPLE_IRCV3_CONNECTION(obj);
-
 	switch(param_id) {
-		case PROP_ACCOUNT:
-			purple_ircv3_connection_set_account(connection,
-			                                    g_value_get_object(value));
-			break;
 		default:
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
 			break;
@@ -281,7 +244,6 @@
 purple_ircv3_connection_dispose(GObject *obj) {
 	PurpleIRCv3Connection *connection = PURPLE_IRCV3_CONNECTION(obj);
 
-	g_clear_object(&connection->account);
 	g_clear_object(&connection->cancellable);
 
 	g_clear_object(&connection->input);
@@ -306,18 +268,18 @@
 static void
 purple_ircv3_connection_constructed(GObject *obj) {
 	PurpleIRCv3Connection *connection = PURPLE_IRCV3_CONNECTION(obj);
-	PurpleConnection *purple_connection = NULL;
+	PurpleAccount *account = NULL;
 	gchar **userparts = NULL;
 	const gchar *username = NULL;
 
 	G_OBJECT_CLASS(purple_ircv3_connection_parent_class)->constructed(obj);
 
-	purple_connection = purple_account_get_connection(connection->account);
+	account = purple_connection_get_account(PURPLE_CONNECTION(connection));
 
 	/* Make sure the username (which includes the servername via usersplits),
 	 * does not contain any whitespace.
 	 */
-	username = purple_account_get_username(connection->account);
+	username = purple_account_get_username(account);
 	if(strpbrk(username, " \t\v\r\n") != NULL) {
 		g_set_error(&connection->validate_error,
 		            PURPLE_CONNECTION_ERROR,
@@ -329,7 +291,8 @@
 
 	/* Split the username into nick and server and store the values. */
 	userparts = g_strsplit(username, "@", 2);
-	purple_connection_set_display_name(purple_connection, userparts[0]);
+	purple_connection_set_display_name(PURPLE_CONNECTION(connection),
+	                                   userparts[0]);
 	connection->server_name = g_strdup(userparts[1]);
 	g_strfreev(userparts);
 
@@ -356,19 +319,6 @@
 	obj_class->finalize = purple_ircv3_connection_finalize;
 
 	/**
-	 * PurpleIRCv3Connection:account:
-	 *
-	 * The [class@Purple.Account] that this connection is for.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_ACCOUNT] = g_param_spec_object(
-		"account", "account",
-		"The account for this connection",
-		PURPLE_TYPE_ACCOUNT,
-		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
-
-	/**
 	 * PurpleIRCv3Connection:cancellable:
 	 *
 	 * The [class@Gio.Cancellable] for this connection.
@@ -392,21 +342,6 @@
 	purple_ircv3_connection_register_type(G_TYPE_MODULE(plugin));
 }
 
-PurpleIRCv3Connection *
-purple_ircv3_connection_new(PurpleAccount *account) {
-	return g_object_new(
-		PURPLE_IRCV3_TYPE_CONNECTION,
-		"account", account,
-		NULL);
-}
-
-PurpleAccount *
-purple_ircv3_connection_get_account(PurpleIRCv3Connection *connection) {
-	g_return_val_if_fail(PURPLE_IRCV3_IS_CONNECTION(connection), NULL);
-
-	return connection->account;
-}
-
 GCancellable *
 purple_ircv3_connection_get_cancellable(PurpleIRCv3Connection *connection) {
 	g_return_val_if_fail(PURPLE_IRCV3_IS_CONNECTION(connection), NULL);
@@ -432,7 +367,7 @@
 
 void
 purple_ircv3_connection_connect(PurpleIRCv3Connection *connection) {
-	PurpleConnection *purple_connection = NULL;
+	PurpleAccount *account = NULL;
 	GError *error = NULL;
 	GSocketClient *client = NULL;
 	gint default_port = PURPLE_IRCV3_DEFAULT_TLS_PORT;
@@ -442,30 +377,29 @@
 	g_return_if_fail(PURPLE_IRCV3_IS_CONNECTION(connection));
 	g_return_if_fail(connection->connection == NULL);
 
-	purple_connection = purple_account_get_connection(connection->account);
-
-	client = purple_gio_socket_client_new(connection->account, &error);
+	account = purple_connection_get_account(PURPLE_CONNECTION(connection));
+	client = purple_gio_socket_client_new(account, &error);
 	if(!G_IS_SOCKET_CLIENT(client)) {
-		purple_connection_take_error(purple_connection, error);
+		purple_connection_take_error(PURPLE_CONNECTION(connection), error);
 
 		return;
 	}
 
 	/* Turn on TLS if requested. */
-	use_tls = purple_account_get_bool(connection->account, "use-tls", TRUE);
+	use_tls = purple_account_get_bool(account, "use-tls", TRUE);
 	g_socket_client_set_tls(client, use_tls);
 
 	/* If TLS is not being used, set the default port to the plain port. */
 	if(!use_tls) {
 		default_port = PURPLE_IRCV3_DEFAULT_PLAIN_PORT;
 	}
-	port = purple_account_get_int(connection->account, "port", default_port);
+	port = purple_account_get_int(account, "port", default_port);
 
 	/* Finally start the async connection. */
 	g_socket_client_connect_to_host_async(client, connection->server_name,
 	                                      port, connection->cancellable,
 	                                      purple_ircv3_connection_connected_cb,
-	                                      purple_connection);
+	                                      connection);
 
 	g_clear_object(&client);
 }
diff --git a/libpurple/protocols/ircv3/purpleircv3core.h b/libpurple/protocols/ircv3/purpleircv3core.h
--- a/libpurple/protocols/ircv3/purpleircv3core.h
+++ b/libpurple/protocols/ircv3/purpleircv3core.h
@@ -27,6 +27,4 @@
 
 #define PURPLE_IRCV3_DOMAIN (g_quark_from_static_string("ircv3-plugin"))
 
-#define PURPLE_IRCV3_CONNECTION_KEY "ircv3-connection"
-
 #endif /* PURPLE_IRCV3_CORE_H */
diff --git a/libpurple/protocols/ircv3/purpleircv3protocol.c b/libpurple/protocols/ircv3/purpleircv3protocol.c
--- a/libpurple/protocols/ircv3/purpleircv3protocol.c
+++ b/libpurple/protocols/ircv3/purpleircv3protocol.c
@@ -88,42 +88,33 @@
 purple_ircv3_protocol_login(PurpleProtocol *protocol, PurpleAccount *account,
                             const char *password)
 {
-	PurpleIRCv3Connection *connection = NULL;
-	PurpleConnection *purple_connection = NULL;
+	PurpleConnection *connection = NULL;
 	GError *error = NULL;
-
-	purple_connection = purple_connection_new(protocol, account, password);
+	gboolean valid = FALSE;
 
-	connection = purple_ircv3_connection_new(account);
-	if(!purple_ircv3_connection_valid(connection, &error)) {
-		purple_connection_take_error(purple_connection, error);
+	connection = g_object_new(
+		PURPLE_IRCV3_TYPE_CONNECTION,
+		"protocol", protocol,
+		"account", account,
+		"password", password);
 
-		return purple_connection;
+	valid = purple_ircv3_connection_valid(PURPLE_IRCV3_CONNECTION(connection),
+	                                      &error);
+	if(!valid) {
+		purple_connection_take_error(PURPLE_CONNECTION(connection), error);
+	} else {
+		purple_ircv3_connection_connect(connection);
 	}
 
-	g_object_set_data_full(G_OBJECT(purple_connection),
-	                       PURPLE_IRCV3_CONNECTION_KEY,
-	                       connection, g_object_unref);
 
-	purple_ircv3_connection_connect(connection);
-
-	return purple_connection;
+	return connection;
 }
 
 static void
 purple_ircv3_protocol_close(G_GNUC_UNUSED PurpleProtocol *protocol,
-                            PurpleConnection *purple_connection)
+                            PurpleConnection *connection)
 {
-	PurpleIRCv3Connection *connection = NULL;
-
-	connection = g_object_get_data(G_OBJECT(purple_connection),
-	                               PURPLE_IRCV3_CONNECTION_KEY);
-
-	purple_ircv3_connection_close(connection);
-
-	/* Set our connection data to NULL which will remove the last reference. */
-	g_object_set_data(G_OBJECT(purple_connection), PURPLE_IRCV3_CONNECTION_KEY,
-	                  NULL);
+	purple_ircv3_connection_close(PURPLE_IRCV3_CONNECTION(connection));
 }
 
 static GList *
