67 LmMessageNode *iq = lm_message_get_node(jn->message); |
68 LmMessageNode *iq = lm_message_get_node(jn->message); |
68 const gchar *from = lm_message_node_get_attribute(iq, "from"); |
69 const gchar *from = lm_message_node_get_attribute(iq, "from"); |
69 return session_find_by_sid(jn->sid, from); |
70 return session_find_by_sid(jn->sid, from); |
70 } |
71 } |
71 |
72 |
|
73 void session_add_content(JingleSession *sess, JingleContent *cn) |
|
74 { |
|
75 SessionContent *sc = g_new0(SessionContent, 1); |
|
76 const gchar *tmpchar = lm_message_node_get_attribute(cn->description, |
|
77 "xmlns"); |
|
78 sc->appfuncs = jingle_get_appfuncs(tmpchar); |
|
79 tmpchar = lm_message_node_get_attribute(cn->transport, "xmlns"); |
|
80 sc->transfuncs = jingle_get_transportfuncs(tmpchar); |
|
81 // TODO errors |
|
82 sc->description = sc->appfuncs->check(cn, NULL); |
|
83 sc->transport = sc->appfuncs->check(cn, NULL); |
|
84 |
|
85 sess->content = g_slist_append(sess->content, sc); |
|
86 } |
|
87 |
|
88 SessionContent *session_find_sessioncontent(JingleSession *sess, |
|
89 gconstpointer desc, gconstpointer trans) |
|
90 { |
|
91 GSList *el; |
|
92 SessionContent *sc; |
|
93 for (el = sess->content; el; el = el->next) { |
|
94 sc = (SessionContent*) el->data; |
|
95 if (sc->appfuncs->cmp(sc->description, desc) == TRUE && |
|
96 sc->transfuncs->cmp(sc->transport, trans) == TRUE) |
|
97 return sc; |
|
98 } |
|
99 return NULL; |
|
100 } |
|
101 |
72 /** |
102 /** |
73 * Remove a session from the linked list and free it. |
103 * Remove a session from the linked list and free it. |
74 */ |
104 */ |
75 void session_delete(JingleSession *sess) |
105 void session_delete(JingleSession *sess) |
76 { |
106 { |