aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-08 23:19:18 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-08 23:20:14 +0800
commit5182ada04ef43baabccfcc46b1ff0ea754f572b0 (patch)
tree2aab57e78a5b486a16341d983a55d9212b4aa350
parent6389342273e991e9b4c17d15fe82b709801a6983 (diff)
downloadgsoc2013-empathy-5182ada04ef43baabccfcc46b1ff0ea754f572b0.tar
gsoc2013-empathy-5182ada04ef43baabccfcc46b1ff0ea754f572b0.tar.gz
gsoc2013-empathy-5182ada04ef43baabccfcc46b1ff0ea754f572b0.tar.bz2
gsoc2013-empathy-5182ada04ef43baabccfcc46b1ff0ea754f572b0.tar.lz
gsoc2013-empathy-5182ada04ef43baabccfcc46b1ff0ea754f572b0.tar.xz
gsoc2013-empathy-5182ada04ef43baabccfcc46b1ff0ea754f572b0.tar.zst
gsoc2013-empathy-5182ada04ef43baabccfcc46b1ff0ea754f572b0.zip
Add a utility to set the presence on all requested accounts
-rw-r--r--libempathy/empathy-account-manager.c29
-rw-r--r--libempathy/empathy-account-manager.h6
2 files changed, 34 insertions, 1 deletions
diff --git a/libempathy/empathy-account-manager.c b/libempathy/empathy-account-manager.c
index c31ac0159..b443c2cd0 100644
--- a/libempathy/empathy-account-manager.c
+++ b/libempathy/empathy-account-manager.c
@@ -40,7 +40,6 @@
#define MC5_BUS_NAME "org.freedesktop.Telepathy.MissionControl5"
typedef struct {
-
/* (owned) unique name -> (reffed) EmpathyAccount */
GHashTable *accounts;
int connected;
@@ -874,3 +873,31 @@ empathy_account_manager_remove (EmpathyAccountManager *manager,
{
/* FIXME */
}
+
+
+void
+empathy_account_manager_request_global_presence (
+ EmpathyAccountManager *manager,
+ TpConnectionPresenceType type,
+ const gchar *status,
+ const gchar *message)
+{
+ /* FIXME should remember requested presence and set it on new accounts
+ as well */
+ EmpathyAccountManagerPriv *priv = GET_PRIV (manager);
+ GHashTableIter iter;
+ gpointer value;
+
+ g_hash_table_iter_init (&iter, priv->accounts);
+ while (g_hash_table_iter_next (&iter, NULL, &value))
+ {
+ EmpathyAccount *account = EMPATHY_ACCOUNT (value);
+ gboolean ready;
+
+ g_object_get (account, "ready", &ready, NULL);
+
+ if (ready)
+ empathy_account_request_presence (account, type, status, message);
+ }
+}
+
diff --git a/libempathy/empathy-account-manager.h b/libempathy/empathy-account-manager.h
index 2d77610fb..5d794bd83 100644
--- a/libempathy/empathy-account-manager.h
+++ b/libempathy/empathy-account-manager.h
@@ -81,6 +81,12 @@ void empathy_account_manager_remove (
EmpathyAccountManager *manager,
EmpathyAccount *account);
+void empathy_account_manager_request_global_presence (
+ EmpathyAccountManager *manager,
+ TpConnectionPresenceType type,
+ const gchar *status,
+ const gchar *message);
+
G_END_DECLS
#endif /* __EMPATHY_ACCOUNT_MANAGER_H__ */