Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/jabglue.c @ 1163:2913310a7be6
Make /roster bookmark in the status buffer show all bookmarks
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 17 Feb 2007 11:25:41 +0100 |
parents | 45d3b9dda43d |
children | 683d64f2c055 |
comparison
equal
deleted
inserted
replaced
1162:39b20ea22ce9 | 1163:2913310a7be6 |
---|---|
1265 } | 1265 } |
1266 | 1266 |
1267 jab_send(jc, x); | 1267 jab_send(jc, x); |
1268 xmlnode_free(x); | 1268 xmlnode_free(x); |
1269 jb_reset_keepalive(); | 1269 jb_reset_keepalive(); |
1270 } | |
1271 | |
1272 // jb_get_all_storage_bookmarks() | |
1273 // Return a GSList with all storage bookmarks. | |
1274 // The caller should g_free the list (not the MUC jids). | |
1275 GSList *jb_get_all_storage_bookmarks(void) | |
1276 { | |
1277 xmlnode x; | |
1278 GSList *sl_bookmarks = NULL; | |
1279 | |
1280 // If we have no bookmarks, probably the server doesn't support them. | |
1281 if (!bookmarks) | |
1282 return NULL; | |
1283 | |
1284 // Walk through the storage bookmark tags | |
1285 x = xmlnode_get_firstchild(bookmarks); | |
1286 for ( ; x; x = xmlnode_get_nextsibling(x)) { | |
1287 const char *fjid; | |
1288 const char *p; | |
1289 p = xmlnode_get_name(x); | |
1290 // If the node is a conference item, let's add the note to our list. | |
1291 if (p && !strcmp(p, "conference")) { | |
1292 fjid = xmlnode_get_attrib(x, "jid"); | |
1293 if (!fjid) | |
1294 continue; | |
1295 sl_bookmarks = g_slist_append(sl_bookmarks, fjid); | |
1296 } | |
1297 } | |
1298 return sl_bookmarks; | |
1270 } | 1299 } |
1271 | 1300 |
1272 // jb_set_storage_bookmark(roomid, name, nick, passwd, autojoin) | 1301 // jb_set_storage_bookmark(roomid, name, nick, passwd, autojoin) |
1273 // Update the private storage bookmarks: add a conference room. | 1302 // Update the private storage bookmarks: add a conference room. |
1274 // If name is nil, we remove the bookmark. | 1303 // If name is nil, we remove the bookmark. |