diff options
author | James Booth <boothj5@gmail.com> | 2016-01-31 02:33:44 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-01-31 02:33:44 +0000 |
commit | e816b124ee754ba11dfe84710b478388651defdc (patch) | |
tree | 65f8264b88e66a8fa4a3e45a9ecb3b0107c575cc /src | |
parent | 369aa5e8a867e3d75f102fb1a7050ccc2a071a8b (diff) | |
download | profani-tty-e816b124ee754ba11dfe84710b478388651defdc.tar.gz |
Removed unused arg from roster_get_ functions
Diffstat (limited to 'src')
-rw-r--r-- | src/command/commands.c | 12 | ||||
-rw-r--r-- | src/roster_list.c | 16 | ||||
-rw-r--r-- | src/roster_list.h | 4 | ||||
-rw-r--r-- | src/ui/console.c | 2 | ||||
-rw-r--r-- | src/ui/rosterwin.c | 8 |
5 files changed, 15 insertions, 27 deletions
diff --git a/src/command/commands.c b/src/command/commands.c index 9447f648..cdbce0f8 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -887,7 +887,7 @@ cmd_export(ProfWin *window, const char *const command, gchar **args) if (-1 == write(fd, "jid,name\n", strlen("jid,name\n"))) goto write_error; - list = roster_get_contacts(ROSTER_ORD_NAME, TRUE); + list = roster_get_contacts(ROSTER_ORD_NAME); if (list) { GSList *curr = list; while (curr){ @@ -1623,13 +1623,13 @@ _who_roster(ProfWin *window, const char *const command, gchar **args) cons_show(""); GSList *list = NULL; if (group) { - list = roster_get_group(group, ROSTER_ORD_NAME, TRUE); + list = roster_get_group(group, ROSTER_ORD_NAME); if (list == NULL) { cons_show("No such group: %s.", group); return; } } else { - list = roster_get_contacts(ROSTER_ORD_NAME, TRUE); + list = roster_get_contacts(ROSTER_ORD_NAME); if (list == NULL) { cons_show("No contacts in roster."); return; @@ -1931,7 +1931,7 @@ cmd_group(ProfWin *window, const char *const command, gchar **args) return TRUE; } - GSList *list = roster_get_group(group, ROSTER_ORD_NAME, TRUE); + GSList *list = roster_get_group(group, ROSTER_ORD_NAME); cons_show_roster_group(group, list); return TRUE; } @@ -2014,7 +2014,7 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args) return TRUE; } - GSList *list = roster_get_contacts(ROSTER_ORD_NAME, TRUE); + GSList *list = roster_get_contacts(ROSTER_ORD_NAME); cons_show_roster(list); g_slist_free(list); return TRUE; @@ -2591,7 +2591,7 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args) return TRUE; } - GSList *all = roster_get_contacts(ROSTER_ORD_NAME, TRUE); + GSList *all = roster_get_contacts(ROSTER_ORD_NAME); GSList *curr = all; while (curr) { PContact contact = curr->data; diff --git a/src/roster_list.c b/src/roster_list.c index be99112e..7eb613ac 100644 --- a/src/roster_list.c +++ b/src/roster_list.c @@ -406,7 +406,7 @@ roster_get_contacts_by_presence(const char *const presence) } GSList* -roster_get_contacts(roster_ord_t order, gboolean include_offline) +roster_get_contacts(roster_ord_t order) { assert(roster != NULL); @@ -424,12 +424,6 @@ roster_get_contacts(roster_ord_t order, gboolean include_offline) 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; - } - result = g_slist_insert_sorted(result, value, cmp_func); } @@ -494,7 +488,7 @@ roster_fulljid_autocomplete(const char *const search_str) } 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) { assert(roster != NULL); @@ -512,12 +506,6 @@ roster_get_group(const char *const group, roster_ord_t order, gboolean include_o 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 (group == NULL) { if (groups == NULL) { diff --git a/src/roster_list.h b/src/roster_list.h index 1b35febd..6ff9c391 100644 --- a/src/roster_list.h +++ b/src/roster_list.h @@ -59,12 +59,12 @@ void roster_update(const char *const barejid, const char *const name, GSList *gr gboolean roster_add(const char *const barejid, const char *const name, GSList *groups, const char *const subscription, gboolean pending_out); char* roster_barejid_from_name(const char *const name); -GSList* roster_get_contacts(roster_ord_t order, gboolean include_offline); +GSList* roster_get_contacts(roster_ord_t order); GSList* roster_get_contacts_online(void); gboolean roster_has_pending_subscriptions(void); char* roster_contact_autocomplete(const char *const search_str); char* roster_fulljid_autocomplete(const char *const search_str); -GSList* roster_get_group(const char *const group, roster_ord_t order, gboolean include_offline); +GSList* roster_get_group(const char *const group, roster_ord_t order); GSList* roster_get_groups(void); char* roster_group_autocomplete(const char *const search_str); char* roster_barejid_autocomplete(const char *const search_str); diff --git a/src/ui/console.c b/src/ui/console.c index f2c1f35b..7f80a227 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -621,7 +621,7 @@ void cons_show_sent_subs(void) { if (roster_has_pending_subscriptions()) { - GSList *contacts = roster_get_contacts(ROSTER_ORD_NAME, TRUE); + GSList *contacts = roster_get_contacts(ROSTER_ORD_NAME); PContact contact = NULL; cons_show("Awaiting subscription responses from:"); GSList *curr = contacts; diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c index bf05b14b..385911b9 100644 --- a/src/ui/rosterwin.c +++ b/src/ui/rosterwin.c @@ -137,9 +137,9 @@ _rosterwin_contacts_all(ProfLayoutSplit *layout, gboolean newline) char *order = prefs_get_string(PREF_ROSTER_ORDER); if (g_strcmp0(order, "presence") == 0) { - contacts = roster_get_contacts(ROSTER_ORD_PRESENCE, TRUE); + contacts = roster_get_contacts(ROSTER_ORD_PRESENCE); } else { - contacts = roster_get_contacts(ROSTER_ORD_NAME, TRUE); + contacts = roster_get_contacts(ROSTER_ORD_NAME); } prefs_free_string(order); @@ -189,9 +189,9 @@ _rosterwin_contacts_by_group(ProfLayoutSplit *layout, char *group, gboolean newl char *order = prefs_get_string(PREF_ROSTER_ORDER); if (g_strcmp0(order, "presence") == 0) { - contacts = roster_get_group(group, ROSTER_ORD_PRESENCE, TRUE); + contacts = roster_get_group(group, ROSTER_ORD_PRESENCE); } else { - contacts = roster_get_group(group, ROSTER_ORD_NAME, TRUE); + contacts = roster_get_group(group, ROSTER_ORD_NAME); } prefs_free_string(order); |