diff options
author | Peter Williams <peterw@ximian.com> | 2001-07-19 23:38:51 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2001-07-19 23:38:51 +0800 |
commit | a7155df7c1dea51c87a8639cfaa620c167b10095 (patch) | |
tree | 9b093d072fbbac032d01d814a53e51b01caee02c /camel/providers | |
parent | 37695c74b75a1b27597e76b30eb367922279ed06 (diff) | |
download | gsoc2013-evolution-a7155df7c1dea51c87a8639cfaa620c167b10095.tar gsoc2013-evolution-a7155df7c1dea51c87a8639cfaa620c167b10095.tar.gz gsoc2013-evolution-a7155df7c1dea51c87a8639cfaa620c167b10095.tar.bz2 gsoc2013-evolution-a7155df7c1dea51c87a8639cfaa620c167b10095.tar.lz gsoc2013-evolution-a7155df7c1dea51c87a8639cfaa620c167b10095.tar.xz gsoc2013-evolution-a7155df7c1dea51c87a8639cfaa620c167b10095.tar.zst gsoc2013-evolution-a7155df7c1dea51c87a8639cfaa620c167b10095.zip |
Revert 7/11/2001 patch for IMAP INBOX filtering at NotZed's request.
2001-07-19 Peter Williams <peterw@ximian.com>
* Revert 7/11/2001 patch for IMAP INBOX filtering at NotZed's
request.
svn path=/trunk/; revision=11226
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 79 |
1 files changed, 12 insertions, 67 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index a6953c524e..36136d452c 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -1658,51 +1658,6 @@ imap_update_summary (CamelFolder *folder, imap_update_summary (folder, changes, recents, ex); } -struct _filter_timeout_data { - CamelFolder *folder; - GPtrArray *recents; - guint timeout_id; -}; - -static gboolean -imap_filter_timeout (gpointer user_data) -{ - struct _filter_timeout_data *ftd = (struct _filter_timeout_data *) user_data; - CamelFilterDriver *driver; - CamelException ex; - int i; - - camel_exception_init (&ex); - driver = camel_session_get_filter_driver (CAMEL_SERVICE (ftd->folder->parent_store)->session, - "incoming", &ex); - - if (driver) { - camel_filter_driver_filter_folder (driver, ftd->folder, NULL, - ftd->recents, FALSE, &ex); - - if (camel_exception_is_set (&ex)) - printf ("imap INBOX filter failed: %s\n", - camel_exception_get_description (&ex)); - - camel_object_unref (CAMEL_OBJECT (driver)); - } else - printf ("imap INBOX filter failed: couldn't get filter driver: %s\n", - camel_exception_get_description (&ex)); - - camel_exception_clear (&ex); - camel_object_unref ((CamelObject *) ftd->folder); - - for (i = 0; i < ftd->recents->len; i++) - g_free (ftd->recents->pdata[i]); - - g_ptr_array_free (ftd->recents, TRUE); - - camel_session_remove_timeout (CAMEL_SERVICE (ftd->folder->parent_store)->session, - ftd->timeout_id); - g_free (user_data); - return FALSE; -} - /* Called with the store's command_lock locked */ void camel_imap_folder_changed (CamelFolder *folder, int exists, @@ -1753,28 +1708,18 @@ camel_imap_folder_changed (CamelFolder *folder, int exists, if (recents) { if (!camel_exception_is_set (ex) && recents->len) { - /* is there any reason to protect against multiple - * filters at once? */ - - struct _filter_timeout_data *ftd; - int i; - - ftd = (struct _filter_timeout_data *) g_malloc (sizeof (struct _filter_timeout_data)); - ftd->folder = folder; - camel_object_ref ((CamelObject *) folder); - - /* Dup these in case they get removed */ - - for (i = 0; i < recents->len; i++) - recents->pdata[i] = g_strdup (recents->pdata[i]); - - ftd->recents = recents; - - /* interval must be > 1000 */ - ftd->timeout_id = camel_session_register_timeout (CAMEL_SERVICE (folder->parent_store)->session, - 1001, imap_filter_timeout, ftd); - } else - g_ptr_array_free (recents, TRUE); + CamelFilterDriver *driver; + + driver = camel_session_get_filter_driver ( + CAMEL_SERVICE (folder->parent_store)->session, + "incoming", ex); + if (driver) { + camel_filter_driver_filter_folder ( + driver, folder, NULL, recents, FALSE, ex); + camel_object_unref (CAMEL_OBJECT (driver)); + } + } + g_ptr_array_free (recents, TRUE); } camel_folder_summary_save (folder->summary); |