changeset 26096:c7ab1983df88

merge of '106c6ba87b3a431f8ec3adad7e4e569f3d008f83' and 'a00c26c622d19ab8c25e652b478707ea3368a619'
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sat, 10 Jan 2009 00:55:35 +0000
parents c80f151b159a (current diff) 0605c1121613 (diff)
children 5c3976757e50
files
diffstat 8 files changed, 44 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/Makefile.mingw	Sat Jan 10 00:49:07 2009 +0000
+++ b/libpurple/protocols/jabber/Makefile.mingw	Sat Jan 10 00:55:35 2009 +0000
@@ -85,6 +85,7 @@
 ##
 LIBS = \
 			-lglib-2.0 \
+			-lgobject-2.0 \
 			-lxml2 \
 			-lws2_32 \
 			-lintl \
--- a/libpurple/protocols/jabber/google.c	Sat Jan 10 00:49:07 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Sat Jan 10 00:55:35 2009 +0000
@@ -31,7 +31,6 @@
 #include "iq.h"
 
 #ifdef USE_VV
-#include <gst/farsight/fs-conference-iface.h>
 
 typedef struct {
 	char *id;
@@ -124,7 +123,6 @@
 
 	fs_codec_list_destroy(codecs);
 	jabber_iq_send(iq);
-	gst_element_set_state(purple_media_get_pipeline(session->media), GST_STATE_PLAYING);
 }
 
 static void
--- a/libpurple/protocols/jabber/jingle/content.c	Sat Jan 10 00:49:07 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/content.c	Sat Jan 10 00:55:35 2009 +0000
@@ -18,7 +18,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include "config.h"
+#include "internal.h"
+
 #include "debug.h"
 #include "content.h"
 #include "jingle.h"
--- a/libpurple/protocols/jabber/jingle/iceudp.c	Sat Jan 10 00:49:07 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/iceudp.c	Sat Jan 10 00:55:35 2009 +0000
@@ -18,6 +18,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
+#include "internal.h"
+
 #include "iceudp.h"
 #include "jingle.h"
 #include "debug.h"
--- a/libpurple/protocols/jabber/jingle/jingle.c	Sat Jan 10 00:49:07 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/jingle.c	Sat Jan 10 00:55:35 2009 +0000
@@ -19,7 +19,8 @@
  *
  */
 
-#include "config.h"
+#include "internal.h"
+
 #include "content.h"
 #include "debug.h"
 #include "jingle.h"
@@ -423,15 +424,17 @@
 	}
 }
 
+static void
+jingle_terminate_sessions_gh(gpointer key, gpointer value, gpointer user_data)
+{
+	g_object_unref(value);
+}
+
 void
 jingle_terminate_sessions(JabberStream *js)
 {
-	GList *values = js->sessions ?
-			g_hash_table_get_values(js->sessions) : NULL;
-
-	for (; values; values = g_list_delete_link(values, values)) {
-		JingleSession *session = (JingleSession *)values->data;
-		g_object_unref(session);
-	}
+	if (js->sessions)
+		g_hash_table_foreach(js->sessions,
+				jingle_terminate_sessions_gh, NULL);
 }
 
--- a/libpurple/protocols/jabber/jingle/rawudp.c	Sat Jan 10 00:49:07 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/rawudp.c	Sat Jan 10 00:55:35 2009 +0000
@@ -18,6 +18,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
+#include "internal.h"
+
 #include "rawudp.h"
 #include "jingle.h"
 #include "debug.h"
--- a/libpurple/protocols/jabber/jingle/session.c	Sat Jan 10 00:49:07 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/session.c	Sat Jan 10 00:55:35 2009 +0000
@@ -18,7 +18,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include "config.h"
+#include "internal.h"
+
 #include "content.h"
 #include "debug.h"
 #include "session.h"
@@ -362,28 +363,31 @@
 			  g_hash_table_lookup(js->sessions, sid) : NULL;
 }
 
+static gboolean find_by_jid_ghr(gpointer key,
+		gpointer value, gpointer user_data)
+{
+	JingleSession *session = (JingleSession *)value;
+	const gchar *jid = user_data;
+	gboolean use_bare = strchr(jid, '/') == NULL;
+	gchar *remote_jid = jingle_session_get_remote_jid(session);
+	gchar *cmp_jid = use_bare ? jabber_get_bare_jid(remote_jid)
+				  : g_strdup(remote_jid);
+	g_free(remote_jid);
+	if (!strcmp(jid, cmp_jid)) {
+		g_free(cmp_jid);
+		return TRUE;
+	}
+	g_free(cmp_jid);
+
+	return FALSE;
+}
+
 JingleSession *
 jingle_session_find_by_jid(JabberStream *js, const gchar *jid)
 {
-	GList *values = (js->sessions) ? 
-			g_hash_table_get_values(js->sessions) : NULL;
-	gboolean use_bare = strchr(jid, '/') == NULL;
-
-	for (; values; values = g_list_delete_link(values, values)) {
-		JingleSession *session = (JingleSession *)values->data;
-		gchar *remote_jid = jingle_session_get_remote_jid(session);
-		gchar *cmp_jid = use_bare ? jabber_get_bare_jid(remote_jid)
-					  : g_strdup(remote_jid);
-		g_free(remote_jid);
-		if (!strcmp(jid, cmp_jid)) {
-			g_free(cmp_jid);
-			g_list_free(values);
-			return session;
-		}
-		g_free(cmp_jid);
-	}
-
-	return NULL;	
+	return js->sessions != NULL ?
+			g_hash_table_find(js->sessions,
+			find_by_jid_ghr, (gpointer)jid) : NULL; 
 }
 
 static xmlnode *
--- a/libpurple/protocols/jabber/jingle/transport.c	Sat Jan 10 00:49:07 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/transport.c	Sat Jan 10 00:55:35 2009 +0000
@@ -18,6 +18,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
+#include "internal.h"
+
 #include "transport.h"
 #include "jingle.h"
 #include "debug.h"