mcabber/src/jabglue.c
changeset 1363 32077249de77
parent 1355 9716cf8a0726
child 1365 c7e709719c43
equal deleted inserted replaced
1362:9ee58f91d19e 1363:32077249de77
  1349   }
  1349   }
  1350 
  1350 
  1351   jab_send(jc, x);
  1351   jab_send(jc, x);
  1352   xmlnode_free(x);
  1352   xmlnode_free(x);
  1353   jb_reset_keepalive();
  1353   jb_reset_keepalive();
       
  1354 }
       
  1355 
       
  1356 //  jb_is_bookmarked()
       
  1357 // Return TRUE if there's a bookmark for the given jid.
       
  1358 guint jb_is_bookmarked(const char *bjid)
       
  1359 {
       
  1360   xmlnode x;
       
  1361 
       
  1362   if (!bookmarks)
       
  1363     return FALSE;
       
  1364 
       
  1365   // Walk through the storage bookmark tags
       
  1366   x = xmlnode_get_firstchild(bookmarks);
       
  1367   for ( ; x; x = xmlnode_get_nextsibling(x)) {
       
  1368     const char *fjid;
       
  1369     const char *p;
       
  1370     p = xmlnode_get_name(x);
       
  1371     // If the node is a conference item, check the jid.
       
  1372     if (p && !strcmp(p, "conference")) {
       
  1373       fjid = xmlnode_get_attrib(x, "jid");
       
  1374       if (fjid && !strcasecmp(bjid, fjid))
       
  1375         return TRUE;
       
  1376     }
       
  1377   }
       
  1378   return FALSE;
  1354 }
  1379 }
  1355 
  1380 
  1356 //  jb_get_all_storage_bookmarks()
  1381 //  jb_get_all_storage_bookmarks()
  1357 // Return a GSList with all storage bookmarks.
  1382 // Return a GSList with all storage bookmarks.
  1358 // The caller should g_free the list (not the MUC jids).
  1383 // The caller should g_free the list (not the MUC jids).