[evolution-patches] Re: Patch for #72455 and #72227 (camel-groupwise)
- From: Vivek Jain <jvivek novell com>
- To: evolution-patches lists ximian com
- Subject: [evolution-patches] Re: Patch for #72455 and #72227 (camel-groupwise)
- Date: Mon, 28 Feb 2005 19:34:25 +0530
sorry!!.. I goofed up in creating the patch. Kindly ignore the previous
one.
Thanks
vivek
On Mon, 2005-02-28 at 19:23 +0530, Vivek Jain wrote:
> sorry missed the patch..
>
> On Mon, 2005-02-28 at 19:17 +0530, Vivek Jain wrote:
> > Hi,
> >
> > Sending a patch that enables groupwise provider to handle junk mails.
> > Changes are made in camel-groupwise-store.[ch]
> > and camel-groupwise-folder.c
> >
> > fixes http://bugzilla.ximian.com/show_bug.cgi?id=72455
> > and http://bugzilla.ximian.com/show_bug.cgi?id=72227
> >
> > Thanks,
> > vivek
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/ChangeLog,v
retrieving revision 1.30
diff -u -p -r1.30 ChangeLog
--- ChangeLog 28 Feb 2005 12:54:53 -0000 1.30
+++ ChangeLog 28 Feb 2005 13:59:29 -0000
@@ -1,3 +1,17 @@
+2005-02-28 Vivek Jain <jvivek novell com>
+
+ Fix for #72455
+ and #72227
+ * camel-groupwise-store.h : defined new flags to represent preferences
+ marked by user regarding junk mail handling
+ * camel-groupwise-store.c :(groupwise_store_construct)
+ check url to check the options enabled and set the flags
+ * camel-groupwise_folder.c : (camel_groupwise_folder_new): check the
+ flags (for junk) and set camel flags on the folders
+ (gw_update_summary) : initialize status_flags to 0
+ set the JUNK_LEARN flag in case folder is to be checked for junk
+ contents
+
2005-02-28 Harish Krishnaswamy <kharish novell com>
* camel-groupwise-folder.c: (groupwise_refresh_info):
Index: camel-groupwise-store.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/camel-groupwise-store.h,v
retrieving revision 1.5
diff -u -p -r1.5 camel-groupwise-store.h
--- camel-groupwise-store.h 11 Jan 2005 07:49:58 -0000 1.5
+++ camel-groupwise-store.h 28 Feb 2005 13:59:29 -0000
@@ -47,6 +47,11 @@ typedef struct _CamelGroupwiseStore Came
typedef struct _CamelGroupwiseStoreClass CamelGroupwiseStoreClass;
typedef struct _CamelGroupwiseStorePrivate CamelGroupwiseStorePrivate;
+#define GROUPWISE_PARAM_CHECK_ALL (1 << 0)
+#define GROUPWISE_PARAM_FILTER_INBOX (1 << 1)
+#define GROUPWISE_PARAM_FILTER_JUNK (1 << 2)
+#define GROUPWISE_PARAM_FILTER_JUNK_INBOX (1 << 3)
+
struct _CamelGroupwiseStore {
CamelOfflineStore parent_object;
@@ -55,6 +60,7 @@ struct _CamelGroupwiseStore {
char *root_container ;
CamelGroupwiseStorePrivate *priv;
CamelFolder *current_folder ;
+ guint32 parameters;
};
Index: camel-groupwise-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/camel-groupwise-store.c,v
retrieving revision 1.34
diff -u -p -r1.34 camel-groupwise-store.c
--- camel-groupwise-store.c 25 Feb 2005 06:31:31 -0000 1.34
+++ camel-groupwise-store.c 28 Feb 2005 13:59:29 -0000
@@ -312,6 +312,20 @@ groupwise_store_construct (CamelService
priv->use_ssl = g_strdup (camel_url_get_param (url, "use_ssl"));
store->flags = 0; //XXX: Shouldnt do this....
+ if (camel_url_get_param (url, "check_all"))
+ groupwise_store->parameters |= GROUPWISE_PARAM_CHECK_ALL;
+
+ if (camel_url_get_param (url, "filter")) {
+ groupwise_store->parameters |= GROUPWISE_PARAM_FILTER_INBOX;
+ store->flags |= CAMEL_STORE_FILTER_INBOX;
+ }
+ if (camel_url_get_param (url, "filter_junk"))
+ groupwise_store->parameters |= GROUPWISE_PARAM_FILTER_JUNK;
+ if (camel_url_get_param (url, "filter_junk_inbox"))
+ groupwise_store->parameters |= GROUPWISE_PARAM_FILTER_JUNK_INBOX;
+
+ store->flags |= CAMEL_STORE_VJUNK;
+
}
Index: camel-groupwise-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/camel-groupwise-folder.c,v
retrieving revision 1.30
diff -u -p -r1.30 camel-groupwise-folder.c
--- camel-groupwise-folder.c 25 Feb 2005 06:31:31 -0000 1.30
+++ camel-groupwise-folder.c 28 Feb 2005 13:59:29 -0000
@@ -565,6 +565,7 @@ camel_gw_folder_new(CamelStore *store, c
{
CamelFolder *folder ;
CamelGroupwiseFolder *gw_folder ;
+ CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (store) ;
char *summary_file, *state_file, *journal_file ;
char *short_name;
@@ -610,6 +611,16 @@ camel_gw_folder_new(CamelStore *store, c
return NULL ;
}
+ if (!g_ascii_strcasecmp (folder_name, "Mailbox")) {
+ if ((gw_store->parameters & GROUPWISE_PARAM_FILTER_INBOX))
+ folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
+ if ((gw_store->parameters & GROUPWISE_PARAM_FILTER_JUNK))
+ folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
+ } else {
+ if ((gw_store->parameters & (GROUPWISE_PARAM_FILTER_JUNK|GROUPWISE_PARAM_FILTER_JUNK_INBOX)) == (GROUPWISE_PARAM_FILTER_JUNK))
+ folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
+ }
+
gw_folder->search = camel_folder_search_new ();
if (!gw_folder->search) {
camel_object_unref (folder) ;
@@ -720,7 +731,7 @@ gw_update_summary ( CamelFolder *folder,
CamelGroupwiseMessageInfo *mi = NULL;
GPtrArray *msg ;
GSList *attach_list = NULL ;
- guint32 item_status, status_flags;
+ guint32 item_status, status_flags =0;
CamelFolderChangeInfo *changes = NULL ;
int scount, got = g_list_length (item_list) ;
@@ -749,6 +760,10 @@ gw_update_summary ( CamelFolder *folder,
if (item_status & E_GW_ITEM_STAT_REPLIED)
status_flags |= CAMEL_MESSAGE_ANSWERED;
mi->info.flags |= status_flags;
+
+ if (folder->folder_flags & CAMEL_FOLDER_FILTER_JUNK)
+ mi->info.flags |= CAMEL_MESSAGE_JUNK_LEARN;
+
camel_folder_change_info_change_uid (changes, e_gw_item_get_id (item)) ;
} else {
/*New message*/
@@ -776,6 +791,10 @@ gw_update_summary ( CamelFolder *folder,
if (item_status & E_GW_ITEM_STAT_REPLIED)
status_flags |= CAMEL_MESSAGE_ANSWERED;
mi->info.flags |= status_flags;
+
+ if (folder->folder_flags & CAMEL_FOLDER_FILTER_JUNK)
+ mi->info.flags |= CAMEL_MESSAGE_JUNK_LEARN;
+
attach_list = e_gw_item_get_attach_id_list (item) ;
if (attach_list)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]