It's not an error if the jingle element has no initiator attribute.
authorNicolas Cornu <nicolas.cornu@ensi-bourges.fr>
Tue, 10 Aug 2010 18:23:07 +0200
changeset 90 b250d32fea87
parent 89 88bb2d0f9ff8
child 91 7d3e75eec29e
It's not an error if the jingle element has no initiator attribute.
jingle/check.c
jingle/send.c
--- a/jingle/check.c	Tue Aug 10 15:56:38 2010 +0200
+++ b/jingle/check.c	Tue Aug 10 18:23:07 2010 +0200
@@ -69,7 +69,7 @@
     return FALSE;
   }
 
-  if (check_jid_syntax(jn->initiator)) {
+  if (actionstr != NULL && check_jid_syntax(jn->initiator)) {
     g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_BADVALUE,
                 "the initiator attribute in invalid (not a jid)");
     return FALSE;
--- a/jingle/send.c	Tue Aug 10 15:56:38 2010 +0200
+++ b/jingle/send.c	Tue Aug 10 18:23:07 2010 +0200
@@ -128,8 +128,10 @@
   JingleAckHandle *ackhandle;
   GSList *listentry;
   
-  LmMessage* mess = lm_message_from_jinglesession(js, js->to,
+  LmMessage *mess = lm_message_from_jinglesession(js, js->to,
                                                   JINGLE_SESSION_INITIATE);
+  lm_message_node_set_attribute(lm_message_node_get_child(mess->node, "jingle"),
+                                "initiator", js->from);
 
   if (mess) {
     ackhandle = g_new0(JingleAckHandle, 1);