annotate plugins/mailchk.c @ 12776:54ba44abf356

[gaim-migrate @ 15123] Special-casing IRC by name is ugly. Let's check for a set_idle prpl function instead. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 09 Jan 2006 05:48:50 +0000
parents 58bc500cf226
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
1 #include "internal.h"
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
2
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
3 #include "debug.h"
4576
c7569367ed87 [gaim-migrate @ 4857]
Luke Schierer <lschiere@pidgin.im>
parents: 4575
diff changeset
4 #include "sound.h"
9954
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9821
diff changeset
5 #include "version.h"
6677
cce494e69d68 [gaim-migrate @ 7202]
Luke Schierer <lschiere@pidgin.im>
parents: 6485
diff changeset
6
cce494e69d68 [gaim-migrate @ 7202]
Luke Schierer <lschiere@pidgin.im>
parents: 6485
diff changeset
7 #include "gtkblist.h"
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
8 #include "gtkplugin.h"
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
9
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
10 #define MAILCHK_PLUGIN_ID "gtk-mailchk"
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4655
diff changeset
11
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 #define ANY_MAIL 0x01
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13 #define UNREAD_MAIL 0x02
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 #define NEW_MAIL 0x04
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16 static guint32 timer = 0;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 static GtkWidget *mail = NULL;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18
10218
6071dfe17d14 [gaim-migrate @ 11346]
Mark Doliner <mark@kingant.net>
parents: 9954
diff changeset
19 static gint
6071dfe17d14 [gaim-migrate @ 11346]
Mark Doliner <mark@kingant.net>
parents: 9954
diff changeset
20 check_mail()
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 {
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 static off_t oldsize = 0;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 gchar *filename;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24 off_t newsize;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 struct stat s;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 gint ret = 0;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27
4655
fac4c73dd5ad [gaim-migrate @ 4966]
Nathan Walp <nwalp@pidgin.im>
parents: 4576
diff changeset
28 filename = g_strdup(g_getenv("MAIL"));
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 if (!filename)
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 filename = g_strconcat("/var/spool/mail/", g_get_user_name(), NULL);
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31
10589
0f7452b1f777 [gaim-migrate @ 11994]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10218
diff changeset
32 if (g_stat(filename, &s) < 0) {
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 g_free(filename);
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34 return -1;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 }
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37 newsize = s.st_size;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 if (newsize) ret |= ANY_MAIL;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 if (s.st_mtime > s.st_atime && newsize) ret |= UNREAD_MAIL;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40 if (newsize != oldsize && (ret & UNREAD_MAIL)) ret |= NEW_MAIL;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 oldsize = newsize;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43 g_free(filename);
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 return ret;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 }
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47
10218
6071dfe17d14 [gaim-migrate @ 11346]
Mark Doliner <mark@kingant.net>
parents: 9954
diff changeset
48 static void
6071dfe17d14 [gaim-migrate @ 11346]
Mark Doliner <mark@kingant.net>
parents: 9954
diff changeset
49 destroy_cb()
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50 {
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 mail = NULL;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 }
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53
10218
6071dfe17d14 [gaim-migrate @ 11346]
Mark Doliner <mark@kingant.net>
parents: 9954
diff changeset
54 static gboolean
6071dfe17d14 [gaim-migrate @ 11346]
Mark Doliner <mark@kingant.net>
parents: 9954
diff changeset
55 check_timeout(gpointer data)
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56 {
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 gint count = check_mail();
8598
58e02f309485 [gaim-migrate @ 9349]
Luke Schierer <lschiere@pidgin.im>
parents: 6677
diff changeset
58 GaimBuddyList *list = gaim_get_blist();
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
59
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60 if (count == -1)
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
61 return FALSE;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
63 if (!list || !GAIM_IS_GTK_BLIST(list) || !(GAIM_GTK_BLIST(list)->vbox))
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64 return TRUE;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66 if (!mail) {
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 /* guess we better build it then :P */
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
68 GtkWidget *vbox = GAIM_GTK_BLIST(list)->vbox;
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
69
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70 mail = gtk_label_new("No mail messages.");
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
71 gtk_box_pack_start(GTK_BOX(vbox), mail, FALSE, FALSE, 0);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
72 gtk_box_reorder_child(GTK_BOX(vbox), mail, 1);
5314
1f901484599d [gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents: 5255
diff changeset
73 g_signal_connect(G_OBJECT(mail), "destroy", G_CALLBACK(destroy_cb), NULL);
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 gtk_widget_show(mail);
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75 }
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77 if (count & NEW_MAIL)
11642
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 11256
diff changeset
78 gaim_sound_play_event(GAIM_SOUND_POUNCE_DEFAULT, NULL);
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
80 if (count & UNREAD_MAIL)
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
81 gtk_label_set_text(GTK_LABEL(mail), "You have new mail!");
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
82 else if (count & ANY_MAIL)
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
83 gtk_label_set_text(GTK_LABEL(mail), "You have mail.");
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
84 else
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
85 gtk_label_set_text(GTK_LABEL(mail), "No mail messages.");
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
87 return TRUE;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
88 }
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
89
10218
6071dfe17d14 [gaim-migrate @ 11346]
Mark Doliner <mark@kingant.net>
parents: 9954
diff changeset
90 static void
6071dfe17d14 [gaim-migrate @ 11346]
Mark Doliner <mark@kingant.net>
parents: 9954
diff changeset
91 signon_cb(GaimConnection *gc)
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92 {
8598
58e02f309485 [gaim-migrate @ 9349]
Luke Schierer <lschiere@pidgin.im>
parents: 6677
diff changeset
93 GaimBuddyList *list = gaim_get_blist();
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
94 if (list && GAIM_IS_GTK_BLIST(list) && !timer) {
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
95 check_timeout(NULL); /* we want the box to be drawn immediately */
4168
ebfb80bbe1ed [gaim-migrate @ 4397]
Luke Schierer <lschiere@pidgin.im>
parents: 4165
diff changeset
96 timer = g_timeout_add(2000, check_timeout, NULL);
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
97 }
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
98 }
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
99
10218
6071dfe17d14 [gaim-migrate @ 11346]
Mark Doliner <mark@kingant.net>
parents: 9954
diff changeset
100 static void
6071dfe17d14 [gaim-migrate @ 11346]
Mark Doliner <mark@kingant.net>
parents: 9954
diff changeset
101 signoff_cb(GaimConnection *gc)
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
102 {
8598
58e02f309485 [gaim-migrate @ 9349]
Luke Schierer <lschiere@pidgin.im>
parents: 6677
diff changeset
103 GaimBuddyList *list = gaim_get_blist();
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
104 if ((!list || !GAIM_IS_GTK_BLIST(list) || !GAIM_GTK_BLIST(list)->vbox) && timer) {
4168
ebfb80bbe1ed [gaim-migrate @ 4397]
Luke Schierer <lschiere@pidgin.im>
parents: 4165
diff changeset
105 g_source_remove(timer);
2259
866bf3ced1bc [gaim-migrate @ 2269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1804
diff changeset
106 timer = 0;
866bf3ced1bc [gaim-migrate @ 2269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1804
diff changeset
107 }
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
108 }
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
110 /*
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
111 * EXPORTED FUNCTIONS
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
112 */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
113
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
114 static gboolean
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
115 plugin_load(GaimPlugin *plugin)
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
116 {
8598
58e02f309485 [gaim-migrate @ 9349]
Luke Schierer <lschiere@pidgin.im>
parents: 6677
diff changeset
117 GaimBuddyList *list = gaim_get_blist();
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
118 void *conn_handle = gaim_connections_get_handle();
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
119
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
120 if (!check_timeout(NULL)) {
8598
58e02f309485 [gaim-migrate @ 9349]
Luke Schierer <lschiere@pidgin.im>
parents: 6677
diff changeset
121 gaim_debug_warning("mailchk", "Could not read $MAIL or /var/spool/mail/$USER");
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
122 return FALSE;
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
123 }
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
124
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
125 if (list && GAIM_IS_GTK_BLIST(list) && GAIM_GTK_BLIST(list)->vbox)
4168
ebfb80bbe1ed [gaim-migrate @ 4397]
Luke Schierer <lschiere@pidgin.im>
parents: 4165
diff changeset
126 timer = g_timeout_add(2000, check_timeout, NULL);
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
127
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
128 gaim_signal_connect(conn_handle, "signed-on",
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
129 plugin, GAIM_CALLBACK(signon_cb), NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
130 gaim_signal_connect(conn_handle, "signed-off",
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
131 plugin, GAIM_CALLBACK(signoff_cb), NULL);
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
132
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
133 return TRUE;
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
134 }
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
135
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
136 static gboolean
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
137 plugin_unload(GaimPlugin *plugin)
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
138 {
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
139 if (timer)
4168
ebfb80bbe1ed [gaim-migrate @ 4397]
Luke Schierer <lschiere@pidgin.im>
parents: 4165
diff changeset
140 g_source_remove(timer);
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
141 timer = 0;
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
142 if (mail)
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
143 gtk_widget_destroy(mail);
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
144 mail = NULL;
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
145
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
146 return TRUE;
1803
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
147 }
d36f759df56d [gaim-migrate @ 1813]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
148
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
149 static GaimPluginInfo info =
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
150 {
9954
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9821
diff changeset
151 GAIM_PLUGIN_MAGIC,
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9821
diff changeset
152 GAIM_MAJOR_VERSION,
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9821
diff changeset
153 GAIM_MINOR_VERSION,
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
154 GAIM_PLUGIN_STANDARD,
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
155 GAIM_GTK_PLUGIN_TYPE,
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
156 0,
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
157 NULL,
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
158 GAIM_PRIORITY_DEFAULT,
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
159 MAILCHK_PLUGIN_ID,
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
160 N_("Mail Checker"),
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
161 VERSION,
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
162 N_("Checks for new local mail."),
8598
58e02f309485 [gaim-migrate @ 9349]
Luke Schierer <lschiere@pidgin.im>
parents: 6677
diff changeset
163 N_("Adds a small box to the buddy list that"
58e02f309485 [gaim-migrate @ 9349]
Luke Schierer <lschiere@pidgin.im>
parents: 6677
diff changeset
164 " shows if you have new mail."),
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
165 "Eric Warmenhoven <eric@warmenhoven.org>",
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6287
diff changeset
166 GAIM_WEBSITE,
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
167 plugin_load,
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
168 plugin_unload,
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
169 NULL,
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
170 NULL,
8993
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
171 NULL,
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
172 NULL,
6287
bb811465c82d [gaim-migrate @ 6786]
Luke Schierer <lschiere@pidgin.im>
parents: 6063
diff changeset
173 NULL
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
174 };
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
175
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
176 static void
5920
7d385de2f9cd [gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
177 init_plugin(GaimPlugin *plugin)
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
178 {
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3060
diff changeset
179 }
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3060
diff changeset
180
6063
5239a3b4ab33 [gaim-migrate @ 6513]
Nathan Walp <nwalp@pidgin.im>
parents: 5920
diff changeset
181 GAIM_INIT_PLUGIN(mailchk, init_plugin, info)