comparison libpurple/protocols/jabber/buddy.c @ 23814:d0ac3c438b71

Check remote JID's capabilities for audio and video XEP support.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sat, 31 May 2008 20:15:34 +0000
parents 903fb6879521
children 3da0957e7821
comparison
equal deleted inserted replaced
23813:de644f7e3958 23814:d0ac3c438b71
2489 _("Cancel"), NULL, 2489 _("Cancel"), NULL,
2490 NULL, NULL, NULL, 2490 NULL, NULL, NULL,
2491 js); 2491 js);
2492 } 2492 }
2493 2493
2494 2494 gboolean
2495 2495 jabber_buddy_has_capability(JabberBuddy *jb, const gchar *cap)
2496 {
2497 JabberBuddyResource *jbr = jabber_buddy_find_resource(jb, NULL);
2498 const GList *iter = NULL;
2499
2500 if (!jbr) {
2501 purple_debug_error("jabber",
2502 "Unable to find caps: buddy might be offline\n");
2503 return FALSE;
2504 }
2505
2506 if (!jbr->caps) {
2507 purple_debug_error("jabber",
2508 "Unable to find caps: nothing known about buddy\n");
2509 return FALSE;
2510 }
2511
2512 for (iter = jbr->caps->features ; iter ; iter = g_list_next(iter)) {
2513 if (strcmp(iter->data, cap) == 0)
2514 return TRUE;
2515 }
2516
2517 return FALSE;
2518 }
2519
2520