mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Merge branch 'master' into osx-functional
This commit is contained in:
commit
42b1918ea0
@ -493,41 +493,6 @@ roster_fulljid_autocomplete(const char *const search_str)
|
|||||||
return autocomplete_complete(roster->fulljid_ac, search_str, TRUE);
|
return autocomplete_complete(roster->fulljid_ac, search_str, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
GSList*
|
|
||||||
roster_get_nogroup(roster_ord_t order, gboolean include_offline)
|
|
||||||
{
|
|
||||||
assert(roster != NULL);
|
|
||||||
|
|
||||||
GSList *result = NULL;
|
|
||||||
GHashTableIter iter;
|
|
||||||
gpointer key;
|
|
||||||
gpointer value;
|
|
||||||
|
|
||||||
GCompareFunc cmp_func;
|
|
||||||
if (order == ROSTER_ORD_PRESENCE) {
|
|
||||||
cmp_func = (GCompareFunc) _compare_presence;
|
|
||||||
} else {
|
|
||||||
cmp_func = (GCompareFunc) _compare_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_hash_table_iter_init(&iter, roster->contacts);
|
|
||||||
while (g_hash_table_iter_next(&iter, &key, &value)) {
|
|
||||||
PContact contact = value;
|
|
||||||
const char *presence = p_contact_presence(contact);
|
|
||||||
if (!include_offline && (g_strcmp0(presence, "offline") == 0)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
GSList *groups = p_contact_groups(value);
|
|
||||||
if (groups == NULL) {
|
|
||||||
result = g_slist_insert_sorted(result, value, cmp_func);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// return all contact structs
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
GSList*
|
GSList*
|
||||||
roster_get_group(const char *const group, roster_ord_t order, gboolean include_offline)
|
roster_get_group(const char *const group, roster_ord_t order, gboolean include_offline)
|
||||||
{
|
{
|
||||||
@ -554,12 +519,18 @@ roster_get_group(const char *const group, roster_ord_t order, gboolean include_o
|
|||||||
}
|
}
|
||||||
|
|
||||||
GSList *groups = p_contact_groups(value);
|
GSList *groups = p_contact_groups(value);
|
||||||
while (groups) {
|
if (group == NULL) {
|
||||||
if (strcmp(groups->data, group) == 0) {
|
if (groups == NULL) {
|
||||||
result = g_slist_insert_sorted(result, value, cmp_func);
|
result = g_slist_insert_sorted(result, value, cmp_func);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
groups = g_slist_next(groups);
|
} else {
|
||||||
|
while (groups) {
|
||||||
|
if (strcmp(groups->data, group) == 0) {
|
||||||
|
result = g_slist_insert_sorted(result, value, cmp_func);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
groups = g_slist_next(groups);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ GSList* roster_get_groups(void);
|
|||||||
char* roster_group_autocomplete(const char *const search_str);
|
char* roster_group_autocomplete(const char *const search_str);
|
||||||
char* roster_barejid_autocomplete(const char *const search_str);
|
char* roster_barejid_autocomplete(const char *const search_str);
|
||||||
GSList* roster_get_contacts_by_presence(const char *const presence);
|
GSList* roster_get_contacts_by_presence(const char *const presence);
|
||||||
GSList* roster_get_nogroup(roster_ord_t order, gboolean include_offline);
|
|
||||||
char* roster_get_msg_display_name(const char *const barejid, const char *const resource);
|
char* roster_get_msg_display_name(const char *const barejid, const char *const resource);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -622,7 +622,9 @@ int main(int argc, char* argv[]) {
|
|||||||
unit_test(remove_text_multi_value_removes_when_one),
|
unit_test(remove_text_multi_value_removes_when_one),
|
||||||
unit_test(remove_text_multi_value_removes_when_many),
|
unit_test(remove_text_multi_value_removes_when_many),
|
||||||
|
|
||||||
unit_test(clears_chat_sessions),
|
unit_test_setup_teardown(clears_chat_sessions,
|
||||||
|
load_preferences,
|
||||||
|
close_preferences),
|
||||||
};
|
};
|
||||||
|
|
||||||
return run_tests(all_tests);
|
return run_tests(all_tests);
|
||||||
|
Loading…
Reference in New Issue
Block a user