pidgin.vv: be1f71ec: Make it compile in Windows with the equi...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Thu Jan 8 19:50:55 EST 2009


-----------------------------------------------------------------
Revision: be1f71ec3369834e58cb66cfaa0ac17c03fdbe82
Ancestor: 07557d13ad7bbfd34e6cb96dd34cfb2daea2c20d
Author: maiku at soc.pidgin.im
Date: 2009-01-09T00:47:06
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/be1f71ec3369834e58cb66cfaa0ac17c03fdbe82

Modified files:
        libpurple/protocols/jabber/Makefile.mingw
        libpurple/protocols/jabber/jingle/content.c
        libpurple/protocols/jabber/jingle/iceudp.c
        libpurple/protocols/jabber/jingle/jingle.c
        libpurple/protocols/jabber/jingle/rawudp.c
        libpurple/protocols/jabber/jingle/session.c
        libpurple/protocols/jabber/jingle/transport.c

ChangeLog: 

Make it compile in Windows with the equivalent of --disable-vv.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/Makefile.mingw	734ce85693aba6878ac3db013bf9047aa48eb237
+++ libpurple/protocols/jabber/Makefile.mingw	d9ae2990834606de1e89120fea21b6287f9117cc
@@ -85,6 +85,7 @@ LIBS = \
 ##
 LIBS = \
 			-lglib-2.0 \
+			-lgobject-2.0 \
 			-lxml2 \
 			-lws2_32 \
 			-lintl \
============================================================
--- libpurple/protocols/jabber/jingle/content.c	eac84f1b7d3f1e93228f9d271e7a0db3ace99fac
+++ libpurple/protocols/jabber/jingle/content.c	5c81b926e371d0eebe9b352e25c4e2e3942386f4
@@ -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"
============================================================
--- libpurple/protocols/jabber/jingle/iceudp.c	c186771900094ea607af84a86a83e6c3f3c36287
+++ libpurple/protocols/jabber/jingle/iceudp.c	6061e950c2b968ea84f2c2a23cb0c2a118240a39
@@ -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"
============================================================
--- libpurple/protocols/jabber/jingle/jingle.c	e19f6a7370fb6bc3cff5582680724ceaa07b6169
+++ libpurple/protocols/jabber/jingle/jingle.c	48d1bfcbffbabf98b18860d95df332d61666eb73
@@ -19,7 +19,8 @@
  *
  */
 
-#include "config.h"
+#include "internal.h"
+
 #include "content.h"
 #include "debug.h"
 #include "jingle.h"
@@ -423,15 +424,17 @@ jingle_parse(JabberStream *js, xmlnode *
 	}
 }
 
+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);
 }
 
============================================================
--- libpurple/protocols/jabber/jingle/rawudp.c	746c1c1f1f1485a6f0595aae1ecdcfc81d130e2b
+++ libpurple/protocols/jabber/jingle/rawudp.c	569676445075952c3450efb0cd0ec05a918da24a
@@ -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"
============================================================
--- libpurple/protocols/jabber/jingle/session.c	b329e823dd3176d11c39756a63a12cb5ef99a648
+++ libpurple/protocols/jabber/jingle/session.c	6c2a9e3d215e811884a0f2c687510d4cadbdc977
@@ -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,30 +363,33 @@ jingle_session_find_by_sid(JabberStream 
 			  g_hash_table_lookup(js->sessions, sid) : NULL;
 }
 
-JingleSession *
-jingle_session_find_by_jid(JabberStream *js, const gchar *jid)
+static gboolean find_by_jid_ghr(gpointer key,
+		gpointer value, gpointer user_data)
 {
-	GList *values = (js->sessions) ? 
-			g_hash_table_get_values(js->sessions) : NULL;
+	JingleSession *session = (JingleSession *)value;
+	const gchar *jid = user_data;
 	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;
-		}
+	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 NULL;	
+	return FALSE;
 }
 
+JingleSession *
+jingle_session_find_by_jid(JabberStream *js, const gchar *jid)
+{
+	return js->sessions != NULL ?
+			g_hash_table_find(js->sessions,
+			find_by_jid_ghr, (gpointer)jid) : NULL; 
+}
+
 static xmlnode *
 jingle_add_jingle_packet(JingleSession *session,
 			 JabberIq *iq, JingleActionType action)
============================================================
--- libpurple/protocols/jabber/jingle/transport.c	d716de3c7c369e67ad2ac01504eb1dff0d15d646
+++ libpurple/protocols/jabber/jingle/transport.c	d9b7af2edea8ae0d5269292c522bcfbe7dd6600b
@@ -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"


More information about the Commits mailing list