diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2012-03-23 18:49:39 -0400 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2012-05-18 09:09:46 +0100 |
commit | b2cc4810f56ae031a43638897bde53ec4c227786 (patch) | |
tree | c16fe30d76d5f9a00d82d09604c4663824b66943 | |
parent | c5cbc071e6fa558a599ef57545bce5deb56f6789 (diff) |
private-tubes-factory: make extract_tube_information public
This should probably go in a tubes-util file or something...
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | src/private-tubes-factory.c | 19 | ||||
-rw-r--r-- | src/private-tubes-factory.h | 6 |
2 files changed, 15 insertions, 10 deletions
diff --git a/src/private-tubes-factory.c b/src/private-tubes-factory.c index c325d0cd2..940e1adb8 100644 --- a/src/private-tubes-factory.c +++ b/src/private-tubes-factory.c @@ -107,8 +107,9 @@ static const gchar * const old_tubes_channel_allowed_properties[] = { NULL }; -static gboolean -extract_tube_information (GabblePrivateTubesFactory *self, +gboolean +gabble_private_tubes_factory_extract_tube_information ( + TpHandleRepoIface *contact_repo, WockyNode *tube_node, TpTubeType *type, TpHandle *initiator_handle, @@ -116,10 +117,6 @@ extract_tube_information (GabblePrivateTubesFactory *self, GHashTable **parameters, guint *tube_id) { - GabblePrivateTubesFactoryPrivate *priv = self->priv; - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT); - if (type != NULL) { const gchar *_type; @@ -712,8 +709,9 @@ gabble_private_tubes_factory_handle_si_tube_request ( NS_TUBES); g_return_if_fail (tube_node != NULL); - if (!extract_tube_information (self, tube_node, NULL, NULL, - NULL, NULL, &tube_id)) + if (!gabble_private_tubes_factory_extract_tube_information ( + contact_repo, tube_node, NULL, NULL, + NULL, NULL, &tube_id)) { GError e = { WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "<tube> has no id attribute" }; @@ -1156,8 +1154,9 @@ new_channel_from_stanza (GabblePrivateTubesFactory *self, const gchar *service; GHashTable *parameters; - if (!extract_tube_information (self, tube_node, &type, NULL, - &service, ¶meters, NULL)) + if (!gabble_private_tubes_factory_extract_tube_information ( + contact_repo, tube_node, &type, NULL, + &service, ¶meters, NULL)) { DEBUG ("can't extract <tube> information from message"); send_tube_close_msg (self, wocky_stanza_get_from (stanza), tube_id); diff --git a/src/private-tubes-factory.h b/src/private-tubes-factory.h index d9895199d..410b59f7f 100644 --- a/src/private-tubes-factory.h +++ b/src/private-tubes-factory.h @@ -75,6 +75,12 @@ void gabble_private_tubes_factory_handle_si_stream_request ( GabblePrivateTubesFactory *fac, GabbleBytestreamIface *bytestream, TpHandle handle, const gchar *stream_id, WockyStanza *msg); +gboolean gabble_private_tubes_factory_extract_tube_information ( + TpHandleRepoIface *contact_repo, WockyNode *tube_node, + TpTubeType *type, TpHandle *initiator_handle, + const gchar **service, GHashTable **parameters, + guint *tube_id); + G_END_DECLS #endif /* #ifndef __PRIVATE_TUBES_FACTORY_H__ */ |