diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2012-01-28 10:17:54 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2012-01-31 17:40:44 +0000 |
commit | bd3c28af3b96bf73256e8e0fc42470f0cf43039e (patch) | |
tree | c08f34b798dd970197a1a35452695db2a54415d7 | |
parent | 5d91fadfb646437363c9f1e60f1deb279b09e180 (diff) |
Replace trivial uses of lm_message_node_get_child_with_namespace
These are the cases where it was relatively quickly apparent to me that
we only needed a direct child, not a deeper descendent.
-rw-r--r-- | src/bytestream-factory.c | 35 | ||||
-rw-r--r-- | src/bytestream-ibb.c | 4 | ||||
-rw-r--r-- | src/bytestream-muc.c | 2 | ||||
-rw-r--r-- | src/bytestream-multiple.c | 2 | ||||
-rw-r--r-- | src/bytestream-socks5.c | 4 | ||||
-rw-r--r-- | src/conn-aliasing.c | 4 | ||||
-rw-r--r-- | src/ft-channel.c | 2 | ||||
-rw-r--r-- | src/ft-manager.c | 4 | ||||
-rw-r--r-- | src/muc-factory.c | 4 | ||||
-rw-r--r-- | src/presence-cache.c | 6 | ||||
-rw-r--r-- | src/private-tubes-factory.c | 2 | ||||
-rw-r--r-- | src/tube-dbus.c | 2 | ||||
-rw-r--r-- | src/tube-stream.c | 2 | ||||
-rw-r--r-- | src/tubes-channel.c | 14 |
14 files changed, 43 insertions, 44 deletions
diff --git a/src/bytestream-factory.c b/src/bytestream-factory.c index 5c75da33d..5e4347daa 100644 --- a/src/bytestream-factory.c +++ b/src/bytestream-factory.c @@ -323,7 +323,7 @@ socks5_proxy_query_reply_cb (GabbleConnection *conn, if (wocky_stanza_extract_errors (reply_msg, NULL, NULL, NULL, NULL)) goto fail; - query = lm_message_node_get_child_with_namespace ( + query = wocky_node_get_child_ns ( wocky_stanza_get_top_node (reply_msg), "query", NS_BYTESTREAMS); if (query == NULL) goto fail; @@ -887,7 +887,7 @@ streaminit_parse_request (WockyStanza *message, } /* Parse <feature> */ - feature = lm_message_node_get_child_with_namespace (si, "feature", + feature = wocky_node_get_child_ns (si, "feature", NS_FEATURENEG); if (feature == NULL) { @@ -895,7 +895,7 @@ streaminit_parse_request (WockyStanza *message, return FALSE; } - x = lm_message_node_get_child_with_namespace (feature, "x", NS_X_DATA); + x = wocky_node_get_child_ns (feature, "x", NS_X_DATA); if (x == NULL) { STANZA_DEBUG (message, "got a SI request without a X data field"); @@ -955,8 +955,7 @@ streaminit_parse_request (WockyStanza *message, return FALSE; } - si_multiple = lm_message_node_get_child_with_namespace (si, "si-multiple", - NS_SI_MULTIPLE); + si_multiple = wocky_node_get_child_ns (si, "si-multiple", NS_SI_MULTIPLE); if (si_multiple == NULL) *multiple = FALSE; else @@ -1060,14 +1059,14 @@ si_tube_received (GabbleBytestreamFactory *self, * - a 1-1 tube extra bytestream offer * - a muc tube extra bytestream offer */ - if (lm_message_node_get_child_with_namespace (si, "tube", NS_TUBES) != NULL) + if (wocky_node_get_child_ns (si, "tube", NS_TUBES) != NULL) { /* The SI request is a tube offer */ gabble_private_tubes_factory_handle_si_tube_request ( priv->conn->private_tubes_factory, bytestream, peer_handle, stream_id, msg); } - else if (lm_message_node_get_child_with_namespace (si, "stream", NS_TUBES) + else if (wocky_node_get_child_ns (si, "stream", NS_TUBES) != NULL) { /* The SI request is an extra bytestream for a 1-1 tube */ @@ -1075,7 +1074,7 @@ si_tube_received (GabbleBytestreamFactory *self, priv->conn->private_tubes_factory, bytestream, peer_handle, stream_id, msg); } - else if (lm_message_node_get_child_with_namespace (si, "muc-stream", + else if (wocky_node_get_child_ns (si, "muc-stream", NS_TUBES) != NULL) { /* The SI request is an extra bytestream for a muc tube */ @@ -1135,7 +1134,7 @@ bytestream_factory_iq_si_cb ( gchar *peer_resource = NULL; gchar *self_jid = NULL; - si = lm_message_node_get_child_with_namespace ( + si = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "si", NS_SI); g_return_val_if_fail (si != NULL, FALSE); @@ -1323,7 +1322,7 @@ handle_ibb_open_iq (GabbleBytestreamFactory *self, if (sub_type != WOCKY_STANZA_SUB_TYPE_SET) return FALSE; - open_node = lm_message_node_get_child_with_namespace ( + open_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "open", NS_IBB); if (open_node == NULL) return FALSE; @@ -1401,7 +1400,7 @@ handle_ibb_close_iq (GabbleBytestreamFactory *self, if (sub_type != WOCKY_STANZA_SUB_TYPE_SET) return FALSE; - close_node = lm_message_node_get_child_with_namespace ( + close_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "close", NS_IBB); if (close_node == NULL) return FALSE; @@ -1463,7 +1462,7 @@ handle_ibb_data (GabbleBytestreamFactory *self, if (is_iq && sub_type != WOCKY_STANZA_SUB_TYPE_SET) return FALSE; - data = lm_message_node_get_child_with_namespace ( + data = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "data", NS_IBB); if (data == NULL) return FALSE; @@ -1520,7 +1519,7 @@ handle_muc_data (GabbleBytestreamFactory *self, priv = GABBLE_BYTESTREAM_FACTORY_GET_PRIVATE (self); - data = lm_message_node_get_child_with_namespace ( + data = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "data", NS_MUC_BYTESTREAM); if (data == NULL) return FALSE; @@ -1622,7 +1621,7 @@ handle_socks5_query_iq ( const gchar *tmp; WockyNodeIter i; - query_node = lm_message_node_get_child_with_namespace ( + query_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "query", NS_BYTESTREAMS); g_return_val_if_fail (query_node != NULL, FALSE); @@ -1902,7 +1901,7 @@ streaminit_get_multiple_bytestream (GabbleBytestreamFactory *self, WockyNode *value; WockyNodeIter i; - si_multi = lm_message_node_get_child_with_namespace (si, "si-multiple", + si_multi = wocky_node_get_child_ns (si, "si-multiple", NS_SI_MULTIPLE); if (si_multi == NULL) return NULL; @@ -1942,7 +1941,7 @@ streaminit_get_bytestream (GabbleBytestreamFactory *self, const gchar *stream_method; WockyNodeIter i; - feature = lm_message_node_get_child_with_namespace (si, "feature", + feature = wocky_node_get_child_ns (si, "feature", NS_FEATURENEG); if (feature == NULL) { @@ -1950,7 +1949,7 @@ streaminit_get_bytestream (GabbleBytestreamFactory *self, return NULL; } - x = lm_message_node_get_child_with_namespace (feature, "x", NS_X_DATA); + x = wocky_node_get_child_ns (feature, "x", NS_X_DATA); if (x == NULL) { STANZA_DEBUG (reply_msg, "got a SI reply without a x field"); @@ -2100,7 +2099,7 @@ streaminit_reply_cb (GabbleConnection *conn, g_object_get (muc, "self-jid", &self_jid, NULL); } - si = lm_message_node_get_child_with_namespace ( + si = wocky_node_get_child_ns ( wocky_stanza_get_top_node (reply_msg), "si", NS_SI); if (si == NULL) { diff --git a/src/bytestream-ibb.c b/src/bytestream-ibb.c index f99d1439b..e4d66fceb 100644 --- a/src/bytestream-ibb.c +++ b/src/bytestream-ibb.c @@ -617,7 +617,7 @@ gabble_bytestream_ibb_receive (GabbleBytestreamIBB *self, /* caller must have checked for this in order to know which bytestream to * route this packet to */ - data = lm_message_node_get_child_with_namespace ( + data = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "data", NS_IBB); g_assert (data != NULL); @@ -722,7 +722,7 @@ gabble_bytestream_ibb_accept (GabbleBytestreamIface *iface, msg = gabble_bytestream_factory_make_accept_iq (priv->peer_jid, priv->stream_init_id, NS_IBB); - si = lm_message_node_get_child_with_namespace ( + si = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "si", NS_SI); g_assert (si != NULL); diff --git a/src/bytestream-muc.c b/src/bytestream-muc.c index f0c05cc31..4a803bc58 100644 --- a/src/bytestream-muc.c +++ b/src/bytestream-muc.c @@ -419,7 +419,7 @@ gabble_bytestream_muc_receive (GabbleBytestreamMuc *self, /* caller must have checked for this in order to know which bytestream to * route this packet to */ - data = lm_message_node_get_child_with_namespace ( + data = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "data", NS_MUC_BYTESTREAM); g_assert (data != NULL); diff --git a/src/bytestream-multiple.c b/src/bytestream-multiple.c index dbaa9ee4b..07243e1f1 100644 --- a/src/bytestream-multiple.c +++ b/src/bytestream-multiple.c @@ -412,7 +412,7 @@ gabble_bytestream_multiple_accept (GabbleBytestreamIface *iface, g_free (current_method); g_list_free (all_methods); - si = lm_message_node_get_child_with_namespace ( + si = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "si", NS_SI); g_assert (si != NULL); diff --git a/src/bytestream-socks5.c b/src/bytestream-socks5.c index 0a1fe0230..12bd7c509 100644 --- a/src/bytestream-socks5.c +++ b/src/bytestream-socks5.c @@ -1409,7 +1409,7 @@ gabble_bytestream_socks5_accept (GabbleBytestreamIface *iface, msg = gabble_bytestream_factory_make_accept_iq (priv->peer_jid, priv->stream_init_id, NS_BYTESTREAMS); - si = lm_message_node_get_child_with_namespace ( + si = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "si", NS_SI); g_assert (si != NULL); @@ -1558,7 +1558,7 @@ socks5_init_reply_cb (GabbleConnection *conn, WockyNode *query, *streamhost = NULL; const gchar *jid; - query = lm_message_node_get_child_with_namespace ( + query = wocky_node_get_child_ns ( wocky_stanza_get_top_node (reply_msg), "query", NS_BYTESTREAMS); if (query != NULL) diff --git a/src/conn-aliasing.c b/src/conn-aliasing.c index bdc1d5d7a..962869a35 100644 --- a/src/conn-aliasing.c +++ b/src/conn-aliasing.c @@ -741,11 +741,11 @@ gabble_conn_aliasing_pep_nick_reply_handler (GabbleConnection *conn, gboolean found = FALSE; WockyNodeIter i; - pubsub_node = lm_message_node_get_child_with_namespace ( + pubsub_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "pubsub", NS_PUBSUB); if (pubsub_node == NULL) { - pubsub_node = lm_message_node_get_child_with_namespace ( + pubsub_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "pubsub", NS_PUBSUB "#event"); if (pubsub_node == NULL) diff --git a/src/ft-channel.c b/src/ft-channel.c index b39c2b9e7..565a6ff53 100644 --- a/src/ft-channel.c +++ b/src/ft-channel.c @@ -1463,7 +1463,7 @@ offer_bytestream (GabbleFileTransferChannel *self, const gchar *jid, msg = gabble_bytestream_factory_make_stream_init_iq (full_jid, stream_id, NS_FILE_TRANSFER); - si_node = lm_message_node_get_child_with_namespace ( + si_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "si", NS_SI); g_assert (si_node != NULL); diff --git a/src/ft-manager.c b/src/ft-manager.c index 19e684a86..314ed0936 100644 --- a/src/ft-manager.c +++ b/src/ft-manager.c @@ -680,7 +680,7 @@ hyvaa_vappua ( return NULL; \ } - WockyNode *file_node = lm_message_node_get_child_with_namespace (si_node, + WockyNode *file_node = wocky_node_get_child_ns (si_node, "file", NS_FILE_TRANSFER); die_if_null (file_node, "Invalid file transfer SI request: no <file>") @@ -816,7 +816,7 @@ void gabble_ft_manager_handle_si_request (GabbleFtManager *self, gboolean resume_supported; GError *error = NULL; - si_node = lm_message_node_get_child_with_namespace ( + si_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "si", NS_SI); g_assert (si_node != NULL); diff --git a/src/muc-factory.c b/src/muc-factory.c index 3cbec3224..ddef7d825 100644 --- a/src/muc-factory.c +++ b/src/muc-factory.c @@ -632,7 +632,7 @@ process_muc_invite (GabbleMucFactory *fac, gchar *room; /* does it have a muc subnode? */ - x_node = lm_message_node_get_child_with_namespace ( + x_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (message), "x", NS_MUC_USER); @@ -707,7 +707,7 @@ process_obsolete_invite (GabbleMucFactory *fac, struct DiscoInviteData *disco_udata; /* check for obsolete invite method */ - x_node = lm_message_node_get_child_with_namespace ( + x_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (message), "x", NS_X_CONFERENCE); if (x_node == NULL) return FALSE; diff --git a/src/presence-cache.c b/src/presence-cache.c index 54168cc90..bb5ea3b05 100644 --- a/src/presence-cache.c +++ b/src/presence-cache.c @@ -909,7 +909,7 @@ _grab_avatar_sha1 (GabblePresenceCache *cache, if (NULL == presence) return; - x_node = lm_message_node_get_child_with_namespace (node, "x", + x_node = wocky_node_get_child_ns (node, "x", NS_VCARD_TEMP_UPDATE); if (NULL == x_node) @@ -977,7 +977,7 @@ _parse_cap_bundles ( *hash = NULL; *ver = NULL; - cap_node = lm_message_node_get_child_with_namespace (lm_node, "c", NS_CAPS); + cap_node = wocky_node_get_child_ns (lm_node, "c", NS_CAPS); if (NULL == cap_node) return NULL; @@ -1025,7 +1025,7 @@ _parse_node (GabblePresence *presence, WockyNode *cap_node; const gchar *node; - cap_node = lm_message_node_get_child_with_namespace (lm_node, "c", NS_CAPS); + cap_node = wocky_node_get_child_ns (lm_node, "c", NS_CAPS); if (NULL == cap_node) return; diff --git a/src/private-tubes-factory.c b/src/private-tubes-factory.c index f4f183460..5b366a46b 100644 --- a/src/private-tubes-factory.c +++ b/src/private-tubes-factory.c @@ -754,7 +754,7 @@ private_tubes_factory_msg_tube_cb ( tube_node = lm_message_node_get_child_with_namespace ( wocky_stanza_get_top_node (msg), "tube", NS_TUBES); - close_node = lm_message_node_get_child_with_namespace ( + close_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "close", NS_TUBES); if (tube_node == NULL && close_node == NULL) diff --git a/src/tube-dbus.c b/src/tube-dbus.c index 601756a21..8cab0ddbd 100644 --- a/src/tube-dbus.c +++ b/src/tube-dbus.c @@ -1265,7 +1265,7 @@ gabble_tube_dbus_offer (GabbleTubeDBus *tube, full_jid = g_strdup_printf ("%s/%s", jid, resource); msg = gabble_bytestream_factory_make_stream_init_iq (full_jid, priv->stream_id, NS_TUBES); - si_node = lm_message_node_get_child_with_namespace ( + si_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "si", NS_SI); g_assert (si_node != NULL); diff --git a/src/tube-stream.c b/src/tube-stream.c index ab9f5c55c..e147fdc92 100644 --- a/src/tube-stream.c +++ b/src/tube-stream.c @@ -524,7 +524,7 @@ start_stream_initiation (GabbleTubeStream *self, msg = gabble_bytestream_factory_make_stream_init_iq (full_jid, stream_id, NS_TUBES); - si_node = lm_message_node_get_child_with_namespace ( + si_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "si", NS_SI); g_assert (si_node != NULL); diff --git a/src/tubes-channel.c b/src/tubes-channel.c index 6fc01ccf7..2d3525540 100644 --- a/src/tubes-channel.c +++ b/src/tubes-channel.c @@ -1178,12 +1178,12 @@ gabble_tubes_channel_tube_si_offered (GabbleTubesChannel *self, wocky_stanza_get_type_info (msg, &stanza_type, &sub_type); g_return_if_fail (stanza_type == WOCKY_STANZA_TYPE_IQ); g_return_if_fail (sub_type == WOCKY_STANZA_SUB_TYPE_SET); - si_node = lm_message_node_get_child_with_namespace ( + si_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "si", NS_SI); g_return_if_fail (si_node != NULL); stream_id = wocky_node_get_attribute (si_node, "id"); g_return_if_fail (stream_id != NULL); - tube_node = lm_message_node_get_child_with_namespace (si_node, "tube", + tube_node = wocky_node_get_child_ns (si_node, "tube", NS_TUBES); g_return_if_fail (tube_node != NULL); @@ -1268,15 +1268,15 @@ gabble_tubes_channel_bytestream_offered (GabbleTubesChannel *self, g_return_if_fail (stanza_type == WOCKY_STANZA_TYPE_IQ); g_return_if_fail (sub_type == WOCKY_STANZA_SUB_TYPE_SET); - si_node = lm_message_node_get_child_with_namespace ( + si_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "si", NS_SI); g_return_if_fail (si_node != NULL); if (priv->handle_type == TP_HANDLE_TYPE_CONTACT) - stream_node = lm_message_node_get_child_with_namespace (si_node, + stream_node = wocky_node_get_child_ns (si_node, "stream", NS_TUBES); else - stream_node = lm_message_node_get_child_with_namespace (si_node, + stream_node = wocky_node_get_child_ns (si_node, "muc-stream", NS_TUBES); g_return_if_fail (stream_node != NULL); @@ -1426,7 +1426,7 @@ tube_msg_close (GabbleTubesChannel *self, GabbleTubeIface *tube; TpTubeType type; - close_node = lm_message_node_get_child_with_namespace ( + close_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "close", NS_TUBES); g_assert (close_node != NULL); @@ -1476,7 +1476,7 @@ gabble_tubes_channel_tube_msg (GabbleTubesChannel *self, return; } - node = lm_message_node_get_child_with_namespace ( + node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (msg), "close", NS_TUBES); if (node != NULL) { |