comparison plugins/ticker/ticker.c @ 5185:dec87634bcb1

[gaim-migrate @ 5549] fix some ticker stuff. i'm about sick of the ticker now. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 20 Apr 2003 19:37:06 +0000
parents 82b3d72d2128
children a107115a13ae
comparison
equal deleted inserted replaced
5184:4dbaa8772781 5185:dec87634bcb1
194 buddy_ticker_add_buddy(b); 194 buddy_ticker_add_buddy(b);
195 } 195 }
196 196
197 void signoff_cb(struct gaim_connection *gc) { 197 void signoff_cb(struct gaim_connection *gc) {
198 if (!connections) { 198 if (!connections) {
199 while(tickerbuds) {
200 g_free(tickerbuds->data);
201 tickerbuds = g_list_delete_link(tickerbuds, tickerbuds);
202 }
199 gtk_widget_destroy(tickerwindow); 203 gtk_widget_destroy(tickerwindow);
200 tickerwindow = NULL; 204 tickerwindow = NULL;
201 ticker = NULL; 205 ticker = NULL;
206 } else {
207 GList *t = tickerbuds;
208 while(t) {
209 TickerData *td = t->data;
210 t = t->next;
211 if(td->buddy->account == gc->account) {
212 g_free(td);
213 tickerbuds = g_list_remove(tickerbuds, td);
214 }
215 }
202 } 216 }
203 } 217 }
204 218
205 void buddy_signoff_cb(struct gaim_connection *gc, char *who) { 219 void buddy_signoff_cb(struct gaim_connection *gc, char *who) {
206 struct buddy *b = gaim_find_buddy(gc->account, who); 220 struct buddy *b = gaim_find_buddy(gc->account, who);
207 221
208 buddy_ticker_remove_buddy(b); 222 buddy_ticker_remove_buddy(b);
223 if(!tickerbuds)
224 gtk_widget_hide(tickerwindow);
209 } 225 }
210 226
211 void away_cb(struct gaim_connection *gc, char *who) { 227 void away_cb(struct gaim_connection *gc, char *who) {
212 struct buddy *b = gaim_find_buddy(gc->account, who); 228 struct buddy *b = gaim_find_buddy(gc->account, who);
213 if(buddy_ticker_find_buddy(b)) 229 if(buddy_ticker_find_buddy(b))
241 buddy_ticker_show(); 257 buddy_ticker_show();
242 return NULL; 258 return NULL;
243 } 259 }
244 260
245 G_MODULE_EXPORT void gaim_plugin_remove() { 261 G_MODULE_EXPORT void gaim_plugin_remove() {
262 while(tickerbuds) {
263 g_free(tickerbuds->data);
264 g_list_delete_link(tickerbuds, tickerbuds);
265 }
246 gtk_widget_destroy(tickerwindow); 266 gtk_widget_destroy(tickerwindow);
247 } 267 }
248 268
249 struct gaim_plugin_description desc; 269 struct gaim_plugin_description desc;
250 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() { 270 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() {