aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-01-07 00:46:07 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-07 00:46:07 +0800
commitca2a03e84bd231e8e9c8522f42778493c977a478 (patch)
treec14f9df6e74ed26e9019aaa03ec7755fbb29ad10 /src
parent7b293aff4cbfa6f28b906d72605813c40b7b0ed6 (diff)
downloadgsoc2013-empathy-ca2a03e84bd231e8e9c8522f42778493c977a478.tar
gsoc2013-empathy-ca2a03e84bd231e8e9c8522f42778493c977a478.tar.gz
gsoc2013-empathy-ca2a03e84bd231e8e9c8522f42778493c977a478.tar.bz2
gsoc2013-empathy-ca2a03e84bd231e8e9c8522f42778493c977a478.tar.lz
gsoc2013-empathy-ca2a03e84bd231e8e9c8522f42778493c977a478.tar.xz
gsoc2013-empathy-ca2a03e84bd231e8e9c8522f42778493c977a478.tar.zst
gsoc2013-empathy-ca2a03e84bd231e8e9c8522f42778493c977a478.zip
Don't emit sound when changing state and properly play login sound.
svn path=/trunk/; revision=2027
Diffstat (limited to 'src')
-rw-r--r--src/empathy-main-window.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index ced1d68e3..58c4a0184 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -36,6 +36,7 @@
#include <libempathy/empathy-contact-list.h>
#include <libempathy/empathy-contact-manager.h>
#include <libempathy/empathy-contact-factory.h>
+#include <libempathy/empathy-idle.h>
#include <libempathy/empathy-status-presets.h>
#include <libempathy-gtk/empathy-contact-dialogs.h>
@@ -1183,14 +1184,24 @@ main_window_status_changed_cb (MissionControl *mc,
if (status == TP_CONNECTION_STATUS_CONNECTED) {
GtkWidget *error_widget;
+ EmpathyIdle *idle;
- if (empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_SERVICE_LOGIN)) {
+ idle = empathy_idle_new ();
+
+ /* emit the sound only on first connect, i.e. when the saved
+ * idle state is MC_PRESENCE_UNSET.
+ */
+
+ if (empathy_idle_get_state (idle) == MC_PRESENCE_UNSET &&
+ empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_SERVICE_LOGIN)) {
ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
CA_PROP_EVENT_ID, "service-login",
CA_PROP_EVENT_DESCRIPTION, _("Connected to server"),
NULL);
}
+ g_object_unref (idle);
+
/* Account connected without error, remove error message if any */
error_widget = g_hash_table_lookup (window->errors, account);
if (error_widget) {