aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-utils.c20
-rw-r--r--libempathy/empathy-utils.h2
2 files changed, 21 insertions, 1 deletions
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 <extensions/extensions.h>
@@ -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);