Implemented roster grouped by presence
This commit is contained in:
@@ -265,6 +265,26 @@ roster_barejid_from_name(const char * const name)
|
||||
return g_hash_table_lookup(name_to_barejid, name);
|
||||
}
|
||||
|
||||
GSList *
|
||||
roster_get_contacts_by_presence(const char * const presence)
|
||||
{
|
||||
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)) {
|
||||
PContact contact = (PContact)value;
|
||||
if (g_strcmp0(p_contact_presence(contact), presence) == 0) {
|
||||
result = g_slist_insert_sorted(result, value, (GCompareFunc)_compare_contacts);
|
||||
}
|
||||
}
|
||||
|
||||
// resturn all contact structs
|
||||
return result;
|
||||
}
|
||||
|
||||
GSList *
|
||||
roster_get_contacts(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user