about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/roster_list.c17
-rw-r--r--src/roster_list.h1
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);