Mercurial > pidgin
annotate plugins/autorecon.c @ 412:ad08e67ec874
[gaim-migrate @ 422]
A woman went to her doctor for advice. She told him that her husband had
developed a penchant for anal sex, and she was not sure that it was such
a good idea.
The doctor asked, "Do you enjoy it?"
She said that she did.
He asked, "Does it hurt you?"
She said that it didn't.
The doctor then told her, "Well, then, there's no reason that you
shouldn't practice anal sex, if that's what you like, so long as you
take care not to get pregnant."
The woman was mystified. She asked "You can get pregnant from anal sex?"
The doctor replied, "Of course. Where do you think attorneys come from?"
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 16 Jun 2000 09:29:36 +0000 |
parents | c754e5ae442a |
children | d96b511972fe |
rev | line source |
---|---|
99 | 1 #define GAIM_PLUGINS |
2 #include "gaim.h" | |
3 #include <gtk/gtk.h> | |
4 | |
151
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
5 extern GtkWidget *imaway; |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
6 |
99 | 7 static int recon; |
151
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
8 static int away_state; |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
9 static int forced_off = 0; |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
10 static struct away_message *last_away; |
99 | 11 |
12 char *name() { | |
13 return "Auto Reconnect"; | |
14 } | |
15 | |
16 char *description() { | |
17 return "When AOL kicks you off, this auto-reconnects you."; | |
18 } | |
19 | |
20 extern void dologin(GtkWidget *, GtkWidget *); | |
21 | |
22 void do_signon() { | |
23 dologin(NULL, NULL); | |
151
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
24 if (blist) { |
99 | 25 gtk_timeout_remove(recon); |
151
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
26 forced_off = 0; |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
27 if (away_state) |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
28 do_away_message(NULL, last_away); |
99 | 29 return; |
30 } | |
31 } | |
32 | |
33 void reconnect(void *m) { | |
34 recon = gtk_timeout_add(2000, (GtkFunction)do_signon, NULL); | |
151
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
35 forced_off = 1; |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
36 } |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
37 |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
38 void away_toggle(void *m) { |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
39 if ((int)m == 1) { |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
40 last_away = awaymessage; |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
41 away_state = 1; |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
42 } else if (!forced_off) |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
43 away_state = 0; |
99 | 44 } |
45 | |
46 void gaim_plugin_init(void *handle) { | |
151
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
47 if (imaway) { |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
48 away_state = 1; |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
49 last_away = awaymessage; |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
50 } else |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
51 away_state = 0; |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
52 |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
53 gaim_signal_connect(handle, event_away, away_toggle, (void *)1); |
c754e5ae442a
[gaim-migrate @ 161]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
148
diff
changeset
|
54 gaim_signal_connect(handle, event_back, away_toggle, (void *)0); |
99 | 55 gaim_signal_connect(handle, event_signoff, reconnect, NULL); |
56 } |