1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-02-02 15:08:15 -05:00

add functions for getting roster list without offline contacts (but not implemented)

This commit is contained in:
Will Song 2014-11-23 01:33:23 -06:00
parent f486b5884b
commit 0f2035e4ad
2 changed files with 18 additions and 0 deletions

View File

@ -307,6 +307,23 @@ roster_get_contacts(void)
return result; 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 gboolean
roster_has_pending_subscriptions(void) roster_has_pending_subscriptions(void)
{ {

View File

@ -57,6 +57,7 @@ gboolean roster_add(const char * const barejid, const char * const name, GSList
const char * const subscription, gboolean pending_out); const char * const subscription, gboolean pending_out);
char * roster_barejid_from_name(const char * const name); char * roster_barejid_from_name(const char * const name);
GSList * roster_get_contacts(void); GSList * roster_get_contacts(void);
GSList * roster_get_contacts_nooffline(void);
gboolean roster_has_pending_subscriptions(void); gboolean roster_has_pending_subscriptions(void);
char * roster_contact_autocomplete(char *search_str); char * roster_contact_autocomplete(char *search_str);
char * roster_fulljid_autocomplete(char *search_str); char * roster_fulljid_autocomplete(char *search_str);