summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-12-06 12:30:46 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-12-06 12:30:46 +0000
commitd5b1bc6cc7d76aa32bd441703c2da72213fa33ea (patch)
treecd7c80d5c6648eb3379772733d522e7bf8055958 /src
parentde8905b5bb098c6f0468e9a2856006d1583ad80c (diff)
parent6bc2931e859d9c23b8d81fede23c0a962514dfae (diff)
Merge branch '57615-misc-cleanup'
Diffstat (limited to 'src')
-rw-r--r--src/conn-olpc.c5
-rw-r--r--src/connection.c8
-rw-r--r--src/ft-channel.c10
-rw-r--r--src/jingle-content.c20
-rw-r--r--src/jingle-media-rtp.c17
-rw-r--r--src/jingle-session.c46
-rw-r--r--src/jingle-share.c17
-rw-r--r--src/jingle-transport-google.c2
-rw-r--r--src/jingle-transport-iceudp.c2
-rw-r--r--src/jingle-transport-rawudp.c2
-rw-r--r--src/message-util.c17
-rw-r--r--src/muc-channel.c2
-rw-r--r--src/search-channel.c10
-rw-r--r--src/tube-dbus.c8
-rw-r--r--src/tube-stream.c10
-rw-r--r--src/util.c15
16 files changed, 79 insertions, 112 deletions
diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index b6483aa06..46fef4b0d 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -96,13 +96,12 @@ activity_info_contribute_properties (GabbleOlpcActivity *activity,
if (only_public && !gabble_olpc_activity_is_visible (activity))
return FALSE;
- props_node = wocky_node_add_child_with_content (parent,
- "properties", "");
+ props_node = wocky_node_add_child_ns (parent,
+ "properties", NS_OLPC_ACTIVITY_PROPS);
wocky_node_set_attributes (props_node,
"room", gabble_olpc_activity_get_room (activity),
"activity", activity->id,
NULL);
- props_node->ns = g_quark_from_string (NS_OLPC_ACTIVITY_PROPS);
lm_message_node_add_children_from_properties (props_node,
activity->properties, "property");
diff --git a/src/connection.c b/src/connection.c
index 0a72e78dd..db64bd278 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -2389,14 +2389,13 @@ gabble_connection_fill_in_caps (GabbleConnection *self,
/* XEP-0115 version 1.5 uses a verification string in the 'ver' attribute */
caps_hash = caps_hash_compute_from_self_presence (self);
- node = wocky_node_add_child_with_content (node, "c", NULL);
+ node = wocky_node_add_child_ns (node, "c", NS_CAPS);
wocky_node_set_attributes (
node,
"hash", "sha-1",
"node", NS_GABBLE_CAPS,
"ver", caps_hash,
NULL);
- node->ns = g_quark_from_string (NS_CAPS);
/* Ensure this set of capabilities is in the cache. */
gabble_presence_cache_add_own_caps (self->presence_cache, caps_hash,
@@ -2478,9 +2477,8 @@ gabble_connection_request_decloak (GabbleConnection *self,
gabble_connection_fill_in_caps (self, message);
- decloak = wocky_node_add_child_with_content (wocky_stanza_get_top_node (message),
- "temppres", NULL);
- decloak->ns = g_quark_from_string (NS_TEMPPRES);
+ decloak = wocky_node_add_child_ns (wocky_stanza_get_top_node (message),
+ "temppres", NS_TEMPPRES);
if (reason != NULL && *reason != '\0')
{
diff --git a/src/ft-channel.c b/src/ft-channel.c
index 6b545437a..1daab0e3a 100644
--- a/src/ft-channel.c
+++ b/src/ft-channel.c
@@ -1238,8 +1238,7 @@ offer_bytestream (GabbleFileTransferChannel *self, const gchar *jid,
size_str = g_strdup_printf ("%" G_GUINT64_FORMAT, self->priv->size);
- file_node = wocky_node_add_child_with_content (si_node, "file", NULL);
- file_node->ns = g_quark_from_string (NS_FILE_TRANSFER);
+ file_node = wocky_node_add_child_ns (si_node, "file", NS_FILE_TRANSFER);
wocky_node_set_attributes (file_node,
"name", self->priv->filename,
"size", size_str,
@@ -1272,7 +1271,7 @@ offer_bytestream (GabbleFileTransferChannel *self, const gchar *jid,
wocky_node_add_child_with_content (file_node, "desc", self->priv->description);
/* we support resume */
- wocky_node_add_child_with_content (file_node, "range", NULL);
+ wocky_node_add_child (file_node, "range");
result = gabble_bytestream_factory_negotiate_stream (
conn->bytestream_factory, msg, stream_id,
@@ -1664,15 +1663,14 @@ augment_si_reply (WockyNode *si,
GabbleFileTransferChannel *self = GABBLE_FILE_TRANSFER_CHANNEL (user_data);
WockyNode *file;
- file = wocky_node_add_child_with_content (si, "file", NULL);
- file->ns = g_quark_from_string (NS_FILE_TRANSFER);
+ file = wocky_node_add_child_ns (si, "file", NS_FILE_TRANSFER);
if (self->priv->initial_offset != 0)
{
WockyNode *range;
gchar *offset_str;
- range = wocky_node_add_child_with_content (file, "range", NULL);
+ range = wocky_node_add_child (file, "range");
offset_str = g_strdup_printf ("%" G_GUINT64_FORMAT,
self->priv->initial_offset);
wocky_node_set_attribute (range, "offset", offset_str);
diff --git a/src/jingle-content.c b/src/jingle-content.c
index 4989a3280..a57e2cf4e 100644
--- a/src/jingle-content.c
+++ b/src/jingle-content.c
@@ -469,13 +469,12 @@ send_gtalk4_transport_accept (gpointer user_data)
{
GabbleJingleContent *c = GABBLE_JINGLE_CONTENT (user_data);
GabbleJingleContentPrivate *priv = c->priv;
- WockyNode *sess_node, *tnode;
+ WockyNode *sess_node;
WockyStanza *msg = gabble_jingle_session_new_message (c->session,
JINGLE_ACTION_TRANSPORT_ACCEPT, &sess_node);
DEBUG ("Sending Gtalk4 'transport-accept' message to peer");
- tnode = wocky_node_add_child_with_content (sess_node, "transport", NULL);
- tnode->ns = g_quark_from_string (priv->transport_ns);
+ wocky_node_add_child_ns (sess_node, "transport", priv->transport_ns);
gabble_jingle_session_send (c->session, msg);
@@ -684,8 +683,8 @@ gabble_jingle_content_create_share_channel (GabbleJingleContent *self,
JINGLE_ACTION_INFO, &sess_node);
DEBUG ("Sending 'info' message to peer : channel %s", name);
- channel_node = wocky_node_add_child_with_content (sess_node, "channel", NULL);
- channel_node->ns = g_quark_from_string (priv->content_ns);
+ channel_node = wocky_node_add_child_ns (sess_node, "channel",
+ priv->content_ns);
wocky_node_set_attribute (channel_node, "name", name);
gabble_jingle_session_send (self->session, msg);
@@ -697,15 +696,14 @@ void
gabble_jingle_content_send_complete (GabbleJingleContent *self)
{
GabbleJingleContentPrivate *priv = self->priv;
- WockyNode *sess_node, *complete_node;
+ WockyNode *sess_node;
WockyStanza *msg = NULL;
msg = gabble_jingle_session_new_message (self->session,
JINGLE_ACTION_INFO, &sess_node);
DEBUG ("Sending 'info' message to peer : complete");
- complete_node = wocky_node_add_child_with_content (sess_node, "complete", NULL);
- complete_node->ns = g_quark_from_string (priv->content_ns);
+ wocky_node_add_child_ns (sess_node, "complete", priv->content_ns);
gabble_jingle_session_send (self->session, msg);
@@ -837,7 +835,7 @@ gabble_jingle_content_produce_node (GabbleJingleContent *c,
}
else
{
- content_node = wocky_node_add_child_with_content (parent, "content", NULL);
+ content_node = wocky_node_add_child (parent, "content");
wocky_node_set_attributes (content_node,
"name", priv->name,
"senders", produce_senders (priv->senders),
@@ -861,8 +859,8 @@ gabble_jingle_content_produce_node (GabbleJingleContent *c,
}
else
{
- trans_node = wocky_node_add_child_with_content (content_node, "transport", NULL);
- trans_node->ns = g_quark_from_string (priv->transport_ns);
+ trans_node = wocky_node_add_child_ns (content_node, "transport",
+ priv->transport_ns);
}
if (trans_node_out != NULL)
diff --git a/src/jingle-media-rtp.c b/src/jingle-media-rtp.c
index 45a14191a..65ad46b50 100644
--- a/src/jingle-media-rtp.c
+++ b/src/jingle-media-rtp.c
@@ -883,7 +883,7 @@ _produce_extra_param (gpointer key, gpointer value, gpointer user_data)
gchar *param_name = key;
gchar *param_value = value;
- param = wocky_node_add_child_with_content (pt_node, "parameter", NULL);
+ param = wocky_node_add_child (pt_node, "parameter");
wocky_node_set_attribute (param, "name", param_name);
wocky_node_set_attribute (param, "value", param_value);
}
@@ -931,7 +931,7 @@ produce_payload_type (GabbleJingleContent *content,
WockyNode *pt_node;
gchar buf[16];
- pt_node = wocky_node_add_child_with_content (desc_node, "payload-type", NULL);
+ pt_node = wocky_node_add_child (desc_node, "payload-type");
/* id: required */
sprintf (buf, "%d", p->id);
@@ -1008,13 +1008,11 @@ produce_description_node (JingleDialect dialect, JingleMediaType media_type,
WockyNode *content_node)
{
WockyNode *desc_node;
- const gchar *xmlns = NULL;
+ const gchar *xmlns = NULL, *media_attr = NULL;
if (dialect == JINGLE_DIALECT_GTALK3)
return NULL;
- desc_node = wocky_node_add_child_with_content (content_node, "description", NULL);
-
switch (dialect)
{
case JINGLE_DIALECT_GTALK4:
@@ -1035,15 +1033,18 @@ produce_description_node (JingleDialect dialect, JingleMediaType media_type,
default:
xmlns = NS_JINGLE_RTP;
if (media_type == JINGLE_MEDIA_TYPE_AUDIO)
- wocky_node_set_attribute (desc_node, "media", "audio");
+ media_attr = "audio";
else if (media_type == JINGLE_MEDIA_TYPE_VIDEO)
- wocky_node_set_attribute (desc_node, "media", "video");
+ media_attr = "video";
else
g_assert_not_reached ();
break;
}
- desc_node->ns = g_quark_from_string (xmlns);
+ desc_node = wocky_node_add_child_ns (content_node, "description", xmlns);
+
+ if (media_attr != NULL)
+ wocky_node_set_attribute (desc_node, "media", media_attr);
return desc_node;
}
diff --git a/src/jingle-session.c b/src/jingle-session.c
index 0e266b92d..67fc3c4ff 100644
--- a/src/jingle-session.c
+++ b/src/jingle-session.c
@@ -791,31 +791,17 @@ _foreach_content (GabbleJingleSession *sess,
struct idle_content_reject_ctx {
GabbleJingleSession *session;
- gchar *creator;
- gchar *name;
+ WockyStanza *msg;
};
static gboolean
idle_content_reject (gpointer data)
{
- WockyStanza *msg;
- WockyNode *sess_node, *node;
struct idle_content_reject_ctx *ctx = data;
- msg = gabble_jingle_session_new_message (ctx->session,
- JINGLE_ACTION_CONTENT_REJECT, &sess_node);
-
- g_debug ("name = %s, intiiator = %s", ctx->name, ctx->creator);
-
- node = wocky_node_add_child_with_content (sess_node, "content", NULL);
- wocky_node_set_attributes (node,
- "name", ctx->name, "creator", ctx->creator, NULL);
-
- gabble_jingle_session_send (ctx->session, msg);
+ gabble_jingle_session_send (ctx->session, ctx->msg);
g_object_unref (ctx->session);
- g_free (ctx->name);
- g_free (ctx->creator);
g_free (ctx);
return FALSE;
@@ -826,13 +812,20 @@ fire_idle_content_reject (GabbleJingleSession *sess, const gchar *name,
const gchar *creator)
{
struct idle_content_reject_ctx *ctx = g_new0 (struct idle_content_reject_ctx, 1);
+ WockyNode *sess_node, *node;
if (creator == NULL)
creator = "";
ctx->session = g_object_ref (sess);
- ctx->name = g_strdup (name);
- ctx->creator = g_strdup (creator);
+ ctx->msg = gabble_jingle_session_new_message (ctx->session,
+ JINGLE_ACTION_CONTENT_REJECT, &sess_node);
+
+ g_debug ("name = %s, initiator = %s", name, creator);
+
+ node = wocky_node_add_child (sess_node, "content");
+ wocky_node_set_attributes (node,
+ "name", name, "creator", creator, NULL);
/* FIXME: add API for ordering IQs rather than using g_idle_add. */
g_idle_add (idle_content_reject, ctx);
@@ -2026,11 +2019,9 @@ try_session_initiate_or_accept (GabbleJingleSession *sess)
if (has_video || has_audio)
{
- sess_node = wocky_node_add_child_with_content (sess_node, "description",
- NULL);
-
- sess_node->ns = g_quark_from_static_string (
- has_video ? NS_GOOGLE_SESSION_VIDEO : NS_GOOGLE_SESSION_PHONE);
+ sess_node = wocky_node_add_child_ns_q (sess_node, "description",
+ g_quark_from_static_string (has_video
+ ? NS_GOOGLE_SESSION_VIDEO : NS_GOOGLE_SESSION_PHONE));
}
}
@@ -2140,7 +2131,7 @@ gabble_jingle_session_terminate (GabbleJingleSession *sess,
WockyNode *r = wocky_node_add_child_with_content (session_node, "reason",
NULL);
- wocky_node_add_child_with_content (r, reason_elt, NULL);
+ wocky_node_add_child (r, reason_elt);
if (text != NULL && *text != '\0')
wocky_node_add_child_with_content (r, "text", text);
@@ -2364,7 +2355,7 @@ gabble_jingle_session_send_rtp_info (GabbleJingleSession *sess,
const gchar *name)
{
WockyStanza *message;
- WockyNode *jingle, *notification;
+ WockyNode *jingle;
if (!gabble_jingle_session_defines_action (sess, JINGLE_ACTION_SESSION_INFO))
{
@@ -2374,9 +2365,8 @@ gabble_jingle_session_send_rtp_info (GabbleJingleSession *sess,
message = gabble_jingle_session_new_message (sess,
JINGLE_ACTION_SESSION_INFO, &jingle);
-
- notification = wocky_node_add_child_with_content (jingle, name, NULL);
- notification->ns = g_quark_from_static_string (NS_JINGLE_RTP_INFO);
+ wocky_node_add_child_ns_q (jingle, name,
+ g_quark_from_static_string (NS_JINGLE_RTP_INFO));
/* This is just informational, so ignoring the reply. */
gabble_jingle_session_send (sess, message);
diff --git a/src/jingle-share.c b/src/jingle-share.c
index 838888c2d..b5fd9c659 100644
--- a/src/jingle-share.c
+++ b/src/jingle-share.c
@@ -458,11 +458,10 @@ produce_description (GabbleJingleContent *content, WockyNode *content_node)
ensure_manifest (self);
- desc_node = wocky_node_add_child_with_content (content_node, "description", NULL);
+ desc_node = wocky_node_add_child_ns (content_node, "description",
+ NS_GOOGLE_SESSION_SHARE);
- desc_node->ns = g_quark_from_string (NS_GOOGLE_SESSION_SHARE);
-
- manifest_node = wocky_node_add_child_with_content (desc_node, "manifest", NULL);
+ manifest_node = wocky_node_add_child (desc_node, "manifest");
for (i = priv->manifest->entries; i; i = i->next)
{
@@ -472,9 +471,9 @@ produce_description (GabbleJingleContent *content, WockyNode *content_node)
gchar *size_str, *width_str, *height_str;
if (m->folder)
- file_node = wocky_node_add_child_with_content (manifest_node, "folder", NULL);
+ file_node = wocky_node_add_child (manifest_node, "folder");
else
- file_node = wocky_node_add_child_with_content (manifest_node, "file", NULL);
+ file_node = wocky_node_add_child (manifest_node, "file");
if (m->size > 0)
{
@@ -487,7 +486,7 @@ produce_description (GabbleJingleContent *content, WockyNode *content_node)
if (m->image &&
(m->image_width > 0 || m->image_height > 0))
{
- image_node = wocky_node_add_child_with_content (file_node, "image", NULL);
+ image_node = wocky_node_add_child (file_node, "image");
if (m->image_width > 0)
{
width_str = g_strdup_printf ("%d", m->image_width);
@@ -504,8 +503,8 @@ produce_description (GabbleJingleContent *content, WockyNode *content_node)
}
}
- protocol_node = wocky_node_add_child_with_content (desc_node, "protocol", NULL);
- http_node = wocky_node_add_child_with_content (protocol_node, "http", NULL);
+ protocol_node = wocky_node_add_child (desc_node, "protocol");
+ http_node = wocky_node_add_child (protocol_node, "http");
url_node = wocky_node_add_child_with_content (http_node, "url",
priv->manifest->source_url);
wocky_node_set_attribute (url_node, "name", "source-path");
diff --git a/src/jingle-transport-google.c b/src/jingle-transport-google.c
index 491036d48..1e6d888d4 100644
--- a/src/jingle-transport-google.c
+++ b/src/jingle-transport-google.c
@@ -434,7 +434,7 @@ transmit_candidates (GabbleJingleTransportGoogle *transport,
g_assert_not_reached ();
}
- cnode = wocky_node_add_child_with_content (trans_node, "candidate", NULL);
+ cnode = wocky_node_add_child (trans_node, "candidate");
wocky_node_set_attributes (cnode,
"address", c->address,
"port", port_str,
diff --git a/src/jingle-transport-iceudp.c b/src/jingle-transport-iceudp.c
index cd7f3a1e3..e7eb41f70 100644
--- a/src/jingle-transport-iceudp.c
+++ b/src/jingle-transport-iceudp.c
@@ -479,7 +479,7 @@ inject_candidates (GabbleJingleTransportIface *obj,
"pwd", c->password,
NULL);
- cnode = wocky_node_add_child_with_content (transport_node, "candidate", NULL);
+ cnode = wocky_node_add_child (transport_node, "candidate");
wocky_node_set_attributes (cnode,
"ip", c->address,
"port", port_str,
diff --git a/src/jingle-transport-rawudp.c b/src/jingle-transport-rawudp.c
index 17b1b1f8f..711cc6888 100644
--- a/src/jingle-transport-rawudp.c
+++ b/src/jingle-transport-rawudp.c
@@ -310,7 +310,7 @@ inject_candidates (GabbleJingleTransportIface *obj,
sprintf (port_str, "%d", c->port);
sprintf (comp_str, "%d", c->component);
- cnode = wocky_node_add_child_with_content (transport_node, "candidate", NULL);
+ cnode = wocky_node_add_child (transport_node, "candidate");
wocky_node_set_attributes (cnode,
"ip", c->address,
"port", port_str,
diff --git a/src/message-util.c b/src/message-util.c
index 2c284e37e..49f726c3d 100644
--- a/src/message-util.c
+++ b/src/message-util.c
@@ -42,30 +42,31 @@ void
gabble_message_util_add_chat_state (WockyStanza *stanza,
TpChannelChatState state)
{
- WockyNode *node = NULL;
WockyNode *n = wocky_stanza_get_top_node (stanza);
+ const gchar *node_name = NULL;
switch (state)
{
case TP_CHANNEL_CHAT_STATE_GONE:
- node = wocky_node_add_child_with_content (n, "gone", NULL);
+ node_name = "gone";
break;
case TP_CHANNEL_CHAT_STATE_INACTIVE:
- node = wocky_node_add_child_with_content (n, "inactive", NULL);
+ node_name = "inactive";
break;
case TP_CHANNEL_CHAT_STATE_ACTIVE:
- node = wocky_node_add_child_with_content (n, "active", NULL);
+ node_name = "active";
break;
case TP_CHANNEL_CHAT_STATE_PAUSED:
- node = wocky_node_add_child_with_content (n, "paused", NULL);
+ node_name = "paused";
break;
case TP_CHANNEL_CHAT_STATE_COMPOSING:
- node = wocky_node_add_child_with_content (n, "composing", NULL);
+ node_name = "composing";
break;
}
- if (node != NULL)
- node->ns = g_quark_from_static_string (NS_CHAT_STATES);
+ if (node_name != NULL)
+ wocky_node_add_child_ns_q (n, node_name,
+ g_quark_from_static_string (NS_CHAT_STATES));
}
/**
diff --git a/src/muc-channel.c b/src/muc-channel.c
index c93c262e9..a685b07cf 100644
--- a/src/muc-channel.c
+++ b/src/muc-channel.c
@@ -3312,7 +3312,7 @@ gabble_muc_channel_send_invite (GabbleMucChannel *self,
if (continue_)
{
- wocky_node_add_child_with_content (invite_node, "continue", NULL);
+ wocky_node_add_child (invite_node, "continue");
}
DEBUG ("sending MUC invitation for room %s to contact %s with reason "
diff --git a/src/search-channel.c b/src/search-channel.c
index f5deaba5c..0c253ba92 100644
--- a/src/search-channel.c
+++ b/src/search-channel.c
@@ -880,12 +880,12 @@ build_extended_query (GabbleSearchChannel *self,
GHashTableIter iter;
gpointer key, value;
- x = wocky_node_add_child_with_content (query, "x", "");
- x->ns = g_quark_from_static_string (NS_X_DATA);
+ x = wocky_node_add_child_ns_q (query, "x",
+ g_quark_from_static_string (NS_X_DATA));
wocky_node_set_attribute (x, "type", "submit");
/* add FORM_TYPE */
- field = wocky_node_add_child_with_content (x, "field", "");
+ field = wocky_node_add_child (x, "field");
wocky_node_set_attributes (field,
"type", "hidden",
"var", "FORM_TYPE",
@@ -902,7 +902,7 @@ build_extended_query (GabbleSearchChannel *self,
g_assert (xmpp_field != NULL);
- field = wocky_node_add_child_with_content (x, "field", "");
+ field = wocky_node_add_child (x, "field");
wocky_node_set_attribute (field, "var", xmpp_field);
wocky_node_add_child_with_content (field, "value", value);
@@ -915,7 +915,7 @@ build_extended_query (GabbleSearchChannel *self,
{
xmpp_field = g_ptr_array_index (self->priv->boolean_keys, i);
- field = wocky_node_add_child_with_content (x, "field", "");
+ field = wocky_node_add_child (x, "field");
wocky_node_set_attributes (field,
"var", xmpp_field,
"type", "boolean",
diff --git a/src/tube-dbus.c b/src/tube-dbus.c
index aa2fba17a..6e44623ff 100644
--- a/src/tube-dbus.c
+++ b/src/tube-dbus.c
@@ -1082,8 +1082,7 @@ gabble_tube_dbus_offer (GabbleTubeDBus *tube,
wocky_stanza_get_top_node (msg), "si", NS_SI);
g_assert (si_node != NULL);
- tube_node = wocky_node_add_child_with_content (si_node, "tube", NULL);
- tube_node->ns = g_quark_from_string (NS_TUBES);
+ tube_node = wocky_node_add_child_ns (si_node, "tube", NS_TUBES);
gabble_tube_iface_publish_in_node (GABBLE_TUBE_IFACE (tube),
base_conn, tube_node);
@@ -1381,10 +1380,7 @@ static void
augment_si_accept_iq (WockyNode *si,
gpointer user_data)
{
- WockyNode *tube_node;
-
- tube_node = wocky_node_add_child_with_content (si, "tube", "");
- tube_node->ns = g_quark_from_string (NS_TUBES);
+ wocky_node_add_child_ns (si, "tube", NS_TUBES);
}
/*
diff --git a/src/tube-stream.c b/src/tube-stream.c
index 405e6e381..fa4434e19 100644
--- a/src/tube-stream.c
+++ b/src/tube-stream.c
@@ -511,14 +511,13 @@ start_stream_initiation (GabbleTubeStream *self,
if (cls->target_handle_type == TP_HANDLE_TYPE_CONTACT)
{
- node = wocky_node_add_child_with_content (si_node, "stream", NULL);
+ node = wocky_node_add_child_ns (si_node, "stream", NS_TUBES);
}
else
{
- node = wocky_node_add_child_with_content (si_node, "muc-stream", NULL);
+ node = wocky_node_add_child_ns (si_node, "muc-stream", NS_TUBES);
}
- node->ns = g_quark_from_static_string (NS_TUBES);
wocky_node_set_attribute (node, "tube", id_str);
result = gabble_bytestream_factory_negotiate_stream (
@@ -1768,10 +1767,7 @@ static void
augment_si_accept_iq (WockyNode *si,
gpointer user_data)
{
- WockyNode *tube_node;
-
- tube_node = wocky_node_add_child_with_content (si, "tube", "");
- tube_node->ns = g_quark_from_string (NS_TUBES);
+ wocky_node_add_child_ns (si, "tube", NS_TUBES);
}
/**
diff --git a/src/util.c b/src/util.c
index d1a52bd3e..099f7d8fb 100644
--- a/src/util.c
+++ b/src/util.c
@@ -132,16 +132,6 @@ gabble_generate_id (void)
return str;
}
-
-static void
-lm_message_node_add_nick (WockyNode *node, const gchar *nick)
-{
- WockyNode *nick_node;
-
- nick_node = wocky_node_add_child_with_content (node, "nick", nick);
- nick_node->ns = g_quark_from_string (NS_NICK);
-}
-
void
lm_message_node_add_own_nick (WockyNode *node,
GabbleConnection *connection)
@@ -154,7 +144,8 @@ lm_message_node_add_own_nick (WockyNode *node,
tp_base_connection_get_self_handle (base), &nick);
if (source > GABBLE_CONNECTION_ALIAS_FROM_JID)
- lm_message_node_add_nick (node, nick);
+ wocky_node_add_child_with_content_ns_q (node, "nick", nick,
+ g_quark_from_static_string (NS_NICK));
g_free (nick);
}
@@ -511,7 +502,7 @@ set_child_from_property (gpointer key,
return;
}
- child = wocky_node_add_child_with_content (data->node, data->prop, "");
+ child = wocky_node_add_child (data->node, data->prop);
if (G_VALUE_TYPE (gvalue) == G_TYPE_STRING)
{