comparison mcabber/src/roster.c @ 501:7c1ca00070e8

Add COMPL_RESOURCE (resource completion category)
author Mikael Berthe <mikael@lilotux.net>
date Wed, 26 Oct 2005 23:46:53 +0200
parents 3f5aa4852684
children 74dcd0df532e
comparison
equal deleted inserted replaced
500:357086193b02 501:7c1ca00070e8
839 } 839 }
840 840
841 // buddy_getresources(roster_data) 841 // buddy_getresources(roster_data)
842 // Return a singly-linked-list of resource names 842 // Return a singly-linked-list of resource names
843 // Note: the caller should free the list (and data) after use 843 // Note: the caller should free the list (and data) after use
844 // If roster_data is null, the current buddy is selected
844 GSList *buddy_getresources(gpointer rosterdata) 845 GSList *buddy_getresources(gpointer rosterdata)
845 { 846 {
846 roster *roster_usr = rosterdata; 847 roster *roster_usr = rosterdata;
847 GSList *reslist = NULL, *lp; 848 GSList *reslist = NULL, *lp;
848 849
850 if (!roster_usr) {
851 if (!current_buddy) return NULL;
852 roster_usr = BUDDATA(current_buddy);
853 }
849 for (lp = roster_usr->resource; lp; lp = g_slist_next(lp)) 854 for (lp = roster_usr->resource; lp; lp = g_slist_next(lp))
850 reslist = g_slist_append(reslist, g_strdup(((res*)lp->data)->name)); 855 reslist = g_slist_append(reslist, g_strdup(((res*)lp->data)->name));
851 856
852 return reslist; 857 return reslist;
853 } 858 }