Mercurial > pidgin
diff plugins/ticker/ticker.c @ 6695:0c5637b5462e
[gaim-migrate @ 7221]
This is contact support. Really.
It has a few bugs left in it, like sorting not working, and stuff like that,
but it's pretty solid for the most part.
I'm not in the mood to do a whole lot of typing, so just use and enjoy.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Tue, 02 Sep 2003 03:41:10 +0000 |
parents | 70d5122bc3ff |
children | abdc55ffadba |
line wrap: on
line diff
--- a/plugins/ticker/ticker.c Tue Sep 02 03:34:37 2003 +0000 +++ b/plugins/ticker/ticker.c Tue Sep 02 03:41:10 2003 +0000 @@ -44,7 +44,7 @@ static GtkWidget *ticker; typedef struct { - struct buddy *buddy; + GaimBuddy *buddy; GtkWidget *ebox; GtkWidget *label; GtkWidget *icon; @@ -86,13 +86,13 @@ } static gboolean buddy_click_cb(GtkWidget *widget, GdkEventButton *event, gpointer user_data) { - struct buddy *b = user_data; + GaimBuddy *b = user_data; gaim_conversation_new(GAIM_CONV_IM, b->account, b->name); return TRUE; } -static TickerData *buddy_ticker_find_buddy(struct buddy *b) { +static TickerData *buddy_ticker_find_buddy(GaimBuddy *b) { GList *tb; for(tb = tickerbuds; tb; tb = tb->next) { TickerData *td = tb->data; @@ -102,7 +102,7 @@ return NULL; } -static void buddy_ticker_set_pixmap(struct buddy *b) { +static void buddy_ticker_set_pixmap(GaimBuddy *b) { TickerData *td = buddy_ticker_find_buddy(b); GdkPixbuf *pixbuf; @@ -128,7 +128,7 @@ return FALSE; } -static void buddy_ticker_add_buddy(struct buddy *b) { +static void buddy_ticker_add_buddy(GaimBuddy *b) { GtkWidget *hbox; TickerData *td; @@ -167,7 +167,7 @@ td->timeout = g_timeout_add(11000, buddy_ticker_set_pixmap_cb, td); } -static void buddy_ticker_remove_buddy(struct buddy *b) { +static void buddy_ticker_remove_buddy(GaimBuddy *b) { TickerData *td = buddy_ticker_find_buddy(b); if (!td) @@ -186,8 +186,8 @@ static void buddy_ticker_show() { struct gaim_buddy_list *list = gaim_get_blist(); - GaimBlistNode *gnode, *bnode; - struct buddy *b; + GaimBlistNode *gnode, *cnode, *bnode; + GaimBuddy *b; if(!list) return; @@ -195,12 +195,16 @@ for(gnode = list->root; gnode; gnode = gnode->next) { if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) continue; - for(bnode = gnode->child; bnode; bnode = bnode->next) { - if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + for(cnode = gnode->child; cnode; cnode = cnode->next) { + if(!GAIM_BLIST_NODE_IS_CONTACT(cnode)) continue; - b = (struct buddy *)bnode; - if(GAIM_BUDDY_IS_ONLINE(b)) - buddy_ticker_add_buddy(b); + for(bnode = cnode->child; bnode; bnode = bnode->next) { + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; + b = (GaimBuddy *)bnode; + if(GAIM_BUDDY_IS_ONLINE(b)) + buddy_ticker_add_buddy(b); + } } } } @@ -236,7 +240,7 @@ } static void -buddy_signon_cb(struct buddy *b) +buddy_signon_cb(GaimBuddy *b) { if(buddy_ticker_find_buddy(b)) buddy_ticker_set_pixmap(b); @@ -245,7 +249,7 @@ } static void -buddy_signoff_cb(struct buddy *b) +buddy_signoff_cb(GaimBuddy *b) { buddy_ticker_remove_buddy(b); if(!tickerbuds) @@ -253,7 +257,7 @@ } static void -away_cb(struct buddy *b) +away_cb(GaimBuddy *b) { if(buddy_ticker_find_buddy(b)) buddy_ticker_set_pixmap(b);