+ ModestTnyAccountStore *self = MODEST_TNY_ACCOUNT_STORE(user_data);
+
+ g_signal_emit (G_OBJECT(self), signals[UPDATE_ACCOUNTS_SIGNAL], 0,
+ account);
+}
+
+
+
+static gchar*
+get_password (TnyAccountIface *account, const gchar *prompt, gboolean *cancel)
+{
+
+ const gchar *key;
+ const TnyAccountStoreIface *account_store;
+ ModestTnyAccountStore *self;
+ ModestTnyAccountStorePrivate *priv;
+ gchar *retval;
+
+ g_return_val_if_fail (account, NULL);
+
+ key = tny_account_iface_get_id (account);
+ account_store = tny_account_iface_get_account_store(account);
+
+ self = MODEST_TNY_ACCOUNT_STORE (account_store);
+ priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
+
+ if (priv->pw_invalid==PW_NOT_INVALID) {
+ retval = modest_account_mgr_get_string (priv->modest_acc_mgr,
+ key,
+ MODEST_ACCOUNT_PASSWORD,
+ TRUE,
+ NULL);
+ } else {
+ retval = priv->get_pass_func(account, prompt, cancel);
+ if (!*cancel) {
+ priv->pw_invalid=PW_NOT_INVALID;
+ modest_account_mgr_set_string(priv->modest_acc_mgr,
+ key,
+ MODEST_ACCOUNT_PASSWORD,
+ retval, TRUE,
+ NULL);
+ }
+ }
+ return retval;
+}
+
+
+static void
+forget_password (TnyAccountIface *account) {
+
+ ModestTnyAccountStore *self;
+ ModestTnyAccountStorePrivate *priv;
+ const TnyAccountStoreIface *account_store;
+
+ account_store = tny_account_iface_get_account_store(account);
+ self = MODEST_TNY_ACCOUNT_STORE (account_store);
+ priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
+
+ priv->pw_invalid=PW_INVALID;
+}
+
+
+
+static TnyAccountIface*
+tny_account_from_name (ModestTnyAccountStore *self, const gchar *key, ModestProtoType modest_type)
+{
+ TnyAccountIface *tny_account;
+ ModestTnyAccountStorePrivate *priv;
+ gchar *val;
+
+ g_return_val_if_fail (self, NULL);
+ g_return_val_if_fail (key, NULL);
+
+ priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
+
+ /* is it a store or a transport? */
+ if (modest_type == MODEST_PROTO_TYPE_STORE)
+ tny_account = TNY_ACCOUNT_IFACE(tny_store_account_new ());
+ else if (modest_type == MODEST_PROTO_TYPE_TRANSPORT)
+ tny_account = TNY_ACCOUNT_IFACE(tny_transport_account_new ());
+ else
+ g_assert_not_reached ();
+
+ if (!tny_account) {
+ g_printerr ("modest: failed to create new tny account for '%s'\n",
+ key);
+ return NULL;