annotate plugins/timestamp.c @ 12701:0a4996f15509

[gaim-migrate @ 15044] SF Patch #1396122 from Casey Harkins "This is a simple patch which will hide the extra separator in the popular statuses section when there are no popular statuses. Prevents the double separators." committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Tue, 03 Jan 2006 18:20:20 +0000
parents 71299d63801d
children e1e5462b7d81
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
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
23 #include "internal.h"
4202
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4201
diff changeset
24
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
25 #include "conversation.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
26 #include "debug.h"
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
27 #include "prefs.h"
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
28 #include "signals.h"
9943
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9863
diff changeset
29 #include "version.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
30
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include "gtkimhtml.h"
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
32 #include "gtkplugin.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
33 #include "gtkutils.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
34
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
35 #define TIMESTAMP_PLUGIN_ID "gtk-timestamp"
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36
6050
72403c3c84e1 [gaim-migrate @ 6500]
Mark Doliner <mark@kingant.net>
parents: 5920
diff changeset
37 /* Set the default to 5 minutes. */
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
38 static int interval = 5 * 60 * 1000;
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
40 static GSList *timestamp_timeouts = NULL;
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
42 static gboolean
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
43 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;
10389
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
46 GaimGtkConversation *conv = GAIM_GTK_CONVERSATION(c);
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
47 GtkTextIter iter;
10390
de92a8da82c3 [gaim-migrate @ 11617]
Sean Egan <seanegan@gmail.com>
parents: 10389
diff changeset
48 char mdate[7];
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
49 int is_conversation_active;
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 time_t tim = time(NULL);
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
51
4376
2c985a9e994c [gaim-migrate @ 4642]
Christian Hammond <chipx86@chipx86.com>
parents: 4359
diff changeset
52 if (!g_list_find(gaim_get_conversations(), c))
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 return FALSE;
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
55 /* 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
56 is_conversation_active = GPOINTER_TO_INT(gaim_conversation_get_data(c, "timestamp-conv-active"));
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
57
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
58 if (is_conversation_active){
10400
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
59 int y, height;
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
60 GdkRectangle rect;
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
61 gboolean scroll = TRUE;
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
62 GtkWidget *imhtml = conv->imhtml;
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
63 GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(imhtml));
10389
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
64 gtk_text_buffer_get_end_iter(buffer, &iter);
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
65 gaim_conversation_set_data(c, "timestamp-conv-active", GINT_TO_POINTER(FALSE));
10390
de92a8da82c3 [gaim-migrate @ 11617]
Sean Egan <seanegan@gmail.com>
parents: 10389
diff changeset
66 strftime(mdate, sizeof(mdate), "\n%H:%M", localtime(&tim));
10400
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
67 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(imhtml), &rect);
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
68 gtk_text_view_get_line_yrange(GTK_TEXT_VIEW(imhtml), &iter, &y, &height);
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
69 if(((y + height) - (rect.y + rect.height)) > height
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
70 && gtk_text_buffer_get_char_count(buffer)){
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
71 scroll = FALSE;
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
72 }
10389
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
73 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, mdate, strlen(mdate), "TIMESTAMP", NULL);
10400
6a043ae92db6 [gaim-migrate @ 11631]
Sean Egan <seanegan@gmail.com>
parents: 10390
diff changeset
74 if (scroll)
12560
d6b513c74e1f [gaim-migrate @ 14879]
Richard Laager <rlaager@wiktel.com>
parents: 12559
diff changeset
75 gtk_imhtml_scroll_to_end(GTK_IMHTML(imhtml), gaim_prefs_get_bool("/gaim/gtk/conversations/use_smooth_scrolling"));
9191
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 else
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
78 gaim_conversation_set_data(c, "timestamp-enabled", GINT_TO_POINTER(FALSE));
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
79
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80 return TRUE;
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81 }
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
83
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
84 static gboolean
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
85 timestamp_displaying_conv_msg(GaimAccount *account, GaimConversation *conv,
12604
71299d63801d [gaim-migrate @ 14939]
Richard Laager <rlaager@wiktel.com>
parents: 12600
diff changeset
86 char **buffer, GaimMessageFlags flags, void *data)
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
87 {
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
88 int is_timestamp_enabled;
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
89
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
90 if (!g_list_find(gaim_get_conversations(), conv))
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
91 return FALSE;
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
92
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
93 /* 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
94 gaim_conversation_set_data(conv, "timestamp-conv-active", GINT_TO_POINTER(TRUE));
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
95
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
96 is_timestamp_enabled = GPOINTER_TO_INT(gaim_conversation_get_data(conv, "timestamp-enabled"));
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
97
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
98 if (!is_timestamp_enabled){
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
99 gaim_conversation_set_data(conv, "timestamp-enabled", GINT_TO_POINTER(TRUE));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
100 do_timestamp((gpointer)conv);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
101 }
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
102
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
103 return FALSE;
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 {
10389
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
108 GaimGtkConversation *c = GAIM_GTK_CONVERSATION(conv);
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
109
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
110 if (!g_list_find(gaim_get_conversations(), conv))
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
111 return;
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
112
10389
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
113 gtk_imhtml_show_comments(GTK_IMHTML(c->imhtml), FALSE);
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
114
9191
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 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
117 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
118 with a new timestamp when the user modifies the timer interval.
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
119 */
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
120 if (!gaim_conversation_get_data(conv, "timestamp-initialized")){
10389
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
121 GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(c->imhtml));
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
122 gaim_conversation_set_data(conv, "timestamp-initialized", GINT_TO_POINTER(TRUE));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
123 gaim_conversation_set_data(conv, "timestamp-enabled", GINT_TO_POINTER(TRUE));
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
124 gaim_conversation_set_data(conv, "timestamp-conv-active", GINT_TO_POINTER(TRUE));
10389
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
125 gtk_text_buffer_create_tag (buffer, "TIMESTAMP", "foreground", "#888888", "justification", GTK_JUSTIFY_CENTER,
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
126 "weight", PANGO_WEIGHT_BOLD, NULL);
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
127 do_timestamp(conv);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
128 }
4168
ebfb80bbe1ed [gaim-migrate @ 4397]
Luke Schierer <lschiere@pidgin.im>
parents: 4113
diff changeset
129
3727
dadb43e0bcae [gaim-migrate @ 3864]
Luke Schierer <lschiere@pidgin.im>
parents: 3598
diff changeset
130 timestamp_timeouts = g_slist_append(timestamp_timeouts,
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
131 GINT_TO_POINTER(g_timeout_add(interval, do_timestamp, conv)));
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
132 }
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
133
9191
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 static void destroy_timer_list()
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 GSList *to;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
138
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
139 for (to = timestamp_timeouts; to != NULL; to = to->next)
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
140 g_source_remove(GPOINTER_TO_INT(to->data));
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 g_slist_free(timestamp_timeouts);
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
143
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
144 timestamp_timeouts = NULL;
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145 }
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
146
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
147 static void init_timer_list()
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
148 {
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
149 GList *cnvs;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
150 GaimConversation *c;
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
151
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
152 if (timestamp_timeouts != NULL)
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
153 destroy_timer_list();
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
154
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
155 for (cnvs = gaim_get_conversations(); cnvs != NULL; cnvs = cnvs->next) {
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
156 c = cnvs->data;
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
157 timestamp_new_convo(c);
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
158 }
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
159 }
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
160
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
161
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
162
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 11256
diff changeset
163 static void set_timestamp(GtkWidget *spinner, void *null) {
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
164 int tm;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
165
12204
2c7e79b6d7b2 [gaim-migrate @ 14506]
Richard Laager <rlaager@wiktel.com>
parents: 11740
diff changeset
166 tm = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinner));
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
167 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
168
12204
2c7e79b6d7b2 [gaim-migrate @ 14506]
Richard Laager <rlaager@wiktel.com>
parents: 11740
diff changeset
169 interval = tm * 60 * 1000;
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
170 gaim_prefs_set_int("/plugins/gtk/timestamp/interval", interval);
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
171
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
172 destroy_timer_list();
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
173 init_timer_list();
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
174 }
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
175
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
176 static GtkWidget *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
177 get_config_frame(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
178 {
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
179 GtkWidget *ret;
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
180 GtkWidget *frame, *label;
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
181 GtkWidget *vbox, *hbox;
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
182 GtkAdjustment *adj;
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 11256
diff changeset
183 GtkWidget *spinner;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
184
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
185 ret = gtk_vbox_new(FALSE, 18);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
186 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
187
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
188 frame = gaim_gtk_make_frame(ret, _("iChat Timestamp"));
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
189 vbox = gtk_vbox_new(FALSE, 5);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
190 gtk_container_add(GTK_CONTAINER(frame), vbox);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
191
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
192 hbox = gtk_hbox_new(FALSE, 5);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
193 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
194
4586
c7986b4d182a [gaim-migrate @ 4870]
Luke Schierer <lschiere@pidgin.im>
parents: 4475
diff changeset
195 label = gtk_label_new(_("Delay"));
4220
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
196 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
197
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
198 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
199 spinner = gtk_spin_button_new(adj, 0, 0);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
200 gtk_box_pack_start(GTK_BOX(hbox), spinner, TRUE, TRUE, 0);
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 11256
diff changeset
201 g_signal_connect(G_OBJECT(spinner), "value-changed", G_CALLBACK(set_timestamp), NULL);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
202 label = gtk_label_new(_("minutes."));
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
203 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
204
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
205 gtk_widget_show_all(ret);
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
206 return ret;
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
207 }
0cff8ec38935 [gaim-migrate @ 4464]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
208
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
209 static gboolean
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
210 plugin_load(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
211 {
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
212 void *conv_handle = gaim_conversations_get_handle();
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
213
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
214 init_timer_list();
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
216 gaim_signal_connect(conv_handle, "conversation-created",
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
217 plugin, GAIM_CALLBACK(timestamp_new_convo), NULL);
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
218
9863
0e3a84f18467 [gaim-migrate @ 10742]
Mark Doliner <mark@kingant.net>
parents: 9191
diff changeset
219 /* record IM display events for each conversation */
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
220 gaim_signal_connect(conv_handle, "displaying-im-msg",
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
221 plugin, GAIM_CALLBACK(timestamp_displaying_conv_msg), NULL);
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
222
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
223 interval = gaim_prefs_get_int("/plugins/gtk/timestamp/interval");
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
224
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
225 return TRUE;
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
226 }
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
228
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
229
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
230 static gboolean
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
231 plugin_unload(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
232 {
10389
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
233 GList *cnvs;
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
234
9191
06b28fb24300 [gaim-migrate @ 9986]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
235 destroy_timer_list();
10389
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
236
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
237 for (cnvs = gaim_get_conversations(); cnvs != NULL; cnvs = cnvs->next) {
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
238 GaimConversation *c = cnvs->data;
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
239 GaimGtkConversation *conv = GAIM_GTK_CONVERSATION(c);
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
240 gtk_imhtml_show_comments(GTK_IMHTML(conv->imhtml), TRUE);
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
241 }
c432b927b0b1 [gaim-migrate @ 11616]
Sean Egan <seanegan@gmail.com>
parents: 10104
diff changeset
242
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
243 return TRUE;
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
244 }
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
245
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
246 static GaimGtkPluginUiInfo ui_info =
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
247 {
12600
e856f985a0b9 [gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents: 12560
diff changeset
248 get_config_frame,
e856f985a0b9 [gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents: 12560
diff changeset
249 0 /* page_num (Reserved) */
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
250 };
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
251
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
252 static GaimPluginInfo info =
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
253 {
9943
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9863
diff changeset
254 GAIM_PLUGIN_MAGIC,
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9863
diff changeset
255 GAIM_MAJOR_VERSION,
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9863
diff changeset
256 GAIM_MINOR_VERSION,
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
257 GAIM_PLUGIN_STANDARD, /**< type */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
258 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
259 0, /**< flags */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
260 NULL, /**< dependencies */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
261 GAIM_PRIORITY_DEFAULT, /**< priority */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
262
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
263 TIMESTAMP_PLUGIN_ID, /**< id */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
264 N_("Timestamp"), /**< name */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
265 VERSION, /**< version */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
266 /** summary */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
267 N_("Adds iChat-style timestamps to conversations every N minutes."),
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
268 /** description */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
269 N_("Adds iChat-style timestamps to conversations every N minutes."),
12406
bc45ab9756b5 [gaim-migrate @ 14713]
Richard Laager <rlaager@wiktel.com>
parents: 12204
diff changeset
270 "Sean Egan <seanegan@gmail.com>", /**< author */
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
271 GAIM_WEBSITE, /**< homepage */
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
272
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
273 plugin_load, /**< load */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
274 plugin_unload, /**< unload */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
275 NULL, /**< destroy */
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 &ui_info, /**< ui_info */
8993
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8866
diff changeset
278 NULL, /**< extra_info */
10404
ce098e226486 [gaim-migrate @ 11649]
Mark Doliner <mark@kingant.net>
parents: 10400
diff changeset
279 NULL,
8993
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8866
diff changeset
280 NULL
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
281 };
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
282
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
283 static void
5920
7d385de2f9cd [gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents: 5873
diff changeset
284 init_plugin(GaimPlugin *plugin)
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4586
diff changeset
285 {
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
286 gaim_prefs_add_none("/plugins/gtk/timestamp");
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
287 gaim_prefs_add_int("/plugins/gtk/timestamp/interval", interval);
3598
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
288 }
c6f92ece3097 [gaim-migrate @ 3700]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
289
7237
5b94ddd51aa1 [gaim-migrate @ 7812]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
290 GAIM_INIT_PLUGIN(interval, init_plugin, info)