Mercurial > hg
diff 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 |
line wrap: on
line diff
--- a/mcabber/src/roster.c Fri Oct 21 23:13:54 2005 +0200 +++ b/mcabber/src/roster.c Wed Oct 26 23:46:53 2005 +0200 @@ -841,11 +841,16 @@ // buddy_getresources(roster_data) // Return a singly-linked-list of resource names // Note: the caller should free the list (and data) after use +// If roster_data is null, the current buddy is selected GSList *buddy_getresources(gpointer rosterdata) { roster *roster_usr = rosterdata; GSList *reslist = NULL, *lp; + if (!roster_usr) { + if (!current_buddy) return NULL; + roster_usr = BUDDATA(current_buddy); + } for (lp = roster_usr->resource; lp; lp = g_slist_next(lp)) reslist = g_slist_append(reslist, g_strdup(((res*)lp->data)->name));