diff options
author | James Booth <boothj5@gmail.com> | 2016-01-30 22:39:08 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-01-30 22:39:08 +0000 |
commit | 2092273474b269c3f5efbf30261dbe656b4a0c0f (patch) | |
tree | ef6d4bc0119888e891258f0d84f6af0521d4502e /src/roster_list.c | |
parent | 7c4a63f3c2dd4ada51dedae8ec143ef48338d8de (diff) | |
download | profani-tty-2092273474b269c3f5efbf30261dbe656b4a0c0f.tar.gz |
Removed _rosterwin_contacts_by_no_group function
Diffstat (limited to 'src/roster_list.c')
-rw-r--r-- | src/roster_list.c | 49 |
1 files changed, 10 insertions, 39 deletions
diff --git a/src/roster_list.c b/src/roster_list.c index f80f47cd..be99112e 100644 --- a/src/roster_list.c +++ b/src/roster_list.c @@ -494,41 +494,6 @@ roster_fulljid_autocomplete(const char *const search_str) } GSList* -roster_get_nogroup(roster_ord_t order, gboolean include_offline) -{ - assert(roster != NULL); - - GSList *result = NULL; - GHashTableIter iter; - gpointer key; - gpointer value; - - GCompareFunc cmp_func; - if (order == ROSTER_ORD_PRESENCE) { - cmp_func = (GCompareFunc) _compare_presence; - } else { - cmp_func = (GCompareFunc) _compare_name; - } - - g_hash_table_iter_init(&iter, roster->contacts); - while (g_hash_table_iter_next(&iter, &key, &value)) { - PContact contact = value; - const char *presence = p_contact_presence(contact); - if (!include_offline && (g_strcmp0(presence, "offline") == 0)) { - continue; - } - - GSList *groups = p_contact_groups(value); - if (groups == NULL) { - result = g_slist_insert_sorted(result, value, cmp_func); - } - } - - // return all contact structs - return result; -} - -GSList* roster_get_group(const char *const group, roster_ord_t order, gboolean include_offline) { assert(roster != NULL); @@ -554,12 +519,18 @@ roster_get_group(const char *const group, roster_ord_t order, gboolean include_o } GSList *groups = p_contact_groups(value); - while (groups) { - if (strcmp(groups->data, group) == 0) { + if (group == NULL) { + if (groups == NULL) { result = g_slist_insert_sorted(result, value, cmp_func); - break; } - groups = g_slist_next(groups); + } else { + while (groups) { + if (strcmp(groups->data, group) == 0) { + result = g_slist_insert_sorted(result, value, cmp_func); + break; + } + groups = g_slist_next(groups); + } } } |