changeset 26301:08e4ad2fcd63

Have creator == NULL be a wildcard.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Thu, 19 Mar 2009 10:23:35 +0000
parents 7fe896a5f4db
children 95794e9acf71
files libpurple/protocols/jabber/jingle/session.c
diffstat 1 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jingle/session.c	Thu Mar 19 09:54:02 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/session.c	Thu Mar 19 10:23:35 2009 +0000
@@ -500,11 +500,14 @@
 	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 @@
 	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;