# HG changeset patch
# Node ID 6535c5a332de
# Parent  a8a644e3e561
diff --git a/libpurple/protocols/ircv3/meson.build b/libpurple/protocols/ircv3/meson.build
--- a/libpurple/protocols/ircv3/meson.build
+++ b/libpurple/protocols/ircv3/meson.build
@@ -64,14 +64,14 @@
 ircv3_prpl = shared_library('ircv3', IRCV3_SOURCES + IRCV3_HEADERS + [ircv3_h],
 	c_args : ['-DPURPLE_IRCV3_COMPILATION', '-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-IRCv3"'],
 	gnu_symbol_visibility : 'hidden',
-	dependencies : [libpurple_dep, glib, gio, hasl],
+	dependencies : [libpurple_dep, birb, glib, gio, hasl],
 	install : true,
 	install_dir : PURPLE_PLUGINDIR)
 
 ircv3_dep = declare_dependency(
 	sources : [IRCV3_SOURCES, IRCV3_HEADERS],
 	include_directories : ircv3_includes,
-	dependencies : [libpurple_dep, glib, gio, hasl])
+	dependencies : [libpurple_dep, birb, glib, gio, hasl])
 
 pkgconfig.generate(
 	# we purposely don't put the library here because you should not be
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
@@ -18,6 +18,8 @@
 
 #include <glib/gi18n-lib.h>
 
+#include <birb.h>
+
 #include "purpleircv3connection.h"
 
 #include "purpleircv3constants.h"
@@ -49,7 +51,7 @@
 	gboolean registered;
 
 	GDataInputStream *input;
-	PurpleQueuedOutputStream *output;
+	GOutputStream *output;
 
 	PurpleIRCv3Parser *parser;
 
@@ -208,15 +210,15 @@
                                  gpointer data)
 {
 	PurpleIRCv3Connection *connection = data;
-	PurpleQueuedOutputStream *stream = PURPLE_QUEUED_OUTPUT_STREAM(source);
+	BirbQueuedOutputStream *stream = BIRB_QUEUED_OUTPUT_STREAM(source);
 	GError *error = NULL;
 	gboolean success = FALSE;
 
-	success = purple_queued_output_stream_push_bytes_finish(stream, result,
-	                                                        &error);
+	success = birb_queued_output_stream_push_bytes_finish(stream, result,
+	                                                      &error);
 
 	if(!success) {
-		purple_queued_output_stream_clear_queue(stream);
+		birb_queued_output_stream_clear_queue(stream);
 
 		g_prefix_error(&error, "%s", _("Lost connection with server: "));
 
@@ -261,7 +263,7 @@
 	purple_ircv3_parser_add_default_handlers(priv->parser);
 
 	ostream = g_io_stream_get_output_stream(G_IO_STREAM(conn));
-	priv->output = purple_queued_output_stream_new(ostream);
+	priv->output = birb_queued_output_stream_new(ostream);
 
 	istream = g_io_stream_get_input_stream(G_IO_STREAM(conn));
 	priv->input = g_data_input_stream_new(istream);
@@ -807,11 +809,12 @@
 	bytes = g_string_free_to_bytes(msg);
 
 	cancellable = purple_connection_get_cancellable(PURPLE_CONNECTION(connection));
-	purple_queued_output_stream_push_bytes_async(priv->output, bytes,
-	                                             G_PRIORITY_DEFAULT,
-	                                             cancellable,
-	                                             purple_ircv3_connection_write_cb,
-	                                             connection);
+	birb_queued_output_stream_push_bytes_async(BIRB_QUEUED_OUTPUT_STREAM(priv->output),
+	                                           bytes,
+	                                           G_PRIORITY_DEFAULT,
+	                                           cancellable,
+	                                           purple_ircv3_connection_write_cb,
+	                                           connection);
 
 	g_bytes_unref(bytes);
 }
diff --git a/libpurple/protocols/ircv3/tests/meson.build b/libpurple/protocols/ircv3/tests/meson.build
--- a/libpurple/protocols/ircv3/tests/meson.build
+++ b/libpurple/protocols/ircv3/tests/meson.build
@@ -7,7 +7,7 @@
 foreach prog : TESTS
 	e = executable(
 		f'test_ircv3_@prog@', f'test_ircv3_@prog@.c',
-		dependencies : [libpurple_dep, glib, hasl],
+		dependencies : [libpurple_dep, birb, glib, hasl],
 		objects : ircv3_prpl.extract_all_objects(),
 		c_args : ['-DPURPLE_IRCV3_COMPILATION'])
 
diff --git a/meson.build b/meson.build
--- a/meson.build
+++ b/meson.build
@@ -251,6 +251,11 @@
 gstreamer_app = dependency('gstreamer-app-1.0')
 
 #######################################################################
+# Check for birb glib utility library
+#######################################################################
+birb = dependency('birb')
+
+#######################################################################
 # Check for Native Avahi headers (for Bonjour)
 #######################################################################
 
diff --git a/subprojects/birb.wrap b/subprojects/birb.wrap
new file mode 100644
--- /dev/null
+++ b/subprojects/birb.wrap
@@ -0,0 +1,4 @@
+[wrap-hg]
+directory = birb
+url = https://keep.imfreedom.org/birb/birb/
+revision = d9d91dc0265d
