--- a/src/gf_event.c Fri Jun 09 03:49:28 2006 -0400
+++ b/src/gf_event.c Sun Jun 18 07:51:34 2006 -0400
@@ -53,6 +53,13 @@
static GList *events = NULL;
+void *(*real_notify_email)(GaimConnection *gc, const char *subject, const char *from, + const char *to, const char *url); +void *(*real_notify_emails)(GaimConnection *gc, size_t count, gboolean detailed, + const char **subject, const char **from, + const char **to, const char **url); /*******************************************************************************
******************************************************************************/
@@ -586,52 +593,47 @@
/*******************************************************************************
******************************************************************************/
-gf_event_emails(size_t count, gboolean detailed, const gchar **subjects,
- const gchar **froms, const gchar **tos, const gchar **urls,
- GCallback cb, gpointer data)
+gf_event_email(GaimConnection *gc, const char *subject, const char *from, + const char *to, const char *url) + gf_event_common("new-email", gc->account, + gaim_find_buddy(gc->account, from), + NULL, from, NULL, GAIM_CBFLAGS_NONE, NULL, subject); + return real_notify_email(gc, subject, from, to, url);
+gf_event_emails(GaimConnection *gc, size_t count, gboolean detailed, + const char **subject, const char **from, + const char **to, const char **url) + if (count == 1 && subject && *subject) + return gf_event_email(gc, *subject, *from, *to, *url); + return real_notify_emails(gc, count, detailed, subject, from, to, url);
-gf_event_email(const gchar *subject, const gchar *from, const gchar *to,
- const gchar *url, GCallback cb, gpointer data)
- return gf_event_emails(1, TRUE,
- subject ? &subject : NULL,
-static GaimNotifyUiOps *notify_ops_orig = NULL, *notify_ops_new = NULL;
- g_return_if_fail(!notify_ops_new);
+ g_return_if_fail(!real_notify_email); - notify_ops_orig = gaim_notify_get_ui_ops();
+ GaimNotifyUiOps *notify_ops_orig = gaim_notify_get_ui_ops(); - notify_ops_new = g_memdup(notify_ops_orig, sizeof(GaimNotifyUiOps));
- notify_ops_new->notify_email = gf_event_email;
- notify_ops_new->notify_emails = gf_event_emails;
- gaim_notify_set_ui_ops(notify_ops_new);
+ real_notify_email = notify_ops_orig->notify_email; + notify_ops_orig->notify_email = gf_event_email; + real_notify_emails = notify_ops_orig->notify_emails; + notify_ops_orig->notify_emails = gf_event_emails; static void gf_event_email_uninit() {
- g_return_if_fail(notify_ops_new);
+ g_return_if_fail(real_notify_email); + GaimNotifyUiOps *notify_ops_orig = gaim_notify_get_ui_ops(); - gaim_notify_set_ui_ops(notify_ops_orig);
- g_free(notify_ops_new);
+ notify_ops_orig->notify_email = real_notify_email; + notify_ops_orig->notify_emails = real_notify_emails;
/*******************************************************************************
@@ -708,11 +710,9 @@
_("Displayed when a topic is changed in a chat."),
- gf_event_new("email", "%DdHhiMmNsTtuYy", _("Email"),
+ gf_event_new("new-email", TOKENS_DEFAULT "c", _("Email"), _("Displayed when you receive new email."),
GF_EVENT_PRIORITY_NORMAL);
gf_event_new(GF_NOTIFICATION_MASTER, TOKENS_DEFAULT "Ccnr",
_("Master"), _("Master notification for the theme editor."),
@@ -798,10 +798,8 @@
gaim_signal_connect(conv_handle, "chat-joined", plugin,
GAIM_CALLBACK(gf_event_conversation_throttle), NULL);
gaim_signal_connect(gaim_xfers_get_handle(), "file-recv-cancel", plugin,
GAIM_CALLBACK(gf_event_file_recv_cancel), "file-remote-cancel");
@@ -815,9 +813,7 @@
for(l = events; l; l = ll) {
--- a/themes/default/theme.xml Fri Jun 09 03:49:28 2006 -0400
+++ b/themes/default/theme.xml Sun Jun 18 07:51:34 2006 -0400
@@ -356,5 +356,23 @@
<text format='"%X" completed.' clipping='ellipsis-middle' width='0' />
+ <notification type='new-email' background='background.png'> + <position value='south-west' /> + <v_offset value='-5' /> + <icon type='protocol' size='little' /> + <position value='center' /> + <v_offset value='-25%' /> + <text format='Mail (%X) from' clipping='ellipsis-middle' width='0' /> + <position value='center' /> + <v_offset value='-13%' /> + <text format='%c (%a).' clipping='ellipsis-middle' width='0' />