Mercurial > ~mikael > mcabber > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
791:6c9e8fb69965 | 792:89ad7b530b3c |
---|---|
1026 reslist = g_slist_append(reslist, g_strdup(((res*)lp->data)->name)); | 1026 reslist = g_slist_append(reslist, g_strdup(((res*)lp->data)->name)); |
1027 | 1027 |
1028 return reslist; | 1028 return reslist; |
1029 } | 1029 } |
1030 | 1030 |
1031 // buddy_getresources_locale(roster_data) | |
1032 // Same as buddy_getresources() but names are converted to user's locale | |
1033 // Note: the caller should free the list (and data) after use | |
1034 GSList *buddy_getresources_locale(gpointer rosterdata) | |
1035 { | |
1036 GSList *reslist, *lp; | |
1037 | |
1038 reslist = buddy_getresources(rosterdata); | |
1039 // Convert each item to UI's locale | |
1040 for (lp = reslist; lp; lp = g_slist_next(lp)) { | |
1041 gchar *oldname = lp->data; | |
1042 lp->data = from_utf8(oldname); | |
1043 if (lp->data) | |
1044 g_free(oldname); | |
1045 else | |
1046 lp->data = oldname; | |
1047 } | |
1048 return reslist; | |
1049 } | |
1050 | |
1031 /* | 1051 /* |
1032 // buddy_isresource(roster_data) | 1052 // buddy_isresource(roster_data) |
1033 // Return true if there is at least one resource | 1053 // Return true if there is at least one resource |
1034 // (which means, for a room, that it isn't empty) | 1054 // (which means, for a room, that it isn't empty) |
1035 int buddy_isresource(gpointer rosterdata) | 1055 int buddy_isresource(gpointer rosterdata) |