32 #include <jingle/register.h> |
32 #include <jingle/register.h> |
33 |
33 |
34 #include "filetransfer.h" |
34 #include "filetransfer.h" |
35 |
35 |
36 |
36 |
37 gconstpointer jingle_ft_check(JingleContent *cn, GError **err, gpointer *data); |
37 gconstpointer jingle_ft_check(JingleContent *cn, GError **err); |
38 static void jingle_ft_init(void); |
38 static void jingle_ft_init(void); |
39 static void jingle_ft_uninit(void); |
39 static void jingle_ft_uninit(void); |
40 |
40 |
41 |
41 |
42 const gchar *deps[] = { "jingle", NULL }; |
42 const gchar *deps[] = { "jingle", NULL }; |
53 .uninit = jingle_ft_uninit, |
53 .uninit = jingle_ft_uninit, |
54 .next = NULL, |
54 .next = NULL, |
55 }; |
55 }; |
56 |
56 |
57 |
57 |
58 gconstpointer jingle_ft_check(JingleContent *cn, GError **err, gpointer *data) |
58 gconstpointer jingle_ft_check(JingleContent *cn, GError **err) |
59 { |
59 { |
60 JingleFT *ft = NULL; |
60 JingleFT *ft = NULL; |
61 LmMessageNode *node, *description; |
61 LmMessageNode *node; |
62 const gchar *datestr, *sizestr; |
62 const gchar *datestr, *sizestr; |
63 |
63 |
64 description = lm_message_node_get_child(cn->node, "description"); |
64 node = lm_message_node_get_child(cn->description, "offer"); |
65 if (!description) { |
|
66 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, "Huh ?"); |
|
67 return NULL; |
|
68 } |
|
69 |
|
70 node = lm_message_node_get_child(description, "offer"); |
|
71 if (!node) { |
65 if (!node) { |
72 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, |
66 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, |
73 "the offer element is missing"); |
67 "the offer element is missing"); |
74 return NULL; |
68 return NULL; |
75 } |
69 } |
76 |
70 |
77 node = lm_message_node_get_child(description, "file"); |
71 node = lm_message_node_get_child(cn->description, "file"); |
78 if (!node) { |
72 if (!node) { |
79 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, |
73 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, |
80 "the file element is missing"); |
74 "the file element is missing"); |
81 return NULL; |
75 return NULL; |
82 } |
76 } |
114 return (gconstpointer) ft; |
108 return (gconstpointer) ft; |
115 } |
109 } |
116 |
110 |
117 static void jingle_ft_init(void) |
111 static void jingle_ft_init(void) |
118 { |
112 { |
119 jingle_register_app(NS_JINGLE_APP_FT, &funcs, NULL); |
113 jingle_register_app(NS_JINGLE_APP_FT, &funcs); |
120 xmpp_add_feature(NS_JINGLE_APP_FT); |
114 xmpp_add_feature(NS_JINGLE_APP_FT); |
121 } |
115 } |
122 |
116 |
123 static void jingle_ft_uninit(void) |
117 static void jingle_ft_uninit(void) |
124 { |
118 { |