67 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, |
67 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, |
68 "an attribute of the jingle element is missing"); |
68 "an attribute of the jingle element is missing"); |
69 return FALSE; |
69 return FALSE; |
70 } |
70 } |
71 |
71 |
72 if (!check_jid_syntax(jn->initiator)) { |
72 if (check_jid_syntax(jn->initiator)) { |
73 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_BADVALUE, |
73 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_BADVALUE, |
74 "the initiator attribute in invalid (not a jid)"); |
74 "the initiator attribute in invalid (not a jid)"); |
75 return FALSE; |
75 return FALSE; |
76 } |
76 } |
77 |
77 |
118 return NULL; |
118 return NULL; |
119 } |
119 } |
120 |
120 |
121 tmp = index_in_array(creatorstr, jingle_content_creator); |
121 tmp = index_in_array(creatorstr, jingle_content_creator); |
122 tmp2 = index_in_array(sendersstr, jingle_content_senders); |
122 tmp2 = index_in_array(sendersstr, jingle_content_senders); |
123 if (tmp < 0 || tmp2 < 0) { |
123 if (tmp < 0 || (tmp2 < 0 && sendersstr != NULL)) { |
124 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_BADVALUE, |
124 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_BADVALUE, |
125 "the attribute creator or sender is invalid"); |
125 "the attribute creator or sender is invalid"); |
126 g_free(cn); |
126 g_free(cn); |
127 return NULL; |
127 return NULL; |
128 } |
128 } |
129 cn->creator = (JingleCreator)tmp; |
129 cn->creator = (JingleCreator)tmp; |
130 cn->senders = (JingleSenders)tmp2; |
130 if(sendersstr != NULL) |
131 |
131 cn->senders = (JingleSenders)tmp2; |
|
132 else |
|
133 cn->senders = JINGLE_SENDERS_BOTH; |
132 cn->description = lm_message_node_get_child(node, "description"); |
134 cn->description = lm_message_node_get_child(node, "description"); |
133 cn->transport = lm_message_node_get_child(node, "transport"); |
135 cn->transport = lm_message_node_get_child(node, "transport"); |
134 if (cn->description == NULL || cn->transport == NULL) { |
136 if (cn->description == NULL || cn->transport == NULL) { |
135 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, |
137 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, |
136 "a child element of content is missing"); |
138 "a child element of content is missing"); |