annotate src/ticker.c @ 3346:2b9ea67bdc38

[gaim-migrate @ 3365] lalala committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Wed, 03 Jul 2002 05:52:58 +0000
parents 30ca1b76ad0c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
1 /* GTK - The GIMP Toolkit
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
3 *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
4 * This library is free software; you can redistribute it and/or
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
5 * modify it under the terms of the GNU Library General Public
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
6 * License as published by the Free Software Foundation; either
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
7 * version 2 of the License, or (at your option) any later version.
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
8 *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
9 * This library is distributed in the hope that it will be useful,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
12 * Library General Public License for more details.
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
13 *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
14 * You should have received a copy of the GNU Library General Public
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
15 * License along with this library; if not, write to the
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
17 * Boston, MA 02111-1307, USA.
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
18 */
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
19
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
20 /*
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
21 * ticker.c -- Syd Logan, Summer 2000
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
22 */
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
23
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
24 #include <gtk/gtk.h>
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
25 #include "gtkticker.h"
469
7ac742be351d [gaim-migrate @ 479]
Rob Flynn <gaim@robflynn.com>
parents: 460
diff changeset
26 #include <string.h>
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 469
diff changeset
27 #include <stdlib.h>
955
889e5026fd98 [gaim-migrate @ 965]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
28 #include "gaim.h"
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
29 #include "prpl.h"
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
30 #include "pixmaps/no_icon.xpm"
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
31
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
32 GtkWidget *tickerwindow = NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
33 GtkWidget *ticker;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
34
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
35 typedef struct {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
36 char buddy[ 128 ];
3278
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
37 char alias[ 388 ];
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
38 GtkWidget *hbox;
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
39 GtkWidget *ebox;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
40 GtkWidget *label;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
41 GtkWidget *pix;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
42 } TickerData;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
43
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
44 static GList *tickerbuds = (GList *) NULL;
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
45 static gboolean userclose = FALSE;
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
46 static GtkWidget *msgw;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
47
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
48 void BuddyTickerDestroyWindow( GtkWidget *window );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
49 void BuddyTickerCreateWindow( void );
3278
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
50 void BuddyTickerAddUser( char *name, char *alias, GdkPixmap *pm, GdkBitmap *bm );
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
51 void BuddyTickerRemoveUser( char *name );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
52 void BuddyTickerSetPixmap( char *name, GdkPixmap *pm, GdkBitmap *bm );
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
53 void BuddyTickerClearList( void );
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
54 void BuddyTickerSignOff( void );
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
55 GList * BuddyTickerFindUser( char *name );
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
56 int BuddyTickerMessageRemove( gpointer data );
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 469
diff changeset
57 extern void pressed_ticker(char *);
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
58 void BuddyTickerShow();
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
59
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
60 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
61 BuddyTickerDestroyWindow( GtkWidget *window )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
62 {
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
63 BuddyTickerClearList();
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
64 gtk_ticker_stop_scroll( GTK_TICKER( ticker ) );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
65 gtk_widget_destroy( window );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
66 ticker = tickerwindow = (GtkWidget *) NULL;
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
67 userclose = TRUE;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
68 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
69
3278
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
70 static char *msg = "Welcome to Gaim " VERSION ", brought to you by Rob Flynn (maintainer), Eric Warmenhoven, Mark Spencer, Jeramey Crawford, Jim Duchek, Syd Logan, and Sean Egan";
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
71
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
72 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
73 BuddyTickerCreateWindow()
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
74 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
75 if ( tickerwindow != (GtkWidget *) NULL )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
76 return;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
77 tickerwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
78 gtk_signal_connect (GTK_OBJECT(tickerwindow), "destroy",
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
79 GTK_SIGNAL_FUNC (BuddyTickerDestroyWindow), "WM destroy");
2534
2bc6ee172103 [gaim-migrate @ 2547]
Rob Flynn <gaim@robflynn.com>
parents: 2313
diff changeset
80 gtk_window_set_title (GTK_WINDOW(tickerwindow), "Gaim - Buddy Ticker");
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 604
diff changeset
81 gtk_window_set_wmclass (GTK_WINDOW(tickerwindow),
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 604
diff changeset
82 "ticker", "Gaim");
2547
ab55ac6234b8 [gaim-migrate @ 2560]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2534
diff changeset
83 gtk_widget_realize(tickerwindow);
ab55ac6234b8 [gaim-migrate @ 2560]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2534
diff changeset
84 aol_icon(tickerwindow->window);
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
85
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
86 ticker = gtk_ticker_new();
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
87 gtk_ticker_set_spacing( GTK_TICKER( ticker ), 20 );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
88 gtk_widget_set_usize( ticker, 500, -1 );
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
89 gtk_container_add( GTK_CONTAINER( tickerwindow ), ticker );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
90 gtk_ticker_set_interval( GTK_TICKER( ticker ), 500 );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
91 gtk_ticker_set_scootch( GTK_TICKER( ticker ), 10 );
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
92 msgw = gtk_label_new( msg );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
93 gtk_ticker_add( GTK_TICKER( ticker ), msgw );
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
94 gtk_ticker_start_scroll( GTK_TICKER( ticker ) );
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
95
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
96 gtk_timeout_add( 60000, BuddyTickerMessageRemove, (gpointer) NULL );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
97
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
98 gtk_widget_show_all (ticker);
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
99
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
100 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
101
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
102 gint
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
103 ButtonPressCallback( GtkWidget *widget, GdkEvent *event, gpointer callback_data )
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
104 {
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
105 TickerData *p = (TickerData *) callback_data;
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
106
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
107 pressed_ticker( p->buddy );
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 469
diff changeset
108
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 469
diff changeset
109 return TRUE;
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
110 }
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
111
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
112 void
3278
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
113 BuddyTickerAddUser( char *name, char *alias, GdkPixmap *pm, GdkBitmap *bm )
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
114 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
115 TickerData *p;
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
116 GList *q;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
117
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
118 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
119 return;
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
120
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
121 BuddyTickerCreateWindow();
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
122
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
123 q = (GList *) BuddyTickerFindUser( name );
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
124 if ( q != (GList *) NULL )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
125 return;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
126
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
127 p = (TickerData *) malloc( sizeof( TickerData ) );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
128 p->hbox = (GtkWidget *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
129 p->label = (GtkWidget *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
130 p->pix = (GtkWidget *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
131 strcpy( p->buddy, name );
3278
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
132 strcpy( p->alias, alias);
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
133 tickerbuds = g_list_append( tickerbuds, p );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
134
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
135 p->hbox = gtk_hbox_new( FALSE, 0 );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
136 gtk_ticker_add( GTK_TICKER( ticker ), p->hbox );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
137 gtk_widget_show_all( p->hbox );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
138
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
139 BuddyTickerSetPixmap( name, pm, bm );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
140
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
141 p->ebox = gtk_event_box_new();
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
142
1976
24aed1c31342 [gaim-migrate @ 1986]
Rob Flynn <gaim@robflynn.com>
parents: 1750
diff changeset
143 /* click detection */
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
144
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
145 gtk_widget_set_events (p->ebox, GDK_BUTTON_PRESS_MASK);
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
146 gtk_signal_connect (GTK_OBJECT (p->ebox), "button_press_event",
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
147 GTK_SIGNAL_FUNC(ButtonPressCallback), (gpointer) p);
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
148
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
149 gtk_box_pack_start_defaults( GTK_BOX( p->hbox ), p->ebox );
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
150 gtk_widget_show( p->ebox );
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
151
3278
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
152 if (im_options & OPT_IM_ALIAS_TAB)
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
153 p->label = gtk_label_new( alias );
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
154 else
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
155 p->label = gtk_label_new( name );
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
156 gtk_container_add( GTK_CONTAINER(p->ebox), p->label );
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
157
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
158 gtk_widget_show( p->label );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
159
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
160 gtk_widget_show( tickerwindow );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
161 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
162
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
163 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
164 BuddyTickerRemoveUser( char *name )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
165 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
166 GList *p = (GList *) BuddyTickerFindUser( name );
460
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
167 TickerData *data;
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
168
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
169 if ( !p )
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
170 return;
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
171
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
172 data = (TickerData *) p->data;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
173
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
174 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
175 return;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
176 if ( data ) {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
177 gtk_ticker_remove( GTK_TICKER( ticker ), data->hbox );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
178 tickerbuds = g_list_remove( tickerbuds, data );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
179 free( data );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
180 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
181 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
182
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
183 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
184 BuddyTickerSetPixmap( char *name, GdkPixmap *pm, GdkBitmap *bm )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
185 {
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
186 GList *p;
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
187 TickerData *data;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
188
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
189 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
190 return;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
191 p = (GList *) BuddyTickerFindUser( name );
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
192 if ( p )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
193 data = (TickerData *) p->data;
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
194 else
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
195 return;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
196 if ( data->pix == (GtkWidget *) NULL ) {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
197 data->pix = gtk_pixmap_new( pm, bm );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
198 gtk_box_pack_start_defaults( GTK_BOX( data->hbox ), data->pix );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
199 } else {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
200 gtk_widget_hide( data->pix );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
201 gtk_pixmap_set(GTK_PIXMAP(data->pix), pm, bm);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
202 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
203 gtk_widget_show( data->pix );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
204 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
205
3278
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
206 void
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
207 BuddyTickerSetAlias( char *name, char *alias) {
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
208 GList *p;
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
209 TickerData *data;
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
210
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
211 if ( userclose == TRUE )
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
212 return;
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
213 p = (GList *) BuddyTickerFindUser( name );
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
214 if ( p )
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
215 data = (TickerData *) p->data;
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
216 else
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
217 return;
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
218 if (alias) {
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
219 g_snprintf(data->alias, sizeof(data->alias), alias);
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
220
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
221 if (im_options & OPT_IM_ALIAS_TAB)
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
222 gtk_label_set_text(GTK_LABEL(data->label), alias);
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
223 }
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
224 }
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
225
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
226 GList *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
227 BuddyTickerFindUser( char *name )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
228 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
229 GList *p = tickerbuds;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
230
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
231 while ( p ) {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
232 TickerData *q = (TickerData *) p->data;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
233 if ( !strcmp( name, q->buddy ) )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
234 return( p );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
235 p = p->next;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
236 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
237 return (GList *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
238 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
239
3278
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
240 void
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
241 BuddyTickerSetNames()
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
242 {
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
243 GList *p = tickerbuds;
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
244 while ( p ) {
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
245 TickerData *q = (TickerData *) p->data;
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
246 if (im_options & OPT_IM_ALIAS_TAB)
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
247 gtk_label_set_text(GTK_LABEL(q->label), q->alias);
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
248 else
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
249 gtk_label_set_text(GTK_LABEL(q->label), q->buddy);
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
250 p = p->next;
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
251 }
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
252 }
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
253
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
254 int
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
255 BuddyTickerMessageRemove( gpointer data )
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
256 {
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
257 if ( userclose == TRUE )
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 469
diff changeset
258 return FALSE;
1425
3e6a17ae51e8 [gaim-migrate @ 1435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 955
diff changeset
259 if ( tickerwindow == NULL )
3e6a17ae51e8 [gaim-migrate @ 1435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 955
diff changeset
260 return FALSE;
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
261 gtk_ticker_remove( GTK_TICKER( ticker ), msgw );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
262 return FALSE;
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
263 }
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
264
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
265 int
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
266 BuddyTickerLogonTimeout( gpointer data )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
267 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
268 return FALSE;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
269 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
270
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
271 int
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
272 BuddyTickerLogoutTimeout( gpointer data )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
273 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
274 char *name = (char *) data;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
275
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
276 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
277 return FALSE;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
278 BuddyTickerRemoveUser( name );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
279
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
280 return FALSE;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
281 }
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
282
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
283 void
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
284 BuddyTickerSignoff( void )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
285 {
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
286 GList *p = tickerbuds;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
287 TickerData *q;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
288
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
289 while ( p ) {
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
290 q = (TickerData *) p->data;
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
291 if ( q )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
292 BuddyTickerRemoveUser( q->buddy );
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
293 p = tickerbuds;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
294 }
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
295 userclose = FALSE;
1425
3e6a17ae51e8 [gaim-migrate @ 1435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 955
diff changeset
296 if ( tickerwindow )
3e6a17ae51e8 [gaim-migrate @ 1435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 955
diff changeset
297 gtk_widget_hide( tickerwindow );
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
298 }
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
299
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
300 void
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
301 BuddyTickerClearList( void )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
302 {
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
303 GList *p = tickerbuds;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
304
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
305 while ( p )
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
306 p = g_list_remove( p, p->data );
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
307 tickerbuds = (GList *) NULL;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
308 }
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
309
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
310 void BuddyTickerShow()
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
311 {
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
312 GdkPixmap *pm;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
313 GdkBitmap *bm;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
314 struct gaim_connection *gc;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
315 struct group *g;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
316 struct buddy *b;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
317 GSList *gcons, *grps, *buds;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
318 char **xpm;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
319
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1976
diff changeset
320 if( !(misc_options & OPT_MISC_BUDDY_TICKER) ) {
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
321 BuddyTickerSignoff();
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1976
diff changeset
322 misc_options &= ~OPT_MISC_BUDDY_TICKER;
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
323 return;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
324 }
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
325
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
326 for( gcons = connections; gcons; gcons = gcons->next ) {
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
327 gc = (struct gaim_connection *)gcons->data;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
328 for( grps = gc->groups; grps; grps = grps->next ) {
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
329 g = (struct group *)grps->data;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
330 for( buds = g->members; buds; buds = buds->next ) {
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
331 b = (struct buddy *)buds->data;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
332 if( b->present ) {
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
333 xpm = NULL;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
334 if (gc->prpl->list_icon)
2662
b0c5770156e1 [gaim-migrate @ 2675]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2547
diff changeset
335 xpm = gc->prpl->list_icon(b->uc);
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
336 if (xpm == NULL)
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
337 xpm = (char **)no_icon_xpm;
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
338 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, NULL, xpm);
3278
30ca1b76ad0c [gaim-migrate @ 3296]
Sean Egan <seanegan@gmail.com>
parents: 2662
diff changeset
339 BuddyTickerAddUser( b->name, b->show, pm, bm );
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
340 }
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
341 }
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
342 }
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
343 }
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1425
diff changeset
344 }