telepathy-gabble: private-tubes-factory: make extract_tube_information public
Jonny Lamb
jonny at kemper.freedesktop.org
Tue Aug 28 06:19:31 PDT 2012
Module: telepathy-gabble
Branch: master
Commit: 95ea89f326c9d2b34eda734a77344664e6f56bf0
URL: http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=95ea89f326c9d2b34eda734a77344664e6f56bf0
Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date: Fri Mar 23 18:49:39 2012 -0400
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 at collabora.co.uk>
---
src/private-tubes-factory.c | 19 +++++++++----------
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 c325d0c..940e1ad 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 d989519..410b59f 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__ */
More information about the telepathy-commits
mailing list