Using GSList for contact list

This commit is contained in:
James Booth
2012-05-10 00:30:03 +01:00
parent b2385010b5
commit a336148cd2
6 changed files with 123 additions and 190 deletions

View File

@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <ncurses.h>
#include <glib.h>
#include "windows.h"
#include "util.h"
@@ -294,15 +295,15 @@ void cons_help(void)
dirty = TRUE;
}
void cons_show_online_contacts(struct contact_node_t *list)
void cons_show_online_contacts(GSList *list)
{
_win_show_time(_cons_win);
wprintw(_cons_win, "Online contacts:\n");
struct contact_node_t *curr = list;
GSList *curr = list;
while(curr) {
PContact contact = curr->contact;
PContact contact = curr->data;
_win_show_time(_cons_win);
wattron(_cons_win, COLOR_PAIR(2));
wprintw(_cons_win, "%s", p_contact_name(contact));
@@ -313,7 +314,7 @@ void cons_show_online_contacts(struct contact_node_t *list)
wprintw(_cons_win, "\n");
wattroff(_cons_win, COLOR_PAIR(2));
curr = curr->next;
curr = g_slist_next(curr);
}
}