From eaa91c2dea8e630e113025764d678c823761e1e6 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 18 Jul 2013 12:31:49 +0200 Subject: Move empathy_check_available_state() from utils to sound-manager It is used only from one place, there is no reason to have it in utils. https://bugzilla.gnome.org/show_bug.cgi?id=704454 --- libempathy-gtk/empathy-sound-manager.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-sound-manager.c b/libempathy-gtk/empathy-sound-manager.c index 600816f67..4f69c62db 100644 --- a/libempathy-gtk/empathy-sound-manager.c +++ b/libempathy-gtk/empathy-sound-manager.c @@ -23,6 +23,7 @@ #include #include "empathy-gsettings.h" +#include "empathy-presence-manager.h" #include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER @@ -161,6 +162,23 @@ empathy_sound_manager_dup_singleton (void) return manager; } +static gboolean +empathy_check_available_state (void) +{ + TpConnectionPresenceType presence; + EmpathyPresenceManager *presence_mgr; + + presence_mgr = empathy_presence_manager_dup_singleton (); + presence = empathy_presence_manager_get_state (presence_mgr); + g_object_unref (presence_mgr); + + if (presence != TP_CONNECTION_PRESENCE_TYPE_AVAILABLE && + presence != TP_CONNECTION_PRESENCE_TYPE_UNSET) + return FALSE; + + return TRUE; +} + static gboolean empathy_sound_pref_is_enabled (EmpathySoundManager *self, EmpathySound sound_id) -- cgit v1.2.3