Mercurial > pidgin
comparison libpurple/protocols/jabber/jabber.c @ 23817:41d6d4217d21
Further decoupled Jingle code from jabber.c:
* Removed unnecessary Jingle functions from the header
* Moved JingleSession structure to jingle.c
* Created functions to remove jabber.c's dependence on JingleSession:
- jabber_jingle_session_terminate_session_media
- jabber_jingle_session_terminate_sessions
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Mon, 02 Jun 2008 21:58:39 +0000 |
parents | e73b03097664 |
children | 42e17cc5b6d2 |
comparison
equal
deleted
inserted
replaced
23816:e73b03097664 | 23817:41d6d4217d21 |
---|---|
1252 void jabber_close(PurpleConnection *gc) | 1252 void jabber_close(PurpleConnection *gc) |
1253 { | 1253 { |
1254 JabberStream *js = gc->proto_data; | 1254 JabberStream *js = gc->proto_data; |
1255 | 1255 |
1256 #ifdef USE_VV | 1256 #ifdef USE_VV |
1257 /* Close all of the open media sessions on this stream */ | 1257 /* Close all of the open Jingle sessions on this stream */ |
1258 GList *values = g_hash_table_get_values(js->sessions); | 1258 jabber_jingle_session_terminate_sessions(js); |
1259 GList *iter = values; | |
1260 | |
1261 for (; iter; iter = iter->next) { | |
1262 JingleSession *session = (JingleSession *)iter->data; | |
1263 purple_media_hangup(session->media); | |
1264 } | |
1265 | |
1266 g_list_free(values); | |
1267 #endif | 1259 #endif |
1268 | 1260 |
1269 /* Don't perform any actions on the ssl connection | 1261 /* Don't perform any actions on the ssl connection |
1270 * if we were forcibly disconnected because it will crash | 1262 * if we were forcibly disconnected because it will crash |
1271 * on some SSL backends. | 1263 * on some SSL backends. |
1887 { | 1879 { |
1888 JabberStream *js = gc->proto_data; | 1880 JabberStream *js = gc->proto_data; |
1889 JabberID *jid; | 1881 JabberID *jid; |
1890 JabberBuddy *jb; | 1882 JabberBuddy *jb; |
1891 JabberBuddyResource *jbr; | 1883 JabberBuddyResource *jbr; |
1892 #ifdef USE_VV | 1884 |
1893 JingleSession *session; | |
1894 #endif | |
1895 if(!(jid = jabber_id_new(who))) | 1885 if(!(jid = jabber_id_new(who))) |
1896 return; | 1886 return; |
1897 | 1887 |
1898 #ifdef USE_VV | 1888 #ifdef USE_VV |
1899 session = jabber_jingle_session_find_by_jid(js, who); | 1889 jabber_jingle_session_terminate_session_media(js, who); |
1900 | |
1901 if (session) { | |
1902 purple_media_hangup(session->media); | |
1903 } | |
1904 | |
1905 #endif | 1890 #endif |
1906 if((jb = jabber_buddy_find(js, who, TRUE)) && | 1891 if((jb = jabber_buddy_find(js, who, TRUE)) && |
1907 (jbr = jabber_buddy_find_resource(jb, jid->resource))) { | 1892 (jbr = jabber_buddy_find_resource(jb, jid->resource))) { |
1908 if(jbr->thread_id) { | 1893 if(jbr->thread_id) { |
1909 g_free(jbr->thread_id); | 1894 g_free(jbr->thread_id); |