annotate plugins/timestamp.c @ 9742:d549d27388b2

[gaim-migrate @ 10607] I think this was from nosnilmot The Patcher. It should fix give the chat "invite" button a correct name. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 12 Aug 2004 01:08:47 +0000
parents 06b28fb24300
children 0e3a84f18467
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
1 /*
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
2 * Gaim - iChat-like timestamps
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
3 *
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
4 * Copyright (C) 2002-2003, Sean Egan
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
5 * Copyright (C) 2003, Chris J. Friesen <Darth_Sebulba04@yahoo.com>
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
6 *
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
7 * This program is free software; you can redistribute it and/or modify
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
8 * it under the terms of the GNU General Public License as published by
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
10 * (at your option) any later version.
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
11 *
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
12 * This program is distributed in the hope that it will be useful,
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
15 * GNU General Public License for more details.
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
16 *
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
17 * You should have received a copy of the GNU General Public License
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
18 * along with this program; if not, write to the Free Software
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
20 *
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
21 */
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
22
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
23
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
25 #include "internal.h"
4202
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4201
diff changeset
26
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
27 #include "conversation.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
28 #include "debug.h"
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
29 #include "prefs.h"
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
30 #include "signals.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
31
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 #include "gtkimhtml.h"
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
33 #include "gtkplugin.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
34 #include "gtkutils.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
35
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
36 #define TIMESTAMP_PLUGIN_ID "gtk-timestamp"
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37
6050
72403c3c84e1 [gaim-migrate @ 6500]
Mark Doliner <mark@kingant.net>
parents: 5920
diff changeset
38 /* Set the default to 5 minutes. */
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
39 static int interval = 5 * 60 * 1000;
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
41 static GSList *timestamp_timeouts = NULL;
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
43 static gboolean do_timestamp (gpointer data)
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5530
diff changeset
45 GaimConversation *c = (GaimConversation *)data;
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 char *buf;
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47 char mdate[6];
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
48 int is_conversation_active;
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 time_t tim = time(NULL);
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
50
4376
2c985a9e994c [gaim-migrate @ 4642]
Christian Hammond <chipx86@chipx86.com>
parents: 4359
diff changeset
51 if (!g_list_find(gaim_get_conversations(), c))
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 return FALSE;
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
54 /* is_conversation_active is true if an im has been displayed since the last timestamp */
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
55 is_conversation_active = GPOINTER_TO_INT(gaim_conversation_get_data(c, "timestamp-conv-active"));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
56
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
57 if (is_conversation_active){
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
58 gaim_conversation_set_data(c, "timestamp-conv-active", GINT_TO_POINTER(FALSE));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
59 strftime(mdate, sizeof(mdate), "%H:%M", localtime(&tim));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
60 buf = g_strdup_printf(" %s", mdate);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
61 gaim_conversation_write(c, NULL, buf, GAIM_MESSAGE_NO_LOG, tim);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
62 g_free(buf);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
63 }
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
64 else
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
65 gaim_conversation_set_data(c, "timestamp-enabled", GINT_TO_POINTER(FALSE));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
66
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 return TRUE;
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68 }
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
70
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
71 static gboolean
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
72 timestamp_displaying_conv_msg(GaimAccount *account, GaimConversation *conv,
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
73 char **buffer, void *data)
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
74 {
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
75 int is_timestamp_enabled;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
76
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
77 if (!g_list_find(gaim_get_conversations(), conv))
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
78 return FALSE;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
79
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
80 /* set to true, since there has been an im since the last timestamp */
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
81 gaim_conversation_set_data(conv, "timestamp-conv-active", GINT_TO_POINTER(TRUE));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
82
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
83 is_timestamp_enabled = GPOINTER_TO_INT(gaim_conversation_get_data(conv, "timestamp-enabled"));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
84
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
85 if (!is_timestamp_enabled){
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
86 gaim_conversation_set_data(conv, "timestamp-enabled", GINT_TO_POINTER(TRUE));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
87 do_timestamp((gpointer)conv);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
88 }
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
89
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
90 return FALSE;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
91 }
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
92
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
93 static gboolean
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
94 timestamp_receiving_msg(GaimAccount *account, char **sender, char **buffer,
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
95 int *flags, void *data)
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
96 {
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
97 GaimConversation* conv;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
98
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
99 conv = gaim_find_conversation_with_account(*sender, account);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
100 if (conv != NULL)
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
101 return timestamp_displaying_conv_msg(account, conv, buffer, data);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
102 return FALSE;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
103 }
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
104
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
105
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
106 static void timestamp_new_convo(GaimConversation *conv)
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 {
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
108 if (!g_list_find(gaim_get_conversations(), conv))
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
109 return;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
110
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
111 /*
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
112 This if statement stops conversations that have already been initialized for timestamps
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
113 from being reinitialized. This prevents every active conversation from immediately being spammed
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
114 with a new timestamp when the user modifies the timer interval.
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
115 */
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
116 if (!gaim_conversation_get_data(conv, "timestamp-initialized")){
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
117 gaim_conversation_set_data(conv, "timestamp-initialized", GINT_TO_POINTER(TRUE));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
118 gaim_conversation_set_data(conv, "timestamp-enabled", GINT_TO_POINTER(TRUE));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
119 gaim_conversation_set_data(conv, "timestamp-conv-active", GINT_TO_POINTER(TRUE));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
120 do_timestamp(conv);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
121 }
4168
ebfb80bbe1ed [gaim-migrate @ 4397]
Luke Schierer <lschiere@pidgin.im>
parents: 4113
diff changeset
122
3727
dadb43e0bcae [gaim-migrate @ 3864]
Luke Schierer <lschiere@pidgin.im>
parents: 3598
diff changeset
123 timestamp_timeouts = g_slist_append(timestamp_timeouts,
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
124 GINT_TO_POINTER(g_timeout_add(interval, do_timestamp, conv)));
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
125 }
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
126
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
127
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
128 static void destroy_timer_list()
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
129 {
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
130 GSList *to;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
131
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
132 for (to = timestamp_timeouts; to != NULL; to = to->next)
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
133 g_source_remove(GPOINTER_TO_INT(to->data));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
134
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
135 g_slist_free(timestamp_timeouts);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
136
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
137 timestamp_timeouts = NULL;
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
138 }
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
139
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
140 static void init_timer_list()
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
141 {
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
142 GList *cnvs;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
143 GaimConversation *c;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
144
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
145 if (timestamp_timeouts != NULL)
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
146 destroy_timer_list();
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
147
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
148 for (cnvs = gaim_get_conversations(); cnvs != NULL; cnvs = cnvs->next) {
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
149 c = cnvs->data;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
150 timestamp_new_convo(c);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
151 }
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
152 }
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
153
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
154
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
155
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
156 static void set_timestamp(GtkWidget *button, GtkWidget *spinner) {
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
157 int tm;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
158
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
159 tm = 0;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
160
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
161 tm = CLAMP(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinner)), 1, G_MAXINT);
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
162 gaim_debug(GAIM_DEBUG_MISC, "timestamp", "setting time to %d mins\n", tm);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
163
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
164 tm = tm * 60 * 1000;
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
165
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
166 interval = tm;
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
167 gaim_prefs_set_int("/plugins/gtk/timestamp/interval", interval);
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
168
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
169 destroy_timer_list();
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
170 init_timer_list();
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
171 }
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
172
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
173 static GtkWidget *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
174 get_config_frame(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
175 {
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
176 GtkWidget *ret;
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
177 GtkWidget *frame, *label;
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
178 GtkWidget *vbox, *hbox;
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
179 GtkAdjustment *adj;
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
180 GtkWidget *spinner, *button;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
181
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
182 ret = gtk_vbox_new(FALSE, 18);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
183 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
184
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
185 frame = gaim_gtk_make_frame(ret, _("iChat Timestamp"));
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
186 vbox = gtk_vbox_new(FALSE, 5);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
187 gtk_container_add(GTK_CONTAINER(frame), vbox);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
188
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
189 hbox = gtk_hbox_new(FALSE, 5);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
190 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
191
4586
c7986b4d182a [gaim-migrate @ 4870]
Luke Schierer <lschiere@pidgin.im>
parents: 4475
diff changeset
192 label = gtk_label_new(_("Delay"));
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
193 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
194
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
195 adj = (GtkAdjustment *)gtk_adjustment_new(interval/(60*1000), 1, G_MAXINT, 1, 0, 0);
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
196 spinner = gtk_spin_button_new(adj, 0, 0);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
197 gtk_box_pack_start(GTK_BOX(hbox), spinner, TRUE, TRUE, 0);
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
198
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
199 label = gtk_label_new(_("minutes."));
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
200 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
201
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
202 hbox = gtk_hbox_new(TRUE, 5);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
203 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
204
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
205 button = gtk_button_new_with_mnemonic(_("_Apply"));
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
206 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
207 g_signal_connect(G_OBJECT(button), "clicked",
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
208 G_CALLBACK(set_timestamp), spinner);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
209
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
210 gtk_widget_show_all(ret);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
211 return ret;
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
212 }
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
213
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
214 static gboolean
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
215 plugin_load(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
216 {
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
217 void *conv_handle = gaim_conversations_get_handle();
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
218
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
219 init_timer_list();
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
221 gaim_signal_connect(conv_handle, "conversation-created",
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
222 plugin, GAIM_CALLBACK(timestamp_new_convo), NULL);
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
223
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
224 //record IM display events for each conversation
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
225 gaim_signal_connect(conv_handle, "receiving-im-msg",
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
226 plugin, GAIM_CALLBACK(timestamp_receiving_msg), NULL);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
227 gaim_signal_connect(conv_handle, "displaying-im-msg",
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
228 plugin, GAIM_CALLBACK(timestamp_displaying_conv_msg), NULL);
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
229
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
230 interval = gaim_prefs_get_int("/plugins/gtk/timestamp/interval");
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
231
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
232 return TRUE;
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
233 }
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
235
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
236
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
237 static gboolean
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
238 plugin_unload(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
239 {
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
240 void *conv_handle = gaim_conversations_get_handle();
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
241
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
242 gaim_signal_disconnect(conv_handle, "conversation-created",
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
243 plugin, GAIM_CALLBACK(timestamp_new_convo));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
244 gaim_signal_disconnect(conv_handle, "receiving-im-msg",
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
245 plugin, GAIM_CALLBACK(timestamp_receiving_msg));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
246 gaim_signal_disconnect(conv_handle, "displaying-im-msg",
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
247 plugin, GAIM_CALLBACK(timestamp_displaying_conv_msg));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
248
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
249 destroy_timer_list();
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
250 return TRUE;
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
251 }
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
252
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
253 static GaimGtkPluginUiInfo ui_info =
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
254 {
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
255 get_config_frame
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
256 };
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
257
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
258 static GaimPluginInfo info =
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
259 {
8749
d7b8eb1f0a18 [gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents: 7238
diff changeset
260 GAIM_PLUGIN_API_VERSION, /**< api_version */
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
261 GAIM_PLUGIN_STANDARD, /**< type */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
262 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
263 0, /**< flags */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
264 NULL, /**< dependencies */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
265 GAIM_PRIORITY_DEFAULT, /**< priority */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
266
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
267 TIMESTAMP_PLUGIN_ID, /**< id */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
268 N_("Timestamp"), /**< name */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
269 VERSION, /**< version */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
270 /** summary */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
271 N_("Adds iChat-style timestamps to conversations every N minutes."),
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
272 /** description */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
273 N_("Adds iChat-style timestamps to conversations every N minutes."),
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
274 "Sean Egan <bj91704@binghamton.edu>", /**< author */
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
275 GAIM_WEBSITE, /**< homepage */
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
276
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
277 plugin_load, /**< load */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
278 plugin_unload, /**< unload */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
279 NULL, /**< destroy */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
280
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
281 &ui_info, /**< ui_info */
8993
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8866
diff changeset
282 NULL, /**< extra_info */
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8866
diff changeset
283 NULL,
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8866
diff changeset
284 NULL
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
285 };
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
286
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
287 static void
5920
7d385de2f9cd [gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents: 5873
diff changeset
288 init_plugin(GaimPlugin *plugin)
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
289 {
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
290 gaim_prefs_add_none("/plugins/gtk/timestamp");
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
291 gaim_prefs_add_int("/plugins/gtk/timestamp/interval", interval);
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
292 }
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
293
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
294 GAIM_INIT_PLUGIN(interval, init_plugin, info)