equal
deleted
inserted
replaced
31 #include <jingle/check.h> |
31 #include <jingle/check.h> |
32 #include <jingle/sessions.h> |
32 #include <jingle/sessions.h> |
33 #include <jingle/register.h> |
33 #include <jingle/register.h> |
34 #include <jingle/send.h> |
34 #include <jingle/send.h> |
35 #include <jingle/action-handlers.h> |
35 #include <jingle/action-handlers.h> |
|
36 #include <jingle/general-handlers.h> |
36 |
37 |
37 void handle_content_accept(JingleNode *jn) |
38 void handle_content_accept(JingleNode *jn) |
38 { |
39 { |
39 GError *err = NULL; |
40 GError *err = NULL; |
40 GSList *child = NULL; |
41 GSList *child = NULL; |
66 |
67 |
67 jingle_ack_iq(jn->message); |
68 jingle_ack_iq(jn->message); |
68 |
69 |
69 for (child = jn->content; child; child = child->next) { |
70 for (child = jn->content; child; child = child->next) { |
70 cn = (JingleContent *)(child->data); |
71 cn = (JingleContent *)(child->data); |
71 session_changestate_sessioncontent(sess, cn->name, ACTIVE); |
72 session_changestate_sessioncontent(sess, cn->name, JINGLE_SESSION_STATE_ACTIVE); |
72 } |
73 } |
73 } |
74 } |
74 |
75 |
75 void handle_content_add(JingleNode *jn) |
76 void handle_content_add(JingleNode *jn) |
76 { |
77 { |
135 transport = transfuncs->check(cn, &err); |
136 transport = transfuncs->check(cn, &err); |
136 if (transport == NULL || err != NULL) { |
137 if (transport == NULL || err != NULL) { |
137 reject.content = g_slist_append(reject.content, cn); |
138 reject.content = g_slist_append(reject.content, cn); |
138 continue; |
139 continue; |
139 } |
140 } |
140 session_add_content(sess, cn, ACTIVE); |
141 session_add_content(sess, cn, JINGLE_SESSION_STATE_ACTIVE); |
141 accept.content = g_slist_append(accept.content, cn); |
142 accept.content = g_slist_append(accept.content, cn); |
142 } |
143 } |
143 |
144 |
144 if (g_slist_length(accept.content) != 0) { |
145 if (g_slist_length(accept.content) != 0) { |
145 r = lm_message_from_jinglenode(&accept, lm_message_get_from(jn->message)); |
146 r = lm_message_from_jinglenode(&accept, lm_message_get_from(jn->message)); |
146 if (r) { |
147 if (r) { |
147 lm_connection_send(lconnection, r, NULL); |
148 lm_connection_send_with_reply(lconnection, r,NULL, NULL); |
148 lm_message_unref(r); |
149 lm_message_unref(r); |
149 } |
150 } |
150 } |
151 } |
151 |
152 |
152 if (g_slist_length(reject.content) != 0) { |
153 if (g_slist_length(reject.content) != 0) { |