# HG changeset patch
# Node ID 4bce7a5cb78faa2f21bbe6f79135e7f8594dc86a
# Parent  72e0eaaf8d0df7dd5b29261f31ed2db658497814
diff --git a/xeme/tests/testinputstream.c b/xeme/tests/testinputstream.c
--- a/xeme/tests/testinputstream.c
+++ b/xeme/tests/testinputstream.c
@@ -85,8 +85,9 @@
 	const char *value = NULL;
 	guint counter = 0;
 
-	output_stream = xeme_output_stream_new("julient@im.example.com",
-	                                       "im.example.com", NULL);
+	output_stream = xeme_output_stream_new(NULL);
+	xeme_stream_set_to(XEME_STREAM(output_stream), "juliet@im.example.com");
+	xeme_stream_set_from(XEME_STREAM(output_stream), "im.example.com");
 
 	input_stream = xeme_input_stream_new();
 	g_signal_connect(input_stream, "closed",
diff --git a/xeme/tests/testoutputstream.c b/xeme/tests/testoutputstream.c
--- a/xeme/tests/testoutputstream.c
+++ b/xeme/tests/testoutputstream.c
@@ -66,10 +66,11 @@
 		"version=\"1.0\" xml:lang=\"en\" xmlns=\"jabber:client\" "
 		"xmlns:stream=\"http://etherx.jabber.org/streams\">";
 
-	stream = xeme_output_stream_new("im.example.com", "juliet@im.example.com",
-	                                NULL);
+	stream = xeme_output_stream_new(NULL);
+	xeme_stream_set_from(XEME_STREAM(stream), "juliet@im.example.com");
 	xeme_stream_set_id(XEME_STREAM(stream), "t7AMCin9zjMNwQKDnplntZPIDEI=");
 	xeme_stream_set_language(XEME_STREAM(stream), "en");
+	xeme_stream_set_to(XEME_STREAM(stream), "im.example.com");
 
 	output = g_memory_output_stream_new_resizable();
 
@@ -102,7 +103,9 @@
 	GError *error = NULL;
 	gboolean result = FALSE;
 
-	stream = xeme_output_stream_new("foo", "bar", NULL);
+	stream = xeme_output_stream_new(NULL);
+	xeme_stream_set_to(XEME_STREAM(stream), "foo");
+	xeme_stream_set_from(XEME_STREAM(stream), "bar");
 
 	result = xeme_output_stream_restart(stream, &error);
 	g_assert_error(error, XEME_DOMAIN, 0);
@@ -132,10 +135,11 @@
 		"version=\"1.0\" xml:lang=\"en\" xmlns=\"jabber:client\" "
 		"xmlns:stream=\"http://etherx.jabber.org/streams\">";
 
-	stream = xeme_output_stream_new("im.example.com", "juliet@im.example.com",
-	                                NULL);
+	stream = xeme_output_stream_new(NULL);
+	xeme_stream_set_from(XEME_STREAM(stream), "juliet@im.example.com");
 	xeme_stream_set_id(XEME_STREAM(stream), "t7AMCin9zjMNwQKDnplntZPIDEI=");
 	xeme_stream_set_language(XEME_STREAM(stream), "en");
+	xeme_stream_set_to(XEME_STREAM(stream), "im.example.com");
 
 	output = g_memory_output_stream_new_resizable();
 
diff --git a/xeme/xemeconnection.c b/xeme/xemeconnection.c
--- a/xeme/xemeconnection.c
+++ b/xeme/xemeconnection.c
@@ -91,8 +91,9 @@
 	iostream = G_IO_STREAM(connection->socket_connection);
 
 	ostream = g_io_stream_get_output_stream(iostream);
-	output = xeme_output_stream_new(connection->domain, connection->jid,
-	                                connection->cancellable);
+	output = xeme_output_stream_new(connection->cancellable);
+	xeme_stream_set_to(XEME_STREAM(output), connection->domain);
+	xeme_stream_set_from(XEME_STREAM(output), connection->jid);
 	if(!xeme_output_stream_start(output, ostream, &error)) {
 		g_task_return_error(task, error);
 
diff --git a/xeme/xemeoutputstream.c b/xeme/xemeoutputstream.c
--- a/xeme/xemeoutputstream.c
+++ b/xeme/xemeoutputstream.c
@@ -142,14 +142,10 @@
  * Public API
  *****************************************************************************/
 XemeOutputStream *
-xeme_output_stream_new(const char *to, const char *from,
-                       GCancellable *cancellable)
-{
+xeme_output_stream_new(GCancellable *cancellable) {
 	return g_object_new(
 		XEME_TYPE_OUTPUT_STREAM,
 		"cancellable", cancellable,
-		"from", from,
-		"to", to,
 		NULL);
 }
 
diff --git a/xeme/xemeoutputstream.h b/xeme/xemeoutputstream.h
--- a/xeme/xemeoutputstream.h
+++ b/xeme/xemeoutputstream.h
@@ -44,8 +44,6 @@
 
 /**
  * xeme_output_stream_new:
- * @to: The jid of the recipient.
- * @from: The jid of the sender.
  * @cancellable: (nullable): A [class@Gio.Cancellable] for the stream.
  *
  * Creates a new output stream.
@@ -55,7 +53,7 @@
  * Since: 0.1
  */
 XEME_AVAILABLE_IN_0_1
-XemeOutputStream *xeme_output_stream_new(const char *to, const char *from, GCancellable *cancellable);
+XemeOutputStream *xeme_output_stream_new(GCancellable *cancellable);
 
 /**
  * xeme_output_stream_start:
