Mercurial > ~mikael > mcabber > hg
diff mcabber/src/roster.c @ 792:89ad7b530b3c
MUC: Fix completion for UTF-8 nicknames
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 07 Apr 2006 19:58:56 +0200 |
parents | 25022410f80f |
children | c2d7d9dd4193 |
line wrap: on
line diff
--- a/mcabber/src/roster.c Fri Apr 07 19:40:03 2006 +0200 +++ b/mcabber/src/roster.c Fri Apr 07 19:58:56 2006 +0200 @@ -1028,6 +1028,26 @@ return reslist; } +// buddy_getresources_locale(roster_data) +// Same as buddy_getresources() but names are converted to user's locale +// Note: the caller should free the list (and data) after use +GSList *buddy_getresources_locale(gpointer rosterdata) +{ + GSList *reslist, *lp; + + reslist = buddy_getresources(rosterdata); + // Convert each item to UI's locale + for (lp = reslist; lp; lp = g_slist_next(lp)) { + gchar *oldname = lp->data; + lp->data = from_utf8(oldname); + if (lp->data) + g_free(oldname); + else + lp->data = oldname; + } + return reslist; +} + /* // buddy_isresource(roster_data) // Return true if there is at least one resource