pidgin.vv: 501faa27: Have creator == NULL be a wildcard.

maiku at soc.pidgin.im maiku at soc.pidgin.im
Thu Mar 19 08:50:39 EDT 2009


-----------------------------------------------------------------
Revision: 501faa2738fcb7d26304be49e5d53f6b61c35403
Ancestor: 235b7c3a3672bb79aa7475db32880ccd257380fa
Author: maiku at soc.pidgin.im
Date: 2009-03-19T10:23:35
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/501faa2738fcb7d26304be49e5d53f6b61c35403

Modified files:
        libpurple/protocols/jabber/jingle/session.c

ChangeLog: 

Have creator == NULL be a wildcard.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/session.c	9118d92604a0c0fea256942d98f3d7303520c79d
+++ libpurple/protocols/jabber/jingle/session.c	52cadf2c8a327865780286bdf5fc8880dfff8cb5
@@ -500,11 +500,14 @@ jingle_session_find_content(JingleSessio
 	for (; iter; iter = g_list_next(iter)) {
 		JingleContent *content = iter->data;
 		gchar *cname = jingle_content_get_name(content);
-		gchar *ccreator = jingle_content_get_creator(content);
-		gboolean result = (!strcmp(name, cname) && !strcmp(creator, ccreator));
+		gboolean result = !strcmp(name, cname);
+		g_free(cname);
 
-		g_free(cname);
-		g_free(ccreator);
+		if (creator != NULL) {
+			gchar *ccreator = jingle_content_get_creator(content);
+			result = (result && !strcmp(creator, ccreator));
+			g_free(ccreator);
+		}
 
 		if (result == TRUE)
 			return content;
@@ -519,11 +522,14 @@ jingle_session_find_pending_content(Jing
 	for (; iter; iter = g_list_next(iter)) {
 		JingleContent *content = iter->data;
 		gchar *cname = jingle_content_get_name(content);
-		gchar *ccreator = jingle_content_get_creator(content);
-		gboolean result = (!strcmp(name, cname) && !strcmp(creator, ccreator));
+		gboolean result = !strcmp(name, cname);
+		g_free(cname);
 
-		g_free(cname);
-		g_free(ccreator);
+		if (creator != NULL) {
+			gchar *ccreator = jingle_content_get_creator(content);
+			result = (result && !strcmp(creator, ccreator));
+			g_free(ccreator);
+		}
 
 		if (result == TRUE)
 			return content;


More information about the Commits mailing list