aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-session.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-session.c')
-rw-r--r--mail/mail-session.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/mail/mail-session.c b/mail/mail-session.c
index 52bfba7497..081c6aa533 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -763,21 +763,47 @@ get_folder (CamelFilterDriver *d, const char *uri, void *data, CamelException *e
return mail_tool_uri_to_folder (uri, 0, ex);
}
+
static void
-session_play_sound (CamelFilterDriver *driver, const char *filename, gpointer user_data)
+main_play_sound (CamelFilterDriver *driver, const char *filename, gpointer user_data)
{
- if (!filename || !*filename)
- gdk_beep ();
- else
+ if (filename && *filename)
gnome_sound_play (filename);
+ else
+ gdk_beep ();
+
+ g_free (filename);
+ camel_object_unref (session);
}
static void
-session_system_beep (CamelFilterDriver *driver, gpointer user_data)
+session_play_sound (CamelFilterDriver *driver, const char *filename, gpointer user_data)
+{
+ MailSession *ms = (MailSession *) session;
+
+ camel_object_ref (session);
+
+ mail_async_event_emit (ms->async, MAIL_ASYNC_GUI, (MailAsyncFunc) main_play_sound,
+ driver, g_strdup (filename), user_data);
+}
+
+static void
+main_system_beep (CamelFilterDriver *driver, gpointer user_data)
{
gdk_beep ();
}
+static void
+session_system_beep (CamelFilterDriver *driver, gpointer user_data)
+{
+ MailSession *ms = (MailSession *) session;
+
+ camel_object_ref (session);
+
+ mail_async_event_emit (ms->async, MAIL_ASYNC_GUI, (MailAsyncFunc) main_system_beep,
+ driver, user_data, NULL);
+}
+
static CamelFilterDriver *
main_get_filter_driver (CamelSession *session, const char *type, CamelException *ex)
{