-
-gboolean
-modest_account_mgr_add_identity (ModestAccountMgr *self,
- const gchar *name,
- const gchar *email,
- const gchar *replyto,
- const gchar *signature,
- const gboolean use_signature,
- const gchar *id_via,
- const gboolean use_id_via)
-{
- ModestAccountMgrPrivate *priv;
- gchar *id_key, *key;
-
- g_return_val_if_fail (self, FALSE);
- g_return_val_if_fail (name, FALSE);
-
- /* TODO: check already exists */
-
- priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self);
- id_key = g_strconcat (MODEST_IDENTITY_NAMESPACE, "/",
- name, NULL);
-
- if (modest_conf_key_exists(priv->modest_conf, id_key, NULL)) {
- g_warning ("identity %s already exists", name);
- //g_free (id_key);
- //return FALSE;
- }
-
- /* email */
- key = g_strconcat (id_key, "/", MODEST_ACCOUNT_EMAIL, NULL);
- modest_conf_set_string (priv->modest_conf, key,
- null_means_empty(email), NULL);
- g_free (key);
-
- /* replyto */
- key = g_strconcat (id_key, "/", MODEST_ACCOUNT_REPLYTO, NULL);
- modest_conf_set_string (priv->modest_conf, key,
- null_means_empty(replyto), NULL);
- g_free (key);
-
- /* signature */
- key = g_strconcat (id_key, "/", MODEST_ACCOUNT_SIGNATURE, NULL);
- modest_conf_set_string (priv->modest_conf, key,
- null_means_empty(signature), NULL);
- g_free (key);
-
- /* use_signature */
- key = g_strconcat (id_key, "/", MODEST_ACCOUNT_USE_SIGNATURE, NULL);
- modest_conf_set_bool (priv->modest_conf, key,
- use_signature, NULL);
- g_free (key);
-
- /* signature */
- key = g_strconcat (id_key, "/", MODEST_ACCOUNT_ID_VIA, NULL);
- modest_conf_set_string (priv->modest_conf, key,
- null_means_empty(id_via), NULL);
- g_free (key);
-
- /* use_signature */
- key = g_strconcat (id_key, "/", MODEST_ACCOUNT_USE_ID_VIA, NULL);
- modest_conf_set_bool (priv->modest_conf, key,
- use_id_via, NULL);
- g_free (key);
- g_free (id_key);
-
- return TRUE; /* FIXME: better error checking */
-}
-