annotate plugins/idle.c @ 13951:614c56622453

[gaim-migrate @ 16496] Rename gaim_buffer.c and .h to circbuffer.c and .h committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 16 Jul 2006 19:08:31 +0000
parents 571aebbe5ec6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
1 /*
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
2 * idle.c - I'dle Mak'er plugin for Gaim
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
3 *
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
4 * This file is part of Gaim.
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
5 *
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
6 * Gaim is the legal property of its developers, whose names are too numerous
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
8 * source distribution.
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
9 *
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
10 * This program is free software; you can redistribute it and/or modify
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
11 * it under the terms of the GNU General Public License as published by
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
13 * (at your option) any later version.
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
14 *
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
15 * This program is distributed in the hope that it will be useful,
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
18 * GNU General Public License for more details.
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
19 *
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
20 * You should have received a copy of the GNU General Public License
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
21 * along with this program; if not, write to the Free Software
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4103
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 */
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5614
diff changeset
25 #include "internal.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5614
diff changeset
26
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5614
diff changeset
27 #include "connection.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5614
diff changeset
28 #include "debug.h"
11975
aadf61b30056 [gaim-migrate @ 14268]
Mark Doliner <mark@kingant.net>
parents: 11974
diff changeset
29 #include "notify.h"
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
30 #include "plugin.h"
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
31 #include "request.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5614
diff changeset
32 #include "server.h"
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
33 #include "status.h"
9943
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9015
diff changeset
34 #include "version.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5614
diff changeset
35
11754
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
36 /* This plugin no longer depends on gtk */
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
37 #define IDLE_PLUGIN_ID "core-idle"
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
38
11754
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
39 static GList *idled_accts = NULL;
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
40
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
41 static gboolean
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
42 unidle_filter(GaimAccount *acct)
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
43 {
11754
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
44 if (g_list_find(idled_accts, acct))
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
45 return TRUE;
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
46
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
47 return FALSE;
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
48 }
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
49
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
50 static gboolean
12776
54ba44abf356 [gaim-migrate @ 15123]
Richard Laager <rlaager@wiktel.com>
parents: 12775
diff changeset
51 idleable_filter(GaimAccount *account)
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
52 {
12776
54ba44abf356 [gaim-migrate @ 15123]
Richard Laager <rlaager@wiktel.com>
parents: 12775
diff changeset
53 GaimPlugin *prpl;
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
54
12776
54ba44abf356 [gaim-migrate @ 15123]
Richard Laager <rlaager@wiktel.com>
parents: 12775
diff changeset
55 prpl = gaim_find_prpl(gaim_account_get_protocol_id(account));
54ba44abf356 [gaim-migrate @ 15123]
Richard Laager <rlaager@wiktel.com>
parents: 12775
diff changeset
56 g_return_val_if_fail(prpl != NULL, FALSE);
54ba44abf356 [gaim-migrate @ 15123]
Richard Laager <rlaager@wiktel.com>
parents: 12775
diff changeset
57
54ba44abf356 [gaim-migrate @ 15123]
Richard Laager <rlaager@wiktel.com>
parents: 12775
diff changeset
58 return (GAIM_PLUGIN_PROTOCOL_INFO(prpl)->set_idle != NULL);
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
59 }
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
60
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
61 static void
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
62 set_idle_time(GaimAccount *acct, int mins_idle)
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
63 {
11972
73777ad45562 [gaim-migrate @ 14265]
Mark Doliner <mark@kingant.net>
parents: 11754
diff changeset
64 time_t t;
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
65 GaimConnection *gc = gaim_account_get_connection(acct);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
66 GaimPresence *presence = gaim_account_get_presence(acct);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
67
11749
7da512f06185 [gaim-migrate @ 14040]
Richard Laager <rlaager@wiktel.com>
parents: 11551
diff changeset
68 if (!gc)
7da512f06185 [gaim-migrate @ 14040]
Richard Laager <rlaager@wiktel.com>
parents: 11551
diff changeset
69 return;
7da512f06185 [gaim-migrate @ 14040]
Richard Laager <rlaager@wiktel.com>
parents: 11551
diff changeset
70
11754
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
71 gaim_debug_info("idle",
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
72 "setting idle time for %s to %d\n",
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
73 gaim_account_get_username(acct), mins_idle);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
74
13658
788580688610 [gaim-migrate @ 16060]
Evan Schoenberg <evan.s@dreskin.net>
parents: 12844
diff changeset
75 if (mins_idle)
788580688610 [gaim-migrate @ 16060]
Evan Schoenberg <evan.s@dreskin.net>
parents: 12844
diff changeset
76 t = time(NULL) - (60 * mins_idle); /* subtract seconds idle from current time */
788580688610 [gaim-migrate @ 16060]
Evan Schoenberg <evan.s@dreskin.net>
parents: 12844
diff changeset
77 else
788580688610 [gaim-migrate @ 16060]
Evan Schoenberg <evan.s@dreskin.net>
parents: 12844
diff changeset
78 t = 0; /* time idle is irrelevant */
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
79
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
80 gaim_presence_set_idle(presence, mins_idle ? TRUE : FALSE, t);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
81 }
4103
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
83 static void
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
84 idle_action_ok(void *ignored, GaimRequestFields *fields)
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
85 {
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
86 int tm = gaim_request_fields_get_integer(fields, "mins");
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
87 GaimAccount *acct = gaim_request_fields_get_account(fields, "acct");
5587
1c55b1540e18 [gaim-migrate @ 5991]
Christian Hammond <chipx86@chipx86.com>
parents: 5530
diff changeset
88
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
89 /* only add the account to the GList if it's not already been idled */
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
90 if (!unidle_filter(acct))
11754
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
91 {
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
92 gaim_debug_misc("idle",
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
93 "%s hasn't been idled yet; adding to list.\n",
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
94 gaim_account_get_username(acct));
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
95 idled_accts = g_list_append(idled_accts, acct);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
96 }
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
97
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
98 set_idle_time(acct, tm);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
99 }
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
100
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
101 static void
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
102 idle_all_action_ok(void *ignored, GaimRequestFields *fields)
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
103 {
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
104 GaimAccount *acct = NULL;
13833
571aebbe5ec6 [gaim-migrate @ 16282]
Richard Laager <rlaager@wiktel.com>
parents: 13700
diff changeset
105 GList *list, *iter;
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
106 int tm = gaim_request_fields_get_integer(fields, "mins");
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
107 const char *prpl_id = NULL;
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
108
13833
571aebbe5ec6 [gaim-migrate @ 16282]
Richard Laager <rlaager@wiktel.com>
parents: 13700
diff changeset
109 list = gaim_accounts_get_all_active();
571aebbe5ec6 [gaim-migrate @ 16282]
Richard Laager <rlaager@wiktel.com>
parents: 13700
diff changeset
110 for(iter = list; iter; iter = iter->next) {
571aebbe5ec6 [gaim-migrate @ 16282]
Richard Laager <rlaager@wiktel.com>
parents: 13700
diff changeset
111 acct = (GaimAccount *)(iter->data);
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
112
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
113 if(acct)
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
114 prpl_id = gaim_account_get_protocol_id(acct);
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
115
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
116 if(acct && idleable_filter(acct)) {
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
117 gaim_debug_misc("idle", "Idling %s.\n",
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
118 gaim_account_get_username(acct));
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
119
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
120 set_idle_time(acct, tm);
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
121
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
122 if(!g_list_find(idled_accts, acct))
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
123 idled_accts = g_list_append(idled_accts, acct);
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
124 }
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
125 }
13833
571aebbe5ec6 [gaim-migrate @ 16282]
Richard Laager <rlaager@wiktel.com>
parents: 13700
diff changeset
126
571aebbe5ec6 [gaim-migrate @ 16282]
Richard Laager <rlaager@wiktel.com>
parents: 13700
diff changeset
127 g_list_free(list);
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
128 }
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
129
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
130 static void
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
131 unidle_action_ok(void *ignored, GaimRequestFields *fields)
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
132 {
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
133 GaimAccount *acct = gaim_request_fields_get_account(fields, "acct");
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
134
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
135 set_idle_time(acct, 0); /* unidle the account */
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
136
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
137 /* once the account has been unidled it shouldn't be in the list */
11749
7da512f06185 [gaim-migrate @ 14040]
Richard Laager <rlaager@wiktel.com>
parents: 11551
diff changeset
138 idled_accts = g_list_remove(idled_accts, acct);
4103
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139 }
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
141
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
142 static void
9015
67421e0dc497 [gaim-migrate @ 9791]
Luke Schierer <lschiere@pidgin.im>
parents: 8994
diff changeset
143 idle_action(GaimPluginAction *action)
6008
35679a3f2bcc [gaim-migrate @ 6456]
Christian Hammond <chipx86@chipx86.com>
parents: 5920
diff changeset
144 {
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
145 /* Use the super fancy request API */
4103
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
147 GaimRequestFields *request;
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
148 GaimRequestFieldGroup *group;
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
149 GaimRequestField *field;
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
150
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
151 group = gaim_request_field_group_new(NULL);
4103
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152
8994
c5825a04fb97 [gaim-migrate @ 9769]
Luke Schierer <lschiere@pidgin.im>
parents: 8986
diff changeset
153 field = gaim_request_field_account_new("acct", _("Account"), NULL);
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
154 gaim_request_field_account_set_filter(field, idleable_filter);
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
155 gaim_request_field_account_set_show_all(field, FALSE);
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
156 gaim_request_field_group_add_field(group, field);
11754
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
157
8994
c5825a04fb97 [gaim-migrate @ 9769]
Luke Schierer <lschiere@pidgin.im>
parents: 8986
diff changeset
158 field = gaim_request_field_int_new("mins", _("Minutes"), 10);
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
159 gaim_request_field_group_add_field(group, field);
4103
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
161 request = gaim_request_fields_new();
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
162 gaim_request_fields_add_group(request, group);
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
163
9015
67421e0dc497 [gaim-migrate @ 9791]
Luke Schierer <lschiere@pidgin.im>
parents: 8994
diff changeset
164 gaim_request_fields(action->plugin,
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
165 N_("I'dle Mak'er"),
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
166 _("Set Account Idle Time"),
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
167 NULL,
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
168 request,
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
169 _("_Set"), G_CALLBACK(idle_action_ok),
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
170 _("_Cancel"), NULL,
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
171 NULL);
4103
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172 }
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
174 static void
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
175 unidle_action(GaimPluginAction *action)
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
176 {
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
177 GaimRequestFields *request;
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
178 GaimRequestFieldGroup *group;
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
179 GaimRequestField *field;
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
180
11975
aadf61b30056 [gaim-migrate @ 14268]
Mark Doliner <mark@kingant.net>
parents: 11974
diff changeset
181 if (idled_accts == NULL)
aadf61b30056 [gaim-migrate @ 14268]
Mark Doliner <mark@kingant.net>
parents: 11974
diff changeset
182 {
aadf61b30056 [gaim-migrate @ 14268]
Mark Doliner <mark@kingant.net>
parents: 11974
diff changeset
183 gaim_notify_info(NULL, NULL, _("None of your accounts are idle."), NULL);
aadf61b30056 [gaim-migrate @ 14268]
Mark Doliner <mark@kingant.net>
parents: 11974
diff changeset
184 return;
aadf61b30056 [gaim-migrate @ 14268]
Mark Doliner <mark@kingant.net>
parents: 11974
diff changeset
185 }
aadf61b30056 [gaim-migrate @ 14268]
Mark Doliner <mark@kingant.net>
parents: 11974
diff changeset
186
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
187 group = gaim_request_field_group_new(NULL);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
188
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
189 field = gaim_request_field_account_new("acct", _("Account"), NULL);
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
190 gaim_request_field_account_set_filter(field, unidle_filter);
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
191 gaim_request_field_account_set_show_all(field, FALSE);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
192 gaim_request_field_group_add_field(group, field);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
193
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
194 request = gaim_request_fields_new();
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
195 gaim_request_fields_add_group(request, group);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
196
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
197 gaim_request_fields(action->plugin,
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
198 N_("I'dle Mak'er"),
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
199 _("Unset Account Idle Time"),
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
200 NULL,
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
201 request,
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
202 _("_Unset"), G_CALLBACK(unidle_action_ok),
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
203 _("_Cancel"), NULL,
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
204 NULL);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
205 }
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
206
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
207 static void
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
208 idle_all_action(GaimPluginAction *action)
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
209 {
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
210 GaimRequestFields *request;
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
211 GaimRequestFieldGroup *group;
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
212 GaimRequestField *field;
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
213
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
214 group = gaim_request_field_group_new(NULL);
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
215
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
216 field = gaim_request_field_int_new("mins", _("Minutes"), 10);
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
217 gaim_request_field_group_add_field(group, field);
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
218
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
219 request = gaim_request_fields_new();
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
220 gaim_request_fields_add_group(request, group);
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
221
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
222 gaim_request_fields(action->plugin,
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
223 N_("I'dle Mak'er"),
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
224 _("Set Idle Time for All Accounts"),
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
225 NULL,
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
226 request,
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
227 _("_Set"), G_CALLBACK(idle_all_action_ok),
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
228 _("_Cancel"), NULL,
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
229 NULL);
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
230 }
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
231
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
232 static void
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
233 unidle_all_action(GaimPluginAction *action)
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
234 {
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
235 GList *l;
11754
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
236
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
237 /* freeing the list here will cause segfaults if the user idles an account
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
238 * after the list is freed */
11754
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
239 for (l = idled_accts; l; l = l->next)
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
240 {
11749
7da512f06185 [gaim-migrate @ 14040]
Richard Laager <rlaager@wiktel.com>
parents: 11551
diff changeset
241 GaimAccount *account = l->data;
7da512f06185 [gaim-migrate @ 14040]
Richard Laager <rlaager@wiktel.com>
parents: 11551
diff changeset
242 set_idle_time(account, 0);
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
243 }
11754
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
244
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
245 g_list_free(idled_accts);
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
246 idled_accts = NULL;
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
247 }
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
248
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
249 static GList *
9015
67421e0dc497 [gaim-migrate @ 9791]
Luke Schierer <lschiere@pidgin.im>
parents: 8994
diff changeset
250 actions(GaimPlugin *plugin, gpointer context)
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
251 {
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
252 GList *l = NULL;
9015
67421e0dc497 [gaim-migrate @ 9791]
Luke Schierer <lschiere@pidgin.im>
parents: 8994
diff changeset
253 GaimPluginAction *act = NULL;
4103
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254
12306
5907fb1e58a0 [gaim-migrate @ 14610]
Mark Doliner <mark@kingant.net>
parents: 12272
diff changeset
255 act = gaim_plugin_action_new(_("Set Account Idle Time"),
9015
67421e0dc497 [gaim-migrate @ 9791]
Luke Schierer <lschiere@pidgin.im>
parents: 8994
diff changeset
256 idle_action);
67421e0dc497 [gaim-migrate @ 9791]
Luke Schierer <lschiere@pidgin.im>
parents: 8994
diff changeset
257 l = g_list_append(l, act);
4103
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258
12306
5907fb1e58a0 [gaim-migrate @ 14610]
Mark Doliner <mark@kingant.net>
parents: 12272
diff changeset
259 act = gaim_plugin_action_new(_("Unset Account Idle Time"),
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
260 unidle_action);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
261 l = g_list_append(l, act);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
262
12775
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
263 act = gaim_plugin_action_new(_("Set Idle Time for All Accounts"),
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
264 idle_all_action);
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
265 l = g_list_append(l, act);
4dc5e71c5a57 [gaim-migrate @ 15122]
Mark Doliner <mark@kingant.net>
parents: 12764
diff changeset
266
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
267 act = gaim_plugin_action_new(
12306
5907fb1e58a0 [gaim-migrate @ 14610]
Mark Doliner <mark@kingant.net>
parents: 12272
diff changeset
268 _("Unset Idle Time for All Idled Accounts"), unidle_all_action);
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
269 l = g_list_append(l, act);
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
270
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
271 return l;
4103
caa7701b67d1 [gaim-migrate @ 4318]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272 }
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
273
12839
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
274 static void
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
275 signing_off_cb(GaimConnection *gc, void *data)
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
276 {
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
277 GaimAccount *account;
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
278
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
279 account = gaim_connection_get_account(gc);
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
280 idled_accts = g_list_remove(idled_accts, account);
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
281 }
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
282
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
283 static gboolean
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
284 plugin_load(GaimPlugin *plugin)
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
285 {
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
286 gaim_signal_connect(gaim_connections_get_handle(), "signing-off",
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
287 plugin,
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
288 GAIM_CALLBACK(signing_off_cb), NULL);
12844
890c6429bc61 [gaim-migrate @ 15192]
Mark Doliner <mark@kingant.net>
parents: 12839
diff changeset
289
890c6429bc61 [gaim-migrate @ 15192]
Mark Doliner <mark@kingant.net>
parents: 12839
diff changeset
290 return TRUE;
12839
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
291 }
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
292
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
293 static gboolean
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
294 plugin_unload(GaimPlugin *plugin)
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
295 {
11754
55052a685da6 [gaim-migrate @ 14045]
Mark Doliner <mark@kingant.net>
parents: 11749
diff changeset
296 unidle_all_action(NULL);
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
297
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
298 return TRUE;
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
299 }
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
300
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
301 static GaimPluginInfo info =
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
302 {
9943
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9015
diff changeset
303 GAIM_PLUGIN_MAGIC,
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9015
diff changeset
304 GAIM_MAJOR_VERSION,
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9015
diff changeset
305 GAIM_MINOR_VERSION,
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
306 GAIM_PLUGIN_STANDARD,
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
307 NULL,
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
308 0,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
309 NULL,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
310 GAIM_PRIORITY_DEFAULT,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
311 IDLE_PLUGIN_ID,
13700
85267a333422 [gaim-migrate @ 16103]
Richard Laager <rlaager@wiktel.com>
parents: 13658
diff changeset
312
85267a333422 [gaim-migrate @ 16103]
Richard Laager <rlaager@wiktel.com>
parents: 13658
diff changeset
313 /* This is a cultural reference. Dy'er Mak'er is a song by Led Zeppelin.
85267a333422 [gaim-migrate @ 16103]
Richard Laager <rlaager@wiktel.com>
parents: 13658
diff changeset
314 If that doesn't translate well into your language, drop the 's before translating. */
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
315 N_("I'dle Mak'er"),
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
316 VERSION,
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
317 N_("Allows you to hand-configure how long you've been idle"),
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
318 N_("Allows you to hand-configure how long you've been idle"),
6481
4dfae12a97bc [gaim-migrate @ 6995]
Mark Doliner <mark@kingant.net>
parents: 6371
diff changeset
319 "Eric Warmenhoven <eric@warmenhoven.org>",
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6064
diff changeset
320 GAIM_WEBSITE,
12839
2bf82fdddf5e [gaim-migrate @ 15187]
Richard Laager <rlaager@wiktel.com>
parents: 12826
diff changeset
321 plugin_load,
11551
78aad676fdb2 [gaim-migrate @ 13806]
Luke Schierer <lschiere@pidgin.im>
parents: 11256
diff changeset
322 plugin_unload,
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
323 NULL,
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
324 NULL,
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
325 NULL,
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
326 NULL,
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
327 actions
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
328 };
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
329
12826
74eb10cead7f [gaim-migrate @ 15174]
Mark Doliner <mark@kingant.net>
parents: 12776
diff changeset
330 static void
5920
7d385de2f9cd [gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents: 5873
diff changeset
331 init_plugin(GaimPlugin *plugin)
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
332 {
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
333 }
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4635
diff changeset
334
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
335
6063
5239a3b4ab33 [gaim-migrate @ 6513]
Nathan Walp <nwalp@pidgin.im>
parents: 6008
diff changeset
336 GAIM_INIT_PLUGIN(idle, init_plugin, info)
8986
8cf32769ba1b [gaim-migrate @ 9761]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
337