Mercurial > pidgin
annotate finch/plugins/gntgf.c @ 20829:3d0e4616eb39
Fix a leak when a bonjour account is disconnected.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 08 Oct 2007 14:25:54 +0000 |
parents | 44b4e8bd759b |
children | 3cc856ca2338 |
rev | line source |
---|---|
15817 | 1 /** |
2 * @file gntgf.c Minimal toaster plugin in Gnt. | |
3 * | |
4 * Copyright (C) 2006 Sadrul Habib Chowdhury <sadrul@users.sourceforge.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17124
diff
changeset
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15817 | 19 */ |
20 | |
21 | |
22 #include "internal.h" | |
23 | |
24 #define PLUGIN_STATIC_NAME "GntGf" | |
25 | |
26 #define PREFS_PREFIX "/plugins/gnt/gntgf" | |
27 #define PREFS_EVENT PREFS_PREFIX "/events" | |
28 #define PREFS_EVENT_SIGNONF PREFS_EVENT "/signonf" | |
29 #define PREFS_EVENT_IM_MSG PREFS_EVENT "/immsg" | |
30 #define PREFS_EVENT_CHAT_MSG PREFS_EVENT "/chatmsg" | |
31 #define PREFS_EVENT_CHAT_NICK PREFS_EVENT "/chatnick" | |
32 #define PREFS_BEEP PREFS_PREFIX "/beep" | |
33 | |
34 #define MAX_COLS 3 | |
35 | |
36 #ifdef HAVE_X11 | |
37 #define PREFS_URGENT PREFS_PREFIX "/urgent" | |
38 | |
39 #include <X11/Xlib.h> | |
40 #include <X11/Xutil.h> | |
41 #endif | |
42 | |
43 #include <glib.h> | |
44 | |
45 #include <plugin.h> | |
46 #include <version.h> | |
47 #include <blist.h> | |
48 #include <conversation.h> | |
49 #include <debug.h> | |
50 #include <util.h> | |
51 | |
52 #include <gnt.h> | |
53 #include <gntbox.h> | |
54 #include <gntbutton.h> | |
55 #include <gntcheckbox.h> | |
56 #include <gntlabel.h> | |
57 #include <gnttree.h> | |
58 | |
17124
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
59 #include "gntplugin.h" |
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
60 #include "gntconv.h" |
15817 | 61 |
62 typedef struct | |
63 { | |
64 GntWidget *window; | |
65 int timer; | |
66 int column; | |
67 } GntToast; | |
68 | |
69 static GList *toasters; | |
70 static int gpsy[MAX_COLS]; | |
71 static int gpsw[MAX_COLS]; | |
72 | |
73 static void | |
74 destroy_toaster(GntToast *toast) | |
75 { | |
76 toasters = g_list_remove(toasters, toast); | |
77 gnt_widget_destroy(toast->window); | |
78 g_source_remove(toast->timer); | |
79 g_free(toast); | |
80 } | |
81 | |
82 static gboolean | |
83 remove_toaster(GntToast *toast) | |
84 { | |
85 GList *iter; | |
86 int h; | |
87 int col; | |
88 int nwin[MAX_COLS]; | |
89 | |
90 gnt_widget_get_size(toast->window, NULL, &h); | |
91 gpsy[toast->column] -= h; | |
92 col = toast->column; | |
93 | |
94 memset(&nwin, 0, sizeof(nwin)); | |
95 destroy_toaster(toast); | |
96 | |
97 for (iter = toasters; iter; iter = iter->next) | |
98 { | |
99 int x, y; | |
100 toast = iter->data; | |
101 nwin[toast->column]++; | |
102 if (toast->column != col) continue; | |
103 gnt_widget_get_position(toast->window, &x, &y); | |
104 y += h; | |
105 gnt_screen_move_widget(toast->window, x, y); | |
106 } | |
107 | |
108 if (nwin[col] == 0) | |
109 gpsw[col] = 0; | |
110 | |
111 return FALSE; | |
112 } | |
113 | |
114 #ifdef HAVE_X11 | |
16320
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
115 static int |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
116 error_handler(Display *dpy, XErrorEvent *error) |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
117 { |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
118 char buffer[1024]; |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
119 XGetErrorText(dpy, error->error_code, buffer, sizeof(buffer)); |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
120 purple_debug_error("gntgf", "Could not set urgent to the window: %s.\n", buffer); |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
121 return 0; |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
122 } |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
123 |
15817 | 124 static void |
125 urgent() | |
126 { | |
127 /* This is from deryni/tuomov's urgent_test.c */ | |
128 Display *dpy; | |
129 Window id; | |
130 const char *ids; | |
131 XWMHints *hints; | |
132 | |
133 ids = getenv("WINDOWID"); | |
134 if (ids == NULL) | |
135 return; | |
136 | |
137 id = atoi(ids); | |
138 | |
139 dpy = XOpenDisplay(NULL); | |
140 if (dpy == NULL) | |
141 return; | |
142 | |
16320
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
143 XSetErrorHandler(error_handler); |
15817 | 144 hints = XGetWMHints(dpy, id); |
16320
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
145 if (hints) { |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
146 hints->flags|=XUrgencyHint; |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
147 XSetWMHints(dpy, id, hints); |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
148 XFree(hints); |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
149 } |
94843d812e69
Gracefully do nothing if the WINDOWID is invalid. And plug a leak, thanks to deryni.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15863
diff
changeset
|
150 XSetErrorHandler(NULL); |
15817 | 151 |
152 XFlush(dpy); | |
153 XCloseDisplay(dpy); | |
154 } | |
155 #endif | |
156 | |
157 static void | |
17124
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
158 notify(PurpleConversation *conv, const char *fmt, ...) |
15817 | 159 { |
160 GntWidget *window; | |
161 GntToast *toast; | |
162 char *str; | |
163 int h, w, i; | |
164 va_list args; | |
165 | |
15822 | 166 if (purple_prefs_get_bool(PREFS_BEEP)) |
15817 | 167 beep(); |
17124
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
168 |
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
169 if (conv != NULL) { |
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
170 FinchConv *fc = conv->ui_data; |
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
171 if (gnt_widget_has_focus(fc->window)) |
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
172 return; |
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
173 } |
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
174 |
15817 | 175 #ifdef HAVE_X11 |
15822 | 176 if (purple_prefs_get_bool(PREFS_URGENT)) |
15817 | 177 urgent(); |
178 #endif | |
179 | |
180 window = gnt_vbox_new(FALSE); | |
181 GNT_WIDGET_SET_FLAGS(window, GNT_WIDGET_TRANSIENT); | |
182 GNT_WIDGET_UNSET_FLAGS(window, GNT_WIDGET_NO_BORDER); | |
183 | |
184 va_start(args, fmt); | |
185 str = g_strdup_vprintf(fmt, args); | |
186 va_end(args); | |
187 | |
188 gnt_box_add_widget(GNT_BOX(window), | |
189 gnt_label_new_with_format(str, GNT_TEXT_FLAG_HIGHLIGHT)); | |
190 | |
191 g_free(str); | |
192 gnt_widget_size_request(window); | |
193 gnt_widget_get_size(window, &w, &h); | |
194 for (i = 0; i < MAX_COLS && gpsy[i] + h >= getmaxy(stdscr) ; ++i) | |
195 ; | |
196 if (i >= MAX_COLS) { | |
15822 | 197 purple_debug_warning("GntGf", "Dude, that's way too many popups\n"); |
15817 | 198 gnt_widget_destroy(window); |
199 return; | |
200 } | |
201 | |
202 toast = g_new0(GntToast, 1); | |
203 toast->window = window; | |
204 toast->column = i; | |
205 gpsy[i] += h; | |
206 if (w > gpsw[i]) { | |
207 if (i == 0) | |
208 gpsw[i] = w; | |
209 else | |
210 gpsw[i] = gpsw[i - 1] + w + 1; | |
211 } | |
212 | |
213 if (i == 0 || (w + gpsw[i - 1] >= getmaxx(stdscr))) { | |
214 /* if it's going to be too far left, overlap. */ | |
215 gnt_widget_set_position(window, getmaxx(stdscr) - w - 1, | |
216 getmaxy(stdscr) - gpsy[i] - 1); | |
217 } else { | |
218 gnt_widget_set_position(window, getmaxx(stdscr) - gpsw[i - 1] - w - 1, | |
219 getmaxy(stdscr) - gpsy[i] - 1); | |
220 } | |
221 gnt_widget_draw(window); | |
222 | |
223 toast->timer = g_timeout_add(4000, (GSourceFunc)remove_toaster, toast); | |
224 toasters = g_list_prepend(toasters, toast); | |
225 } | |
226 | |
227 static void | |
15822 | 228 buddy_signed_on(PurpleBuddy *buddy, gpointer null) |
15817 | 229 { |
15822 | 230 if (purple_prefs_get_bool(PREFS_EVENT_SIGNONF)) |
17124
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
231 notify(NULL, _("%s just signed on"), purple_buddy_get_alias(buddy)); |
15817 | 232 } |
233 | |
234 static void | |
15822 | 235 buddy_signed_off(PurpleBuddy *buddy, gpointer null) |
15817 | 236 { |
15822 | 237 if (purple_prefs_get_bool(PREFS_EVENT_SIGNONF)) |
17124
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
238 notify(NULL, _("%s just signed off"), purple_buddy_get_alias(buddy)); |
15817 | 239 } |
240 | |
241 static void | |
15822 | 242 received_im_msg(PurpleAccount *account, const char *sender, const char *msg, |
243 PurpleConversation *conv, PurpleMessageFlags flags, gpointer null) | |
15817 | 244 { |
15822 | 245 if (purple_prefs_get_bool(PREFS_EVENT_IM_MSG)) |
17124
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
246 notify(conv, _("%s sent you a message"), sender); |
15817 | 247 } |
248 | |
249 static void | |
15822 | 250 received_chat_msg(PurpleAccount *account, const char *sender, const char *msg, |
251 PurpleConversation *conv, PurpleMessageFlags flags, gpointer null) | |
15817 | 252 { |
253 const char *nick; | |
254 | |
15822 | 255 if (flags & PURPLE_MESSAGE_WHISPER) |
15817 | 256 return; |
257 | |
15822 | 258 nick = PURPLE_CONV_CHAT(conv)->nick; |
15817 | 259 |
260 if (g_utf8_collate(sender, nick) == 0) | |
261 return; | |
262 | |
15822 | 263 if (purple_prefs_get_bool(PREFS_EVENT_CHAT_NICK) && |
264 (purple_utf8_has_word(msg, nick))) | |
17124
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
265 notify(conv, _("%s said your nick in %s"), sender, purple_conversation_get_name(conv)); |
15822 | 266 else if (purple_prefs_get_bool(PREFS_EVENT_CHAT_MSG)) |
17124
e22968d33131
Do not show the popup for focused conversations.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16669
diff
changeset
|
267 notify(conv, _("%s sent a message in %s"), sender, purple_conversation_get_name(conv)); |
15817 | 268 } |
269 | |
270 static gboolean | |
15822 | 271 plugin_load(PurplePlugin *plugin) |
15817 | 272 { |
15822 | 273 purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", plugin, |
274 PURPLE_CALLBACK(buddy_signed_on), NULL); | |
275 purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off", plugin, | |
276 PURPLE_CALLBACK(buddy_signed_off), NULL); | |
277 purple_signal_connect(purple_conversations_get_handle(), "received-im-msg", plugin, | |
278 PURPLE_CALLBACK(received_im_msg), NULL); | |
279 purple_signal_connect(purple_conversations_get_handle(), "received-chat-msg", plugin, | |
280 PURPLE_CALLBACK(received_chat_msg), NULL); | |
15817 | 281 |
282 memset(&gpsy, 0, sizeof(gpsy)); | |
283 memset(&gpsw, 0, sizeof(gpsw)); | |
284 | |
285 return TRUE; | |
286 } | |
287 | |
288 static gboolean | |
15822 | 289 plugin_unload(PurplePlugin *plugin) |
15817 | 290 { |
291 while (toasters) | |
292 { | |
293 GntToast *toast = toasters->data; | |
294 destroy_toaster(toast); | |
295 } | |
296 return TRUE; | |
297 } | |
298 | |
299 static struct | |
300 { | |
301 char *pref; | |
302 char *display; | |
303 } prefs[] = | |
304 { | |
305 {PREFS_EVENT_SIGNONF, N_("Buddy signs on/off")}, | |
306 {PREFS_EVENT_IM_MSG, N_("You receive an IM")}, | |
307 {PREFS_EVENT_CHAT_MSG, N_("Someone speaks in a chat")}, | |
308 {PREFS_EVENT_CHAT_NICK, N_("Someone says your name in a chat")}, | |
309 {NULL, NULL} | |
310 }; | |
311 | |
312 static void | |
313 pref_toggled(GntTree *tree, char *key, gpointer null) | |
314 { | |
15822 | 315 purple_prefs_set_bool(key, gnt_tree_get_choice(tree, key)); |
15817 | 316 } |
317 | |
318 static void | |
319 toggle_option(GntCheckBox *check, gpointer str) | |
320 { | |
15822 | 321 purple_prefs_set_bool(str, gnt_check_box_get_checked(check)); |
15817 | 322 } |
323 | |
324 static GntWidget * | |
325 config_frame() | |
326 { | |
327 GntWidget *window, *tree, *check; | |
328 int i; | |
329 | |
330 window = gnt_vbox_new(FALSE); | |
331 gnt_box_set_pad(GNT_BOX(window), 0); | |
332 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID); | |
333 gnt_box_set_fill(GNT_BOX(window), TRUE); | |
334 | |
335 gnt_box_add_widget(GNT_BOX(window), | |
336 gnt_label_new(_("Notify with a toaster when"))); | |
337 | |
338 tree = gnt_tree_new(); | |
339 gnt_box_add_widget(GNT_BOX(window), tree); | |
340 | |
341 for (i = 0; prefs[i].pref; i++) | |
342 { | |
343 gnt_tree_add_choice(GNT_TREE(tree), prefs[i].pref, | |
344 gnt_tree_create_row(GNT_TREE(tree), prefs[i].display), NULL, NULL); | |
345 gnt_tree_set_choice(GNT_TREE(tree), prefs[i].pref, | |
15822 | 346 purple_prefs_get_bool(prefs[i].pref)); |
15817 | 347 } |
348 gnt_tree_set_col_width(GNT_TREE(tree), 0, 40); | |
349 g_signal_connect(G_OBJECT(tree), "toggled", G_CALLBACK(pref_toggled), NULL); | |
350 | |
351 check = gnt_check_box_new(_("Beep too!")); | |
15822 | 352 gnt_check_box_set_checked(GNT_CHECK_BOX(check), purple_prefs_get_bool(PREFS_BEEP)); |
15817 | 353 g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(toggle_option), PREFS_BEEP); |
354 gnt_box_add_widget(GNT_BOX(window), check); | |
355 | |
356 #ifdef HAVE_X11 | |
357 check = gnt_check_box_new(_("Set URGENT for the terminal window.")); | |
15822 | 358 gnt_check_box_set_checked(GNT_CHECK_BOX(check), purple_prefs_get_bool(PREFS_URGENT)); |
15817 | 359 g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(toggle_option), PREFS_URGENT); |
360 gnt_box_add_widget(GNT_BOX(window), check); | |
361 #endif | |
362 | |
363 return window; | |
364 } | |
365 | |
15822 | 366 static PurplePluginInfo info = |
15817 | 367 { |
15822 | 368 PURPLE_PLUGIN_MAGIC, |
369 PURPLE_MAJOR_VERSION, | |
370 PURPLE_MINOR_VERSION, | |
371 PURPLE_PLUGIN_STANDARD, | |
372 FINCH_PLUGIN_TYPE, | |
15817 | 373 0, |
374 NULL, | |
15822 | 375 PURPLE_PRIORITY_DEFAULT, |
15817 | 376 "gntgf", |
377 N_("GntGf"), | |
378 VERSION, | |
379 N_("Toaster plugin"), | |
380 N_("Toaster plugin"), | |
381 "Sadrul H Chowdhury <sadrul@users.sourceforge.net>", | |
15863
4c707efebc0c
Use PURPLE_WEBSITE instead of listing the website directly (which was wrong because of the sed).
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
382 PURPLE_WEBSITE, |
15817 | 383 plugin_load, |
384 plugin_unload, | |
385 NULL, | |
386 config_frame, | |
387 NULL, | |
388 NULL, | |
16669
30829e806dae
And finch is up to date
Gary Kramlich <grim@reaperworld.com>
parents:
16320
diff
changeset
|
389 NULL, |
30829e806dae
And finch is up to date
Gary Kramlich <grim@reaperworld.com>
parents:
16320
diff
changeset
|
390 |
30829e806dae
And finch is up to date
Gary Kramlich <grim@reaperworld.com>
parents:
16320
diff
changeset
|
391 /* padding */ |
30829e806dae
And finch is up to date
Gary Kramlich <grim@reaperworld.com>
parents:
16320
diff
changeset
|
392 NULL, |
30829e806dae
And finch is up to date
Gary Kramlich <grim@reaperworld.com>
parents:
16320
diff
changeset
|
393 NULL, |
30829e806dae
And finch is up to date
Gary Kramlich <grim@reaperworld.com>
parents:
16320
diff
changeset
|
394 NULL, |
15817 | 395 NULL |
396 }; | |
397 | |
398 static void | |
15822 | 399 init_plugin(PurplePlugin *plugin) |
15817 | 400 { |
15822 | 401 purple_prefs_add_none("/plugins"); |
402 purple_prefs_add_none("/plugins/gnt"); | |
15817 | 403 |
15822 | 404 purple_prefs_add_none("/plugins/gnt/gntgf"); |
405 purple_prefs_add_none(PREFS_EVENT); | |
15817 | 406 |
15822 | 407 purple_prefs_add_bool(PREFS_EVENT_SIGNONF, TRUE); |
408 purple_prefs_add_bool(PREFS_EVENT_IM_MSG, TRUE); | |
409 purple_prefs_add_bool(PREFS_EVENT_CHAT_MSG, TRUE); | |
410 purple_prefs_add_bool(PREFS_EVENT_CHAT_NICK, TRUE); | |
15817 | 411 |
15822 | 412 purple_prefs_add_bool(PREFS_BEEP, TRUE); |
15817 | 413 #ifdef HAVE_X11 |
15822 | 414 purple_prefs_add_bool(PREFS_URGENT, FALSE); |
15817 | 415 #endif |
416 } | |
417 | |
15822 | 418 PURPLE_INIT_PLUGIN(PLUGIN_STATIC_NAME, init_plugin, info) |