From 19817f5ad3220d7c9dc584c10c405e5a39ef6273 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 3 Apr 2014 17:02:08 +0100 Subject: Rewrite the protocol name for local-xmpp accounts created by Telepathy1 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77029 Reviewed-by: Xavier Claessens --- src/mcd-account.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mcd-account.c b/src/mcd-account.c index 86524127..7cc779d7 100644 --- a/src/mcd-account.c +++ b/src/mcd-account.c @@ -2976,6 +2976,18 @@ mcd_account_setup (McdAccount *account) goto broken_account; } + /* Be compatible with accounts loaded from Telepathy0 - + * silently translate local-xmpp into local_xmpp, etc. */ + if (strchr (priv->protocol_name, '-') != NULL) + { + g_strdelimit (priv->protocol_name, "-", '_'); + + if (!mcd_storage_set_string (storage, name, MC_ACCOUNTS_KEY_PROTOCOL, + priv->protocol_name)) + WARNING ("Unable to write modified protocol name '%s' back", + priv->protocol_name); + } + priv->object_path = g_strconcat (TP_ACCOUNT_OBJECT_PATH_BASE, name, NULL); priv->enabled = mcd_storage_get_boolean (storage, name, -- cgit v1.2.3