--- a/jingle/action-handlers.c Wed Jun 09 22:16:21 2010 +0200
+++ b/jingle/action-handlers.c Fri Jun 11 01:56:34 2010 +0200
@@ -21,18 +21,31 @@
#include <glib.h>
+#include <mcabber/logprint.h>
+
#include <jingle/jingle.h>
#include <jingle/check.h>
void handle_session_initiate(LmMessage *m, JingleNode *jn)
{
+ GError *err = NULL;
+
+ if (!check_contents(jn, &err)) {
+ scr_log_print(LPRINT_DEBUG, "jingle: One of the content element was invalid (%s)",
+ err->message);
+ jingle_send_iq_error(m, "cancel", "bad-request", NULL);
+ return;
+ }
+
// a session-initiate message must contains at least one <content> element
if (g_slist_length(jn->content) < 1) {
jingle_send_iq_error(m, "cancel", "bad-request", NULL);
return;
}
+
+
/*// if a session with the same sid already exists
if (session_find(jn) != NULL) {
jingle_send_iq_error(m, "cancel", "unexpected-request", "out-of-order");