aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-08 23:19:48 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-08 23:20:19 +0800
commit8022c4d5692acc7406f3fa3cb8cacb443c2b96d4 (patch)
treefef6bc2ba4526b54ff817346dab99317ea7538e2
parent5182ada04ef43baabccfcc46b1ff0ea754f572b0 (diff)
downloadgsoc2013-empathy-8022c4d5692acc7406f3fa3cb8cacb443c2b96d4.tar
gsoc2013-empathy-8022c4d5692acc7406f3fa3cb8cacb443c2b96d4.tar.gz
gsoc2013-empathy-8022c4d5692acc7406f3fa3cb8cacb443c2b96d4.tar.bz2
gsoc2013-empathy-8022c4d5692acc7406f3fa3cb8cacb443c2b96d4.tar.lz
gsoc2013-empathy-8022c4d5692acc7406f3fa3cb8cacb443c2b96d4.tar.xz
gsoc2013-empathy-8022c4d5692acc7406f3fa3cb8cacb443c2b96d4.tar.zst
gsoc2013-empathy-8022c4d5692acc7406f3fa3cb8cacb443c2b96d4.zip
Use the account manager to set the presence
-rw-r--r--libempathy/empathy-idle.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c
index 5d2fa2bdc..9b34fc7f1 100644
--- a/libempathy/empathy-idle.c
+++ b/libempathy/empathy-idle.c
@@ -33,6 +33,7 @@
#include <telepathy-glib/util.h>
#include <libmissioncontrol/mc-enum-types.h>
+#include "empathy-account-manager.h"
#include "empathy-idle.h"
#include "empathy-utils.h"
@@ -63,6 +64,8 @@ typedef struct {
gboolean is_idle;
gboolean nm_connected;
guint ext_away_timeout;
+
+ EmpathyAccountManager *manager;
} EmpathyIdlePriv;
typedef enum {
@@ -296,6 +299,9 @@ idle_finalize (GObject *object)
g_object_unref (priv->gs_proxy);
}
+ if (priv->manager != NULL)
+ g_object_unref (priv->manager);
+
#ifdef HAVE_NM
if (priv->nm_client) {
g_object_unref (priv->nm_client);
@@ -482,6 +488,8 @@ empathy_idle_init (EmpathyIdle *idle)
idle->priv = priv;
priv->is_idle = FALSE;
priv->mc = empathy_mission_control_dup_singleton ();
+
+ priv->manager = empathy_account_manager_dup_singleton ();
priv->state = empathy_idle_get_actual_presence (idle, &error);
if (error) {
DEBUG ("Error getting actual presence: %s", error->message);
@@ -617,33 +625,12 @@ empathy_idle_do_set_presence (EmpathyIdle *idle,
TpConnectionPresenceType state,
const gchar *status)
{
- McPresence mc_state = MC_PRESENCE_UNSET;
EmpathyIdlePriv *priv = GET_PRIV (idle);
- switch (state) {
- case TP_CONNECTION_PRESENCE_TYPE_OFFLINE:
- mc_state = MC_PRESENCE_OFFLINE;
- break;
- case TP_CONNECTION_PRESENCE_TYPE_AVAILABLE:
- mc_state = MC_PRESENCE_AVAILABLE;
- break;
- case TP_CONNECTION_PRESENCE_TYPE_AWAY:
- mc_state = MC_PRESENCE_AWAY;
- break;
- case TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY:
- mc_state = MC_PRESENCE_EXTENDED_AWAY;
- break;
- case TP_CONNECTION_PRESENCE_TYPE_HIDDEN:
- mc_state = MC_PRESENCE_HIDDEN;
- break;
- case TP_CONNECTION_PRESENCE_TYPE_BUSY:
- mc_state = MC_PRESENCE_DO_NOT_DISTURB;
- break;
- default:
- g_assert_not_reached ();
- }
- mission_control_set_presence (priv->mc, mc_state, status, NULL, NULL);
+ /* FIXME */
+ empathy_account_manager_request_global_presence (priv->manager,
+ state, "available", status);
}
void