some things
authorNicolas Cornu <nicolas.cornu@ensi-bourges.fr>
Tue, 01 Jun 2010 09:21:54 +0200
changeset 10 3ddaf757e36a
parent 9 5b6e1cdeb02b
child 11 5ec956706f0c
some things
CMakeLists.txt
jingle.c
jingle.h
--- a/CMakeLists.txt	Sat May 29 03:51:06 2010 +0200
+++ b/CMakeLists.txt	Tue Jun 01 09:21:54 2010 +0200
@@ -35,7 +35,7 @@
 				 ${MCABBER_LIBRARY_DIRS})
 
 ## Target definitions
-add_library(jingle MODULE jingle.c parse.c)
+add_library(jingle MODULE jingle.c parse.c jingle_register.c error.c)
 
 ## Compiler setup
 configure_file(config.h.in config.h)
--- a/jingle.c	Sat May 29 03:51:06 2010 +0200
+++ b/jingle.c	Tue Jun 01 09:21:54 2010 +0200
@@ -28,11 +28,12 @@
 #include <mcabber/modules.h>
 #include <mcabber/logprint.h>
 #include <mcabber/xmpp_helper.h>
-#include <mcabber/xmpp_defines.h>
+#include <mcabber/xmpp_defines.h> 
 
 #include "jingle.h"
 #include "jingle_register.h"
 #include "parse.h"
+#include "error.h"
 
 static void  jingle_register_lm_handlers(void);
 static void  jingle_unregister_lm_handlers(void);
@@ -81,13 +82,8 @@
     return LM_HANDLER_RESULT_REMOVE_MESSAGE;
   }
 
-  //parse_iq(lm_message_get_node(message), &ii);
-
-  // On traitre les erreurs
   if (parse_jingle(node, &ij) != PARSE_OK) {
-   
-   
-   
+    jingle_error_bad_request(message); 
     return LM_HANDLER_RESULT_REMOVE_MESSAGE;
   }
 
@@ -114,31 +110,6 @@
   lm_message_unref(r);
 }
 
-/**
- * Reply to a Jingle IQ with an error.
- */
-void jingle_error_iq(LmMessage *m, const gchar *errtype,
-    const gchar *cond, const gchar *jinglecond)
-{
-  LmMessage *r;
-  LmMessageNode *err, *tmpnode;
-
-  r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_ERROR);
-  err = lm_message_node_add_child(r->node, "error", NULL);
-  lm_message_node_set_attribute(err, "type", errtype);
-
-  // error condition as defined by RFC 3920bis section 8.3.3
-  tmpnode = lm_message_node_add_child(err, cond, NULL);
-  lm_message_node_set_attribute(tmpnode, "xmlns", NS_XMPP_STANZAS);
-
-  // jingle error condition as defined by XEP-0166 section 10
-  tmpnode = lm_message_node_add_child(err, jinglecond, NULL);
-  lm_message_node_set_attribute(tmpnode, "xmlns", NS_JINGLE_ERRORS);
-
-  lm_connection_send(lconnection, r, NULL);
-  lm_message_unref(r);
-}
-
 static void jingle_unregister_lm_handlers(void)
 {
   if (lconnection) {
--- a/jingle.h	Sat May 29 03:51:06 2010 +0200
+++ b/jingle.h	Tue Jun 01 09:21:54 2010 +0200
@@ -4,9 +4,6 @@
 #define NS_JINGLE "urn:xmpp:jingle:1"
 #define NS_JINGLE_ERRORS "urn:xmpp:jingle:errors:1"
 
-void jingle_error_iq(LmMessage *m, const gchar *errtype,
-                     const gchar *cond, const gchar *jinglecond);
-
 void jingle_ack_iq(LmMessage *m);
 
 typedef enum {