Mercurial > pidgin.yaz
annotate plugins/history.c @ 13624:ff70d3009409
[gaim-migrate @ 16011]
Leak fix.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Tue, 11 Apr 2006 16:45:07 +0000 |
parents | d4af79bc2d0a |
children | 8bda65b88e49 |
rev | line source |
---|---|
3598 | 1 /* Puts last 4k of log in new conversations a la Everybuddy (and then |
2 * stolen by Trillian "Pro") */ | |
3 | |
9791 | 4 #include "internal.h" |
5 #include "gtkgaim.h" | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
6 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
7 #include "conversation.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
8 #include "debug.h" |
7433 | 9 #include "log.h" |
11217
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
10 #include "notify.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
11 #include "prefs.h" |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
12 #include "signals.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
13 #include "util.h" |
9943 | 14 #include "version.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
15 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
16 #include "gtkconv.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
17 #include "gtkimhtml.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
18 #include "gtkplugin.h" |
4202
59751fe608c5
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4113
diff
changeset
|
19 |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6063
diff
changeset
|
20 #define HISTORY_PLUGIN_ID "gtk-history" |
3598 | 21 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
22 #define HISTORY_SIZE (4 * 1024) |
3598 | 23 |
8913 | 24 static gboolean _scroll_imhtml_to_end(gpointer data) |
25 { | |
26 GtkIMHtml *imhtml = data; | |
12558
5fcb5676e1dc
[gaim-migrate @ 14877]
Richard Laager <rlaager@wiktel.com>
parents:
12406
diff
changeset
|
27 gtk_imhtml_scroll_to_end(GTK_IMHTML(imhtml), FALSE); |
8913 | 28 g_object_unref(G_OBJECT(imhtml)); |
29 return FALSE; | |
30 } | |
31 | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
32 static void historize(GaimConversation *c) |
3598 | 33 { |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
34 GaimAccount *account = gaim_conversation_get_account(c); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
35 const char *name = gaim_conversation_get_name(c); |
8898 | 36 GaimConversationType convtype; |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
37 GList *logs = NULL; |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
38 const char *alias = name; |
7440 | 39 guint flags; |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
40 char *history; |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
41 GaimGtkConversation *gtkconv; |
3602 | 42 GtkIMHtmlOptions options = GTK_IMHTML_NO_COLOURS; |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
43 char *header; |
11814
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11605
diff
changeset
|
44 char *protocol; |
8898 | 45 |
46 convtype = gaim_conversation_get_type(c); | |
11605 | 47 gtkconv = GAIM_GTK_CONVERSATION(c); |
48 if (convtype == GAIM_CONV_TYPE_IM && g_list_length(gtkconv->convs) < 2) | |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
49 { |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
50 GSList *buddies; |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
51 GSList *cur; |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
52 |
11217
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
53 /* If we're not logging, don't show anything. |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
54 * Otherwise, we might show a very old log. */ |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
55 if (!gaim_prefs_get_bool("/core/logging/log_ims")) |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
56 return; |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
57 |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
58 /* Find buddies for this conversation. */ |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
59 buddies = gaim_find_buddies(account, name); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
60 |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
61 /* If we found at least one buddy, save the first buddy's alias. */ |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
62 if (buddies != NULL) |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
63 alias = gaim_buddy_get_contact_alias((GaimBuddy *)buddies->data); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
64 |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
65 for (cur = buddies; cur != NULL; cur = cur->next) |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
66 { |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
67 GaimBlistNode *node = cur->data; |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
68 if ((node != NULL) && ((node->prev != NULL) || (node->next != NULL))) |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
69 { |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
70 GaimBlistNode *node2; |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
71 |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
72 alias = gaim_buddy_get_contact_alias((GaimBuddy *)node); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
73 |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
74 /* We've found a buddy that matches this conversation. It's part of a |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
75 * GaimContact with more than one GaimBuddy. Loop through the GaimBuddies |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
76 * in the contact and get all the logs. */ |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
77 for (node2 = node->parent->child ; node2 != NULL ; node2 = node2->next) |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
78 { |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
79 logs = g_list_concat( |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
80 gaim_log_get_logs(GAIM_LOG_IM, |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
81 gaim_buddy_get_name((GaimBuddy *)node2), |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
82 gaim_buddy_get_account((GaimBuddy *)node2)), |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
83 logs); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
84 } |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
85 break; |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
86 } |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
87 } |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
88 g_slist_free(buddies); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
89 |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
90 if (logs == NULL) |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
91 logs = gaim_log_get_logs(GAIM_LOG_IM, name, account); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
92 else |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
93 logs = g_list_sort(logs, gaim_log_compare); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
94 } |
11338 | 95 else if (convtype == GAIM_CONV_TYPE_CHAT) |
11217
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
96 { |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
97 /* If we're not logging, don't show anything. |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
98 * Otherwise, we might show a very old log. */ |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
99 if (!gaim_prefs_get_bool("/core/logging/log_chats")) |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
100 return; |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
101 |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
102 logs = gaim_log_get_logs(GAIM_LOG_CHAT, name, account); |
11217
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
103 } |
7440 | 104 |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
105 if (logs == NULL) |
3598 | 106 return; |
8898 | 107 |
7433 | 108 history = gaim_log_read((GaimLog*)logs->data, &flags); |
109 gtkconv = GAIM_GTK_CONVERSATION(c); | |
110 if (flags & GAIM_LOG_READ_NO_NEWLINE) | |
3602 | 111 options |= GTK_IMHTML_NO_NEWLINE; |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
112 |
11814
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11605
diff
changeset
|
113 protocol = g_strdup(gtk_imhtml_get_protocol_name(GTK_IMHTML(gtkconv->imhtml))); |
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11605
diff
changeset
|
114 gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml), |
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11605
diff
changeset
|
115 gaim_account_get_protocol_name(((GaimLog*)logs->data)->account)); |
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11605
diff
changeset
|
116 |
13337
d4af79bc2d0a
[gaim-migrate @ 15707]
Richard Laager <rlaager@wiktel.com>
parents:
13332
diff
changeset
|
117 if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)))) |
d4af79bc2d0a
[gaim-migrate @ 15707]
Richard Laager <rlaager@wiktel.com>
parents:
13332
diff
changeset
|
118 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR>", options); |
d4af79bc2d0a
[gaim-migrate @ 15707]
Richard Laager <rlaager@wiktel.com>
parents:
13332
diff
changeset
|
119 |
13332
97545c71d208
[gaim-migrate @ 15702]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
120 header = g_strdup_printf(_("<b>Conversation with %s on %s:</b><br>"), alias, |
13119
fcde3faa1f57
[gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents:
13104
diff
changeset
|
121 gaim_date_format_full(localtime(&((GaimLog *)logs->data)->time))); |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
122 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), header, options); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
123 g_free(header); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
124 |
13337
d4af79bc2d0a
[gaim-migrate @ 15707]
Richard Laager <rlaager@wiktel.com>
parents:
13332
diff
changeset
|
125 g_strchomp(history); |
7433 | 126 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), history, options); |
127 g_free(history); | |
8898 | 128 |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
129 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<hr>", options); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
130 |
11814
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11605
diff
changeset
|
131 gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml), protocol); |
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11605
diff
changeset
|
132 g_free(protocol); |
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11605
diff
changeset
|
133 |
11051
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
134 g_object_ref(G_OBJECT(gtkconv->imhtml)); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
135 g_idle_add(_scroll_imhtml_to_end, gtkconv->imhtml); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
136 |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
137 g_list_foreach(logs, (GFunc)gaim_log_free, NULL); |
5290afac047c
[gaim-migrate @ 12989]
Richard Laager <rlaager@wiktel.com>
parents:
10764
diff
changeset
|
138 g_list_free(logs); |
3598 | 139 } |
140 | |
11217
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
141 static void |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
142 history_prefs_check(GaimPlugin *plugin) |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
143 { |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
144 if (!gaim_prefs_get_bool("/core/logging/log_ims") && |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
145 !gaim_prefs_get_bool("/core/logging/log_chats")) |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
146 { |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
147 gaim_notify_warning(plugin, NULL, _("History Plugin Requires Logging"), |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
148 _("Logging can be enabled from Tools -> Preferences -> Logging.\n\n" |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
149 "Enabling logs for instant messages and/or chats will activate " |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
150 "history for the same conversation type(s).")); |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
151 } |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
152 } |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
153 |
12816 | 154 static void history_prefs_cb(const char *name, GaimPrefType type, |
155 gconstpointer val, gpointer data) | |
11217
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
156 { |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
157 history_prefs_check((GaimPlugin *)data); |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
158 } |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
159 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
160 static gboolean |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
161 plugin_load(GaimPlugin *plugin) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
162 { |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
163 gaim_signal_connect(gaim_conversations_get_handle(), |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
164 "conversation-created", |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
165 plugin, GAIM_CALLBACK(historize), NULL); |
3598 | 166 |
11217
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
167 gaim_prefs_connect_callback(plugin, "/core/logging/log_ims", |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
168 history_prefs_cb, plugin); |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
169 gaim_prefs_connect_callback(plugin, "/core/logging/log_chats", |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
170 history_prefs_cb, plugin); |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
171 |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
172 history_prefs_check(plugin); |
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
173 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
174 return TRUE; |
3598 | 175 } |
176 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
177 static GaimPluginInfo info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
178 { |
9943 | 179 GAIM_PLUGIN_MAGIC, |
180 GAIM_MAJOR_VERSION, | |
181 GAIM_MINOR_VERSION, | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
182 GAIM_PLUGIN_STANDARD, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
183 GAIM_GTK_PLUGIN_TYPE, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
184 0, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
185 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
186 GAIM_PRIORITY_DEFAULT, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
187 HISTORY_PLUGIN_ID, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
188 N_("History"), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
189 VERSION, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
190 N_("Shows recently logged conversations in new conversations."), |
11217
f854402837ba
[gaim-migrate @ 13349]
Richard Laager <rlaager@wiktel.com>
parents:
11051
diff
changeset
|
191 N_("When a new conversation is opened this plugin will insert " |
12632
87f3542b3701
[gaim-migrate @ 14968]
Richard Laager <rlaager@wiktel.com>
parents:
12558
diff
changeset
|
192 "the last conversation into the current conversation."), |
12406
bc45ab9756b5
[gaim-migrate @ 14713]
Richard Laager <rlaager@wiktel.com>
parents:
11814
diff
changeset
|
193 "Sean Egan <seanegan@gmail.com>", |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6063
diff
changeset
|
194 GAIM_WEBSITE, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
195 plugin_load, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
196 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
197 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
198 NULL, |
8993 | 199 NULL, |
11318 | 200 NULL, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
201 NULL |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
202 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
203 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
204 static void |
5920
7d385de2f9cd
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5873
diff
changeset
|
205 init_plugin(GaimPlugin *plugin) |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
206 { |
3598 | 207 } |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5114
diff
changeset
|
208 |
6063 | 209 GAIM_INIT_PLUGIN(history, init_plugin, info) |