Don't append the 'id'-tag in opening stream headers. [#30]
authorWill Thompson <will.thompson@collabora.co.uk>
Wed, 05 Nov 2008 23:19:42 +0100
changeset 557 47f6169c0f08
parent 556 ae4b087f5d17
child 566 ac126834c160
Don't append the 'id'-tag in opening stream headers. [#30] According to RFC 3920 (section 4.4) the id attribute SHOULD NOT be added by the initiating party. [#30 responsible:Hallski state:resolved milestone:Loudmouth 1.4.4 tagged:committed] committer: Mikael Hallendal <micke@imendio.com>
loudmouth/lm-message.c
--- a/loudmouth/lm-message.c	Wed Oct 29 21:53:35 2008 +0100
+++ b/loudmouth/lm-message.c	Wed Nov 05 23:19:42 2008 +0100
@@ -223,9 +223,11 @@
 	
 	m->node = _lm_message_node_new (_lm_message_type_to_string (type));
 
-	id = _lm_utils_generate_id ();
-	lm_message_node_set_attribute (m->node, "id", id);
-	g_free (id);
+	if (type != LM_MESSAGE_TYPE_STREAM) {
+		id = _lm_utils_generate_id ();
+		lm_message_node_set_attribute (m->node, "id", id);
+		g_free (id);
+	}
 	
 	if (to) {
 		lm_message_node_set_attribute (m->node, "to", to);