Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-exchange/ChangeLog,v
retrieving revision 1.396
diff -u -p -r1.396 ChangeLog
--- ChangeLog	8 Sep 2005 11:08:43 -0000	1.396
+++ ChangeLog	12 Sep 2005 09:10:19 -0000
@@ -1,3 +1,11 @@
+2005-09-12  Arunprakash  <arunp@novell.com>
+
+	* camel/camel-exchange-store.c (stub_notification) : Added code to
+	update the readonly flag of the camel folder.
+	* mail/mail-stub-exchange.c (folder_update_linestatus) : Notifies
+	the readonly flag change of the folder to camel stub.
+	** Fixes #311017.
+
 2005-09-08  Arunprakash  <arunp@novell.com>
 
 	* camel/camel-exchange-store.c (exchange_get_folder) : Reverted the
Index: camel/camel-exchange-store.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/camel/camel-exchange-store.c,v
retrieving revision 1.26
diff -u -p -r1.26 camel-exchange-store.c
--- camel/camel-exchange-store.c	8 Sep 2005 11:08:43 -0000	1.26
+++ camel/camel-exchange-store.c	12 Sep 2005 09:10:20 -0000
@@ -1061,6 +1061,27 @@ stub_notification (CamelObject *object, 
 		g_free (reninfo.old_base);
 		break;
 	}
+	
+	case CAMEL_STUB_RETVAL_FOLDER_SET_READONLY:
+	{
+		CamelFolder *folder;
+		gchar *folder_name;
+		guint32 readonly;
+
+		if (camel_stub_marshal_decode_folder (stub->status, &folder_name) == -1 ||
+		    camel_stub_marshal_decode_uint32 (stub->status, &readonly) == -1)
+			break;
+
+		g_mutex_lock (exch->folders_lock);
+		folder = g_hash_table_lookup (exch->folders, folder_name);
+		g_mutex_unlock (exch->folders_lock);
+		if (folder) {
+			camel_exchange_summary_set_readonly (folder->summary, readonly ? TRUE : FALSE);
+		}
+
+		g_free (folder_name);
+		break;
+	}
 
 	default:
 		g_assert_not_reached ();
Index: camel/camel-stub-constants.h
===================================================================
RCS file: /cvs/gnome/evolution-exchange/camel/camel-stub-constants.h,v
retrieving revision 1.6
diff -u -p -r1.6 camel-stub-constants.h
--- camel/camel-stub-constants.h	19 Aug 2005 15:36:28 -0000	1.6
+++ camel/camel-stub-constants.h	12 Sep 2005 09:10:21 -0000
@@ -65,7 +65,8 @@ typedef enum {
 	CAMEL_STUB_RETVAL_THAW_FOLDER,
 	CAMEL_STUB_RETVAL_FOLDER_CREATED,
 	CAMEL_STUB_RETVAL_FOLDER_DELETED,
-	CAMEL_STUB_RETVAL_FOLDER_RENAMED
+	CAMEL_STUB_RETVAL_FOLDER_RENAMED,
+	CAMEL_STUB_RETVAL_FOLDER_SET_READONLY
 } CamelStubRetval;
 
 typedef enum {
Index: mail/mail-stub-exchange.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/mail/mail-stub-exchange.c,v
retrieving revision 1.29
diff -u -p -r1.29 mail-stub-exchange.c
--- mail/mail-stub-exchange.c	30 Aug 2005 15:09:31 -0000	1.29
+++ mail/mail-stub-exchange.c	12 Sep 2005 09:10:23 -0000
@@ -2851,10 +2851,17 @@ static void
 folder_update_linestatus (gpointer key, gpointer value, gpointer data)
 {
 	MailStubExchangeFolder *mfld = (MailStubExchangeFolder *) value;
+	MailStub *stub = MAIL_STUB (mfld->mse);
 	gint linestatus = GPOINTER_TO_INT (data);
+	guint32 readonly;
 	
 	if (linestatus == ONLINE_MODE) {
 		get_folder_online (mfld, TRUE);
+		readonly = (mfld->access & (MAPI_ACCESS_MODIFY | MAPI_ACCESS_CREATE_CONTENTS)) ? 0 : 1;
+		mail_stub_return_data (stub, CAMEL_STUB_RETVAL_FOLDER_SET_READONLY,
+				       CAMEL_STUB_ARG_FOLDER, mfld->name,
+				       CAMEL_STUB_ARG_UINT32, readonly,
+				       CAMEL_STUB_ARG_END);
 	}
 	else {
 		/* FIXME: need any undo for offline */ ;
