telepathy-gabble: bytestream_factory_negotiate_stream(): remove return value
Will Thompson
wjt at kemper.freedesktop.org
Thu Dec 6 07:01:27 PST 2012
Module: telepathy-gabble
Branch: master
Commit: 6f95a1e49fb7e59eeeb3d4581e678a6c3141868d
URL: http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=6f95a1e49fb7e59eeeb3d4581e678a6c3141868d
Author: Will Thompson <will.thompson at collabora.co.uk>
Date: Thu Mar 29 13:41:25 2012 +0100
bytestream_factory_negotiate_stream(): remove return value
It's always TRUE, so it's unneeded.
---
src/bytestream-factory.c | 8 ++------
src/bytestream-factory.h | 4 ++--
src/ft-channel.c | 14 ++++++--------
src/tube-dbus.c | 10 ++--------
src/tube-stream.c | 12 +++---------
5 files changed, 15 insertions(+), 33 deletions(-)
diff --git a/src/bytestream-factory.c b/src/bytestream-factory.c
index 8762011..3925a15 100644
--- a/src/bytestream-factory.c
+++ b/src/bytestream-factory.c
@@ -2149,18 +2149,16 @@ END:
* @user_data: user data to pass to the callback
* @object: the handler will follow the lifetime of this object,
* which means that if the object is destroyed the callback will not be invoked.
- * @error: pointer in which to return a GError in case of failure.
*
* Send a Stream Initiation (XEP-0095) request.
*/
-gboolean
+void
gabble_bytestream_factory_negotiate_stream (GabbleBytestreamFactory *self,
WockyStanza *msg,
const gchar *stream_id,
GabbleBytestreamFactoryNegotiateReplyFunc func,
gpointer user_data,
- GObject *object,
- GError **error)
+ GObject *object)
{
GabbleBytestreamFactoryPrivate *priv;
struct _streaminit_reply_cb_data *data;
@@ -2180,8 +2178,6 @@ gabble_bytestream_factory_negotiate_stream (GabbleBytestreamFactory *self,
conn_util_send_iq_async (priv->conn, msg, NULL,
streaminit_reply_cb, data);
-
- return TRUE;
}
/*
diff --git a/src/bytestream-factory.h b/src/bytestream-factory.h
index 733f1b8..45cee00 100644
--- a/src/bytestream-factory.h
+++ b/src/bytestream-factory.h
@@ -97,10 +97,10 @@ WockyStanza *gabble_bytestream_factory_make_multi_accept_iq (
const gchar *full_jid, const gchar *stream_init_id,
GList *stream_methods);
-gboolean gabble_bytestream_factory_negotiate_stream (
+void gabble_bytestream_factory_negotiate_stream (
GabbleBytestreamFactory *fac, WockyStanza *msg, const gchar *stream_id,
GabbleBytestreamFactoryNegotiateReplyFunc func,
- gpointer user_data, GObject *object, GError **error);
+ gpointer user_data, GObject *object);
gchar *gabble_bytestream_factory_generate_stream_id (void);
diff --git a/src/ft-channel.c b/src/ft-channel.c
index 1daab0e..df57295 100644
--- a/src/ft-channel.c
+++ b/src/ft-channel.c
@@ -1204,13 +1204,12 @@ add_metadata_forms (GabbleFileTransferChannel *self,
}
}
-static gboolean
+static void
offer_bytestream (GabbleFileTransferChannel *self, const gchar *jid,
- const gchar *resource, GError **error)
+ const gchar *resource)
{
GabbleConnection *conn = GABBLE_CONNECTION (tp_base_channel_get_connection (
TP_BASE_CHANNEL (self)));
- gboolean result;
WockyStanza *msg;
WockyNode *si_node, *file_node;
gchar *stream_id, *size_str, *full_jid;
@@ -1273,16 +1272,14 @@ offer_bytestream (GabbleFileTransferChannel *self, const gchar *jid,
/* we support resume */
wocky_node_add_child (file_node, "range");
- result = gabble_bytestream_factory_negotiate_stream (
+ gabble_bytestream_factory_negotiate_stream (
conn->bytestream_factory, msg, stream_id,
- bytestream_negotiate_cb, self, G_OBJECT (self), error);
+ bytestream_negotiate_cb, self, G_OBJECT (self));
g_object_unref (msg);
g_free (stream_id);
g_free (size_str);
g_free (full_jid);
-
- return result;
}
#ifdef ENABLE_JINGLE_FILE_TRANSFER
@@ -1481,7 +1478,8 @@ gabble_file_transfer_channel_offer_file (GabbleFileTransferChannel *self,
if (use_si)
{
- result = offer_bytestream (self, jid, si_resource, error);
+ offer_bytestream (self, jid, si_resource);
+ result = TRUE;
}
#ifdef ENABLE_JINGLE_FILE_TRANSFER
else if (jingle_share)
diff --git a/src/tube-dbus.c b/src/tube-dbus.c
index 6e44623..f852c3a 100644
--- a/src/tube-dbus.c
+++ b/src/tube-dbus.c
@@ -1049,7 +1049,6 @@ gabble_tube_dbus_offer (GabbleTubeDBus *tube,
GabblePresence *presence;
WockyNode *tube_node, *si_node;
WockyStanza *msg;
- gboolean result;
jid = tp_handle_inspect (contact_repo,
tp_base_channel_get_target_handle (base));
@@ -1087,22 +1086,17 @@ gabble_tube_dbus_offer (GabbleTubeDBus *tube,
base_conn, tube_node);
tube->priv->offered = TRUE;
- result = gabble_bytestream_factory_negotiate_stream (
+ gabble_bytestream_factory_negotiate_stream (
conn->bytestream_factory, msg, priv->stream_id,
- bytestream_negotiate_cb, tube, G_OBJECT (tube), error);
+ bytestream_negotiate_cb, tube, G_OBJECT (tube));
/* We don't create the bytestream of private D-Bus tube yet.
* It will be when we'll receive the answer of the SI request */
-
g_object_unref (msg);
g_free (full_jid);
- if (!result)
- return FALSE;
-
tp_svc_channel_interface_tube_emit_tube_channel_state_changed (tube,
TP_TUBE_CHANNEL_STATE_REMOTE_PENDING);
-
}
else
{
diff --git a/src/tube-stream.c b/src/tube-stream.c
index fa4434e..e5cc0f9 100644
--- a/src/tube-stream.c
+++ b/src/tube-stream.c
@@ -457,7 +457,6 @@ start_stream_initiation (GabbleTubeStream *self,
TpHandleRepoIface *contact_repo;
const gchar *jid;
gchar *full_jid, *stream_id, *id_str;
- gboolean result;
contact_repo = tp_base_connection_get_handles (
base_conn, TP_HANDLE_TYPE_CONTACT);
@@ -520,23 +519,18 @@ start_stream_initiation (GabbleTubeStream *self,
wocky_node_set_attribute (node, "tube", id_str);
- result = gabble_bytestream_factory_negotiate_stream (
+ gabble_bytestream_factory_negotiate_stream (
conn->bytestream_factory, msg, stream_id,
- extra_bytestream_negotiate_cb, g_object_ref (transport), G_OBJECT (self),
- error);
+ extra_bytestream_negotiate_cb, g_object_ref (transport), G_OBJECT (self));
/* FIXME: data and one ref on data->transport are leaked if the tube is
* closed before we got the SI reply. */
-
- if (!result)
- g_object_unref (transport);
-
g_object_unref (msg);
g_free (stream_id);
g_free (full_jid);
g_free (id_str);
- return result;
+ return TRUE;
}
static guint
More information about the telepathy-commits
mailing list