Mercurial > pidgin
annotate plugins/autorecon.c @ 2043:1b8f4b90bf09
[gaim-migrate @ 2053]
whoops.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 16 Jun 2001 20:00:17 +0000 |
parents | 84782d1cb051 |
children | 66783ad29e55 |
rev | line source |
---|---|
99 | 1 #define GAIM_PLUGINS |
2 #include "gaim.h" | |
1404
96e93119268d
[gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1378
diff
changeset
|
3 #include "prpl.h" |
99 | 4 #include <gtk/gtk.h> |
5 | |
6 char *name() { | |
7 return "Auto Reconnect"; | |
8 } | |
9 | |
10 char *description() { | |
1817
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1404
diff
changeset
|
11 return "When you are kicked offline, this reconnects you."; |
99 | 12 } |
13 | |
1817
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1404
diff
changeset
|
14 static gboolean do_signon(struct aim_user *u) { |
1818
84782d1cb051
[gaim-migrate @ 1828]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1817
diff
changeset
|
15 if (g_list_index(aim_users, u) < 0) |
1817
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1404
diff
changeset
|
16 return FALSE; |
1378
aedeb1218a0a
[gaim-migrate @ 1388]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1165
diff
changeset
|
17 serv_login(u); |
1817
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1404
diff
changeset
|
18 return FALSE; |
1378
aedeb1218a0a
[gaim-migrate @ 1388]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1165
diff
changeset
|
19 } |
aedeb1218a0a
[gaim-migrate @ 1388]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1165
diff
changeset
|
20 |
aedeb1218a0a
[gaim-migrate @ 1388]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1165
diff
changeset
|
21 static void reconnect(struct gaim_connection *gc, void *m) { |
1818
84782d1cb051
[gaim-migrate @ 1828]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1817
diff
changeset
|
22 if (!gc->wants_to_die) |
1817
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1404
diff
changeset
|
23 gtk_timeout_add(8000, (GtkFunction)do_signon, gc->user); |
99 | 24 } |
25 | |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
26 char *gaim_plugin_init(GModule *handle) { |
99 | 27 gaim_signal_connect(handle, event_signoff, reconnect, NULL); |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
28 |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
29 return NULL; |
99 | 30 } |