jingle-filetransfer/filetransfer.c
changeset 59 69985ccda25a
parent 58 daafe5b8a48d
child 60 05184a1846d1
--- a/jingle-filetransfer/filetransfer.c	Tue Jul 20 00:52:21 2010 +0200
+++ b/jingle-filetransfer/filetransfer.c	Tue Jul 20 12:49:17 2010 +0200
@@ -28,6 +28,7 @@
 #include <mcabber/utils.h>
 #include <mcabber/xmpp_helper.h>
 #include <mcabber/settings.h>
+#include <mcabber/logprint.h>
 
 #include <jingle/jingle.h>
 #include <jingle/check.h>
@@ -65,13 +66,15 @@
   const gchar *datestr, *sizestr;
 
   node = lm_message_node_get_child(cn->description, "offer");
+ scr_LogPrint(LPRINT_LOGNORM, "%s",
+                 lm_message_node_to_string(cn->description));
   if (!node) {
     g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING,
                 "the offer element is missing");
     return NULL;
   }
 
-  node = lm_message_node_get_child(cn->description, "file");
+  node = lm_message_node_get_child(node, "file");
   if (!node) {
     g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING,
                 "the file element is missing");
@@ -141,7 +144,7 @@
   for (i = 0; i < 32 && hash[i]; i++)
     if (!g_ascii_isxdigit(hash[i])) break;
 
-  if (i == 31)
+  if (i == 32)
     return TRUE;
   else
     return FALSE;