about summary refs log tree commit diff stats
path: root/src/roster_list.c
diff options
context:
space:
mode:
authorWill Song <incertia9474@gmail.com>2014-11-23 01:33:23 -0600
committerWill Song <incertia9474@gmail.com>2014-11-23 01:33:23 -0600
commit0f2035e4adc361b7f850adbbe82f6edea7f18d8b (patch)
tree0a87a485dc52397eff1bdffaad5de18e268ca156 /src/roster_list.c
parentf486b5884b79cb3ed0d7c4e732b56e73e9236a77 (diff)
downloadprofani-tty-0f2035e4adc361b7f850adbbe82f6edea7f18d8b.tar.gz
add functions for getting roster list without offline contacts (but not implemented)
Diffstat (limited to 'src/roster_list.c')
-rw-r--r--src/roster_list.c17
1 files changed, 17 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)
 {