aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-02-16 19:14:16 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-02-17 00:43:30 +0800
commitfe9e5a3cac6397054f984a10916378792ce583ca (patch)
tree3d5903415441159be1c0b75d72bc2446e19a2fc7 /libempathy-gtk
parentfea6df61fd35261aeebe2a94128d472e284a7280 (diff)
downloadgsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar
gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar.gz
gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar.bz2
gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar.lz
gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar.xz
gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar.zst
gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.zip
Move should_create_salut_account to local-xmpp-assistant-widget
https://bugzilla.gnome.org/show_bug.cgi?id=652669
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-local-xmpp-assistant-widget.c25
-rw-r--r--libempathy-gtk/empathy-local-xmpp-assistant-widget.h5
2 files changed, 30 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-local-xmpp-assistant-widget.c b/libempathy-gtk/empathy-local-xmpp-assistant-widget.c
index 5cf8ce976..5d00fd229 100644
--- a/libempathy-gtk/empathy-local-xmpp-assistant-widget.c
+++ b/libempathy-gtk/empathy-local-xmpp-assistant-widget.c
@@ -280,3 +280,28 @@ empathy_local_xmpp_assistant_widget_create_account (
empathy_account_settings_apply_async (self->priv->settings,
apply_account_cb, NULL);
}
+
+gboolean
+empathy_local_xmpp_assistant_widget_should_create_account (
+ TpAccountManager *manager)
+{
+ gboolean salut_created = FALSE;
+ GList *accounts, *l;
+
+ accounts = tp_account_manager_get_valid_accounts (manager);
+
+ for (l = accounts; l != NULL; l = g_list_next (l))
+ {
+ TpAccount *account = TP_ACCOUNT (l->data);
+
+ if (!tp_strdiff (tp_account_get_protocol (account), "local-xmpp"))
+ {
+ salut_created = TRUE;
+ break;
+ }
+ }
+
+ g_list_free (accounts);
+
+ return !salut_created;
+}
diff --git a/libempathy-gtk/empathy-local-xmpp-assistant-widget.h b/libempathy-gtk/empathy-local-xmpp-assistant-widget.h
index edb9b6a40..996671fdc 100644
--- a/libempathy-gtk/empathy-local-xmpp-assistant-widget.h
+++ b/libempathy-gtk/empathy-local-xmpp-assistant-widget.h
@@ -23,6 +23,8 @@
#include <gtk/gtk.h>
+#include <telepathy-glib/telepathy-glib.h>
+
G_BEGIN_DECLS
#define EMPATHY_TYPE_LOCAL_XMPP_ASSISTANT_WIDGET (empathy_local_xmpp_assistant_widget_get_type ())
@@ -53,6 +55,9 @@ GtkWidget * empathy_local_xmpp_assistant_widget_new (void);
void empathy_local_xmpp_assistant_widget_create_account (
EmpathyLocalXmppAssistantWidget *self);
+gboolean empathy_local_xmpp_assistant_widget_should_create_account (
+ TpAccountManager *manager);
+
G_END_DECLS
#endif /* __EMPATHY_LOCAL_XMPP_ASSISTANT_WIDGET_H__ */