diff options
author | Will Song <incertia9474@gmail.com> | 2014-11-23 01:33:23 -0600 |
---|---|---|
committer | Will Song <incertia9474@gmail.com> | 2014-11-23 01:33:23 -0600 |
commit | 0f2035e4adc361b7f850adbbe82f6edea7f18d8b (patch) | |
tree | 0a87a485dc52397eff1bdffaad5de18e268ca156 | |
parent | f486b5884b79cb3ed0d7c4e732b56e73e9236a77 (diff) | |
download | profani-tty-0f2035e4adc361b7f850adbbe82f6edea7f18d8b.tar.gz |
add functions for getting roster list without offline contacts (but not implemented)
-rw-r--r-- | src/roster_list.c | 17 | ||||
-rw-r--r-- | src/roster_list.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/roster_list.c b/src/roster_list.c index 941b6321..792d804c 100644 --- a/src/roster_list.c +++ b/src/roster_list.c @@ -307,6 +307,23 @@ roster_get_contacts(void) return result; } +GSList * +roster_get_contacts_nooffline(void) +{ + GSList *result = NULL; + GHashTableIter iter; + gpointer key; + gpointer value; + + g_hash_table_iter_init(&iter, contacts); + while (g_hash_table_iter_next(&iter, &key, &value)) { + result = g_slist_insert_sorted(result, value, (GCompareFunc)_compare_contacts); + } + + // resturn all contact structs + return result; +} + gboolean roster_has_pending_subscriptions(void) { diff --git a/src/roster_list.h b/src/roster_list.h index 13b0bac7..c3ef44cb 100644 --- a/src/roster_list.h +++ b/src/roster_list.h @@ -57,6 +57,7 @@ gboolean roster_add(const char * const barejid, const char * const name, GSList const char * const subscription, gboolean pending_out); char * roster_barejid_from_name(const char * const name); GSList * roster_get_contacts(void); +GSList * roster_get_contacts_nooffline(void); gboolean roster_has_pending_subscriptions(void); char * roster_contact_autocomplete(char *search_str); char * roster_fulljid_autocomplete(char *search_str); |