aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSankar P <psankar@novell.com>2005-07-15 17:37:38 +0800
committerSankarasivasubramanian Pasupathilingam <psankar@src.gnome.org>2005-07-15 17:37:38 +0800
commitdb57306c760e424b2baceadb236c452289acbbd7 (patch)
tree8841bed87cd693912a2859386d519358d3f77886
parent419bc22434fb1cbc6dd6210d9e5b56a55eb266bb (diff)
downloadgsoc2013-evolution-db57306c760e424b2baceadb236c452289acbbd7.tar
gsoc2013-evolution-db57306c760e424b2baceadb236c452289acbbd7.tar.gz
gsoc2013-evolution-db57306c760e424b2baceadb236c452289acbbd7.tar.bz2
gsoc2013-evolution-db57306c760e424b2baceadb236c452289acbbd7.tar.lz
gsoc2013-evolution-db57306c760e424b2baceadb236c452289acbbd7.tar.xz
gsoc2013-evolution-db57306c760e424b2baceadb236c452289acbbd7.tar.zst
gsoc2013-evolution-db57306c760e424b2baceadb236c452289acbbd7.zip
Put permissions on the store instead of the global structure as it gets
2005-07-15 Sankar P <psankar@novell.com> * proxy-login.c: Put permissions on the store instead of the global structure as it gets unref before store_add. svn path=/trunk/; revision=29776
-rw-r--r--plugins/proxy-login/ChangeLog5
-rw-r--r--plugins/proxy-login/proxy-login.c17
2 files changed, 13 insertions, 9 deletions
diff --git a/plugins/proxy-login/ChangeLog b/plugins/proxy-login/ChangeLog
index 4ac0d14abd..400caadc7e 100644
--- a/plugins/proxy-login/ChangeLog
+++ b/plugins/proxy-login/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-15 Sankar P <psankar@novell.com>
+
+ * proxy-login.c: Put permissions on the store instead of the
+ global structure as it gets unref before store_add.
+
2005-07-14 Not Zed <NotZed@Ximian.com>
* proxy-login.c (proxy_login_add_new_store): fixed the store
diff --git a/plugins/proxy-login/proxy-login.c b/plugins/proxy-login/proxy-login.c
index 090f23d4b1..57970ea171 100644
--- a/plugins/proxy-login/proxy-login.c
+++ b/plugins/proxy-login/proxy-login.c
@@ -146,7 +146,6 @@ proxy_login_init (GObject *object)
priv = g_new0 (proxyLoginPrivate, 1);
prd->priv = priv;
- prd->permissions = 0;
prd->proxy_list = NULL;
priv->xml = NULL;
priv->main = NULL;
@@ -323,6 +322,7 @@ proxy_soap_login (char *email)
char *proxy_source_url = NULL, *parent_source_url = NULL ;
char *name;
int i;
+ int permissions = 0;
for (i=0; email[i]!='\0' && email[i]!='@' ; i++);
if (email[i]=='@')
@@ -335,9 +335,8 @@ proxy_soap_login (char *email)
srcAccount = pld->account;
cnc = proxy_login_get_cnc(srcAccount);
proxy_get_password (srcAccount, &user_name, &password);
- pld->permissions = 0;
- proxy_cnc = e_gw_connection_get_proxy_connection (cnc, user_name, password, email, &pld->permissions);
-
+ proxy_cnc = e_gw_connection_get_proxy_connection (cnc, user_name, password, email, &permissions);
+
if (proxy_cnc) {
parent = camel_url_new (e_account_get_string(srcAccount, E_ACCOUNT_SOURCE_URL), NULL);
parent_source_url = camel_url_to_string (parent, CAMEL_URL_HIDE_PASSWORD);
@@ -355,6 +354,7 @@ proxy_soap_login (char *email)
e_account_list_add(accounts, dstAccount);
e_account_list_change (accounts, srcAccount);
e_account_list_save(accounts);
+ g_object_set_data ((GObject *)dstAccount, "permissions", permissions);
mail_get_store(e_account_get_string(dstAccount, E_ACCOUNT_SOURCE_URL), NULL, proxy_login_add_new_store, dstAccount);
g_free (proxy_source_url);
@@ -376,15 +376,14 @@ proxy_login_add_new_store (char *uri, CamelStore *store, void *user_data)
{
MailComponent *component = mail_component_peek ();
EAccount *account = user_data;
+ int permissions = g_object_get_data ((GObject *)account, "permissions");
+
if (store == NULL)
return;
- if (pld->permissions & E_GW_PROXY_MAIL_READ)
- store->mode |= CAMEL_STORE_READ;
- if (pld->permissions & E_GW_PROXY_MAIL_WRITE)
- store->mode |= CAMEL_STORE_WRITE;
+ if (!(permissions & E_GW_PROXY_MAIL_WRITE))
+ store->mode &= !CAMEL_STORE_WRITE;
- store->mode = pld->permissions;
store->flags |= CAMEL_STORE_PROXY;
mail_component_add_store (component, store, account->name);
}