From 13ef586215d888a939e8f34c44f703b93aa916c7 Mon Sep 17 00:00:00 2001 From: xclaesse Date: Fri, 30 Jan 2009 17:08:04 +0000 Subject: Move empathy_notification_is_enabled () to src/ git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@2294 4ee84921-47dd-4033-b63a-18d7a039a3e4 --- libempathy/empathy-utils.c | 20 ++++++++++++++++++++ libempathy/empathy-utils.h | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'libempathy') diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index e4ada9f80..bda638dff 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -41,6 +41,7 @@ #include "empathy-contact-manager.h" #include "empathy-dispatcher.h" #include "empathy-dispatch-operation.h" +#include "empathy-idle.h" #include "empathy-tp-call.h" #include @@ -482,3 +483,22 @@ empathy_start_call_with_contact (EmpathyContact *contact) empathy_dispatcher_call_with_contact (contact, empathy_call_request_cb, contact); } + +gboolean +empathy_check_available_state (void) +{ + McPresence presence; + EmpathyIdle *idle; + + idle = empathy_idle_dup_singleton (); + presence = empathy_idle_get_state (idle); + g_object_unref (idle); + + if (presence != MC_PRESENCE_AVAILABLE && + presence != MC_PRESENCE_UNSET) { + return FALSE; + } + + return TRUE; +} + diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index dc17353da..46fa193c0 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -87,7 +87,7 @@ McAccount * empathy_channel_get_account (TpChannel *channel); gboolean empathy_proxy_equal (gconstpointer a, gconstpointer b); guint empathy_proxy_hash (gconstpointer key); - +gboolean empathy_check_available_state (void); /* Temporary utility function, should be replaces by better voip infrastructure * soon */ void empathy_start_call_with_contact (EmpathyContact *contact); -- cgit v1.2.3