aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-08-25 05:05:34 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-08-25 05:05:34 +0800
commit8cbc5f2429a0160c79c55efac222b51982b50640 (patch)
treeb9d56946e8d25384b454b0d98be625fb6667bbe7 /src
parente43fc6201a4273b0b8db20477d2fc756baa7f7aa (diff)
downloadgsoc2013-empathy-8cbc5f2429a0160c79c55efac222b51982b50640.tar
gsoc2013-empathy-8cbc5f2429a0160c79c55efac222b51982b50640.tar.gz
gsoc2013-empathy-8cbc5f2429a0160c79c55efac222b51982b50640.tar.bz2
gsoc2013-empathy-8cbc5f2429a0160c79c55efac222b51982b50640.tar.lz
gsoc2013-empathy-8cbc5f2429a0160c79c55efac222b51982b50640.tar.xz
gsoc2013-empathy-8cbc5f2429a0160c79c55efac222b51982b50640.tar.zst
gsoc2013-empathy-8cbc5f2429a0160c79c55efac222b51982b50640.zip
Chech if there is already a Salut account before creating a new one and
2007-08-24 Xavier Claessens <xclaesse@gmail.com> * src/empathy.c: Chech if there is already a Salut account before creating a new one and add more debug messages. svn path=/trunk/; revision=269
Diffstat (limited to 'src')
-rw-r--r--src/empathy.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/empathy.c b/src/empathy.c
index 81fdf1e4b..e1a32a0b6 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -157,6 +157,7 @@ create_salut_account (void)
McProtocol *protocol;
gboolean salut_created;
McAccount *account;
+ GList *accounts;
EBook *book;
EContact *contact;
gchar *nickname = NULL;
@@ -166,6 +167,7 @@ create_salut_account (void)
gchar *email = NULL;
gchar *jid = NULL;
+ /* Check if we already created a salut account */
if (!empathy_conf_get_bool (empathy_conf_get(),
EMPATHY_PREFS_SALUT_ACCOUNT_CREATED,
&salut_created)) {
@@ -175,15 +177,22 @@ create_salut_account (void)
return;
}
+ empathy_debug (DEBUG_DOMAIN, "Try to add a salut account...");
+
+ /* Check if the salut CM is installed */
profile = mc_profile_lookup ("salut");
protocol = mc_profile_get_protocol (profile);
if (!protocol) {
+ empathy_debug (DEBUG_DOMAIN, "Salut not installed");
g_object_unref (profile);
return;
}
g_object_unref (protocol);
+ /* Get self EContact from EDS */
if (!e_book_get_self (&contact, &book, NULL)) {
+ empathy_debug (DEBUG_DOMAIN, "Failed to get self econtact");
+ g_object_unref (profile);
return;
}
@@ -191,6 +200,15 @@ create_salut_account (void)
EMPATHY_PREFS_SALUT_ACCOUNT_CREATED,
TRUE);
+ /* Check if there is already a salut account */
+ accounts = mc_accounts_list_by_profile (profile);
+ if (accounts) {
+ empathy_debug (DEBUG_DOMAIN, "There is already a salut account");
+ mc_accounts_list_free (accounts);
+ g_object_unref (profile);
+ return;
+ }
+
account = mc_account_create (profile);
mc_account_set_display_name (account, _("People nearby"));
@@ -210,6 +228,15 @@ create_salut_account (void)
published_name = g_strdup (g_get_real_name ());
}
+ empathy_debug (DEBUG_DOMAIN, "Salut account created:\n"
+ " nickname=%s\n"
+ " published-name=%s\n"
+ " first-name=%s\n"
+ " last-name=%s\n"
+ " email=%s\n"
+ " jid=%s\n",
+ nickname, published_name, first_name, last_name, email, jid);
+
mc_account_set_param_string (account, "nickname", nickname ? nickname : "");
mc_account_set_param_string (account, "published-name", published_name ? published_name : "");
mc_account_set_param_string (account, "first-name", first_name ? first_name : "");