jingle/jingle.c
changeset 86 a994dc89a1fc
parent 83 d5c5e9be53cb
child 89 88bb2d0f9ff8
--- a/jingle/jingle.c	Tue Aug 10 00:31:40 2010 +0200
+++ b/jingle/jingle.c	Tue Aug 10 01:10:10 2010 +0200
@@ -288,18 +288,21 @@
   roster_usr = buddy_search_jid(jid);
   reslist = buddy_getresources(roster_usr->data);
   for (thisres = reslist; thisres; thisres = g_slist_next(thisres)) {
+    choosenres = g_strdup(thisres->data);
+    return choosenres;
     found = TRUE;
     for (indexns = 0; ns[indexns]; indexns++) {
-	  if (!caps_has_feature(buddy_resource_getcaps(roster_usr->data, thisres->data), ns[indexns]))
-	    found = FALSE;
-	}
-	if (!found) continue;
+	   if (!caps_has_feature(buddy_resource_getcaps(roster_usr->data, thisres->data), ns[indexns]))
+	     found = FALSE;
+	 }
+	 if (!found) continue;
 
     choosenres = g_strdup(thisres->data);
     g_slist_foreach(reslist, (GFunc)g_free, NULL);
     g_slist_free(reslist);
     return choosenres;
   }
+  return NULL;
 }
 
 /**