aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-01-11 01:10:44 +0800
committerDan Winship <danw@src.gnome.org>2001-01-11 01:10:44 +0800
commit54c085cc3cec41cc3d5a77efadb98450a7c5b4b6 (patch)
treed2a6bb21bfc182acdfb83535dd8b311abb5fb4ad /camel
parent4d9047b9b04e1dc5fc74d8bcc2bd360948d6dd76 (diff)
downloadgsoc2013-evolution-54c085cc3cec41cc3d5a77efadb98450a7c5b4b6.tar.gz
gsoc2013-evolution-54c085cc3cec41cc3d5a77efadb98450a7c5b4b6.tar.zst
gsoc2013-evolution-54c085cc3cec41cc3d5a77efadb98450a7c5b4b6.zip
New class function, parallel to camel_folder_sync. (The default
* camel-store.c (camel_store_sync): New class function, parallel to camel_folder_sync. (The default implementation just calls camel_folder_sync on each cached folder.) * providers/imap/camel-imap-store.c (get_folder_info): Call camel_store_sync before doing anything else so that the IMAP server and Camel are working from the same data. Don't ask the server for the unread message count of the current folder, since UW will return often-incorrect cached data, and we can calculate it without talking to the server anyway. svn path=/trunk/; revision=7365
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog13
-rw-r--r--camel/camel-store.c35
-rw-r--r--camel/camel-store.h7
-rw-r--r--camel/providers/imap/camel-imap-store.c18
4 files changed, 72 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index c947b4e04e..76f4d130fb 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,16 @@
+2001-01-10 Dan Winship <danw@helixcode.com>
+
+ * camel-store.c (camel_store_sync): New class function, parallel
+ to camel_folder_sync. (The default implementation just calls
+ camel_folder_sync on each cached folder.)
+
+ * providers/imap/camel-imap-store.c (get_folder_info): Call
+ camel_store_sync before doing anything else so that the IMAP
+ server and Camel are working from the same data. Don't ask the
+ server for the unread message count of the current folder, since
+ UW will return often-incorrect cached data, and we can calculate
+ it without talking to the server anyway.
+
2001-01-09 Dan Winship <danw@helixcode.com>
Mostly IMAP changes. Use the NAMESPACE extension (where
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 7c61809150..05bffcdd97 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -50,6 +50,7 @@ static char *get_folder_name (CamelStore *store, const char *folder_name,
static char *get_root_folder_name (CamelStore *store, CamelException *ex);
static char *get_default_folder_name (CamelStore *store, CamelException *ex);
+static void store_sync (CamelStore *store, CamelException *ex);
static CamelFolderInfo *get_folder_info (CamelStore *store, const char *top,
gboolean fast, gboolean recursive,
gboolean subscribed_only,
@@ -77,6 +78,7 @@ camel_store_class_init (CamelStoreClass *camel_store_class)
camel_store_class->get_folder_name = get_folder_name;
camel_store_class->get_root_folder_name = get_root_folder_name;
camel_store_class->get_default_folder_name = get_default_folder_name;
+ camel_store_class->sync = store_sync;
camel_store_class->get_folder_info = get_folder_info;
camel_store_class->free_folder_info = free_folder_info;
camel_store_class->lookup_folder = lookup_folder;
@@ -434,6 +436,38 @@ camel_store_get_default_folder (CamelStore *store, CamelException *ex)
}
+static void
+sync_folder (gpointer key, gpointer folder, gpointer ex)
+{
+ if (!camel_exception_is_set (ex))
+ camel_folder_sync (folder, FALSE, ex);
+}
+
+static void
+store_sync (CamelStore *store, CamelException *ex)
+{
+ CAMEL_STORE_LOCK(store, cache_lock);
+ g_hash_table_foreach (store->folders, sync_folder, ex);
+ CAMEL_STORE_UNLOCK(store, cache_lock);
+}
+
+/**
+ * camel_store_sync:
+ * @store: a CamelStore
+ * @ex: a CamelException
+ *
+ * Syncs any changes that have been made to the store object and its
+ * folders with the real store.
+ **/
+void
+camel_store_sync (CamelStore *store, CamelException *ex)
+{
+ g_return_if_fail (CAMEL_IS_STORE (store));
+
+ CS_CLASS (store)->sync (store, ex);
+}
+
+
static CamelFolderInfo *
get_folder_info (CamelStore *store, const char *top,
gboolean fast, gboolean recursive,
@@ -737,4 +771,3 @@ camel_store_unsubscribe_folder (CamelStore *store,
CAMEL_STORE_UNLOCK(store, folder_lock);
}
-
diff --git a/camel/camel-store.h b/camel/camel-store.h
index 4df8fa369f..1141f09dcf 100644
--- a/camel/camel-store.h
+++ b/camel/camel-store.h
@@ -85,6 +85,10 @@ typedef struct {
const char *old_name,
const char *new_name,
CamelException *ex);
+
+ void (*sync) (CamelStore *store,
+ CamelException *ex);
+
char * (*get_folder_name) (CamelStore *store,
const char *folder_name,
CamelException *ex);
@@ -143,6 +147,9 @@ void camel_store_rename_folder (CamelStore *store,
const char *new_name,
CamelException *ex);
+void camel_store_sync (CamelStore *store,
+ CamelException *ex);
+
CamelFolderInfo *camel_store_get_folder_info (CamelStore *store,
const char *top,
gboolean fast,
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index d3701ca5b7..ca4ca2e0d7 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -773,6 +773,13 @@ get_folder_info (CamelStore *store, const char *top, gboolean fast,
if (!camel_remote_store_connected (CAMEL_REMOTE_STORE (store), ex))
return NULL;
+ /* Sync flag changes to the server so it has the same ideas about
+ * read/unread as we do.
+ */
+ camel_store_sync (store, ex);
+ if (camel_exception_is_set (ex))
+ return NULL;
+
name = top;
if (!name) {
need_inbox = TRUE;
@@ -838,6 +845,17 @@ get_folder_info (CamelStore *store, const char *top, gboolean fast,
if (!fi->url || fi->unread_message_count != -1)
continue;
+ /* UW will give cached data for the currently
+ * selected folder. Grr. Well, I guess this
+ * also potentially saves us one IMAP command.
+ */
+ if (imap_store->current_folder &&
+ !strcmp (imap_store->current_folder->full_name,
+ fi->full_name)) {
+ fi->unread_message_count = camel_folder_get_unread_message_count (imap_store->current_folder);
+ continue;
+ }
+
CAMEL_IMAP_STORE_LOCK (imap_store, command_lock);
response = camel_imap_command (imap_store, NULL, NULL,
"STATUS %S (UNSEEN)",
_2_23_3&id=14e018afc44ef95d46be133b23490ab7dd3c05c0'>Updated Slovenian translationAndraz Tori2001-07-281-1383/+1383 * initialize to NULL some pointersRodrigo Moya2001-07-285-20/+78 * Added (unused) table with strings intended to be translated (i18n toolsChyla Zbigniew2001-07-282-0/+9 * Constify and set the query sexp on the task pad's model as well.Federico Mena Quintero2001-07-283-2/+15 * Shut up CVS - FedericoFederico Mena Quintero2001-07-281-0/+4 * New files with a derivative of ESearchBar that generates sexps forFederico Mena Quintero2001-07-2816-635/+1016 * Consistency fixes, and reindented the goddamn thing.Federico Mena Quintero2001-07-282-142/+118 * Don't need this anymore. (do_get_pass): Since we already have the entryJeffrey Stedfast2001-07-285-62/+56 * Remove the source for the timeout *before* invoking the CORBA method, asEttore Perazzoli2001-07-283-53/+98 * Removed the unused "Settings" submenu, because it creates an extra blankJason Leach2001-07-282-5/+6 * Locations.Iain Holmes2001-07-282-0/+6 * Tidy ldaddsJP Rosevear2001-07-282-4/+8 * Fix the fix that fixes broken mailer behavior. We want to make sure thatJeffrey Stedfast2001-07-282-2/+10 * Jason Leach <jleach@ximian.com>Jacob Leach2001-07-282-1/+7 * Figure out whether we're getting the password for the source or thePeter Williams2001-07-274-5/+60 * Updated Hungarian translation.Andras Timar2001-07-272-1012/+1147 * This might fix bug#4704 (new version of the new apppointment icon /tigertTuomas Kuosmanen2001-07-273-100/+128 * when an entry has changed, iterate over the elements of the entry and addJP Rosevear2001-07-272-175/+261 * glade beautificationsJeffrey Stedfast2001-07-272-29/+31 * send the empty string as subject if there is no summaryJP Rosevear2001-07-271-1/+4 * free a list of attendees (meeting_page_fill_widgets): clean up attendeeJP Rosevear2001-07-278-68/+156 * call pvl_next on i rather than itr.iterJP Rosevear2001-07-272-1/+6 * If we don't have any messages selected, break out. This fixes bug #5612.Jeffrey Stedfast2001-07-273-8/+43 * Allow the url to be NULL just like the libc free convention.Jeffrey Stedfast2001-07-273-14/+23 * revised.Aaron Weber2001-07-278-528/+854 * if from_zone is NULL (i.e. it is a floating time), just return.Damon Chaplin2001-07-272-3/+8 * Implemented. (setup_mime_tables): Setup the application/pgp handler to useJeffrey Stedfast2001-07-272-10/+79 * check that the row passed in is valid. Sometimes we get the "row-selected"Damon Chaplin2001-07-273-1/+72 * Use magic to make the password remembering checkbutton come after thePeter Williams2001-07-272-2/+33 * Respect Gtk theme colors for the fonts and calculate a new table gbcolorJeffrey Stedfast2001-07-274-13/+61 * Send an IMAP command, but don't wait for responses.Dan Winship2001-07-275-233/+504 * Make the date column smaller and the subject column larger, relatively.Peter Williams2001-07-272-1/+4 * Little UI nit: capitalize the words Offline/Online for the File menu.Jason Leach2001-07-272-3/+8 * Don't display "0 hidden".Peter Williams2001-07-272-1/+4 * Correct our manually inserted signature dash thingie (it was missing thePeter Williams2001-07-262-1/+10 * Make 'q' a toggle, not one-way.Peter Williams2001-07-262-2/+5 * Rename "Date" column to "Sent".Peter Williams2001-07-262-1/+5 * Fixing a small, stupid mistake; use e_select_names_model_get_textificationJon Trowbridge2001-07-262-2/+13 * Removed some debugging chatter.Jon Trowbridge2001-07-268-26/+123 * If the CLICK signal gets a return value, so we're going to be return fromJason Leach2001-07-261-1/+4 * gracefully handle the lack of a methodJP Rosevear2001-07-262-0/+7 * check type of component before actually pasting. Deal with VCALENDARRodrigo Moya2001-07-265-13/+147 * changed "Settings" to "Calendar Settings". Fixes bug #5498.Damon Chaplin2001-07-262-1/+6 * used the new print preview icon.Damon Chaplin2001-07-263-5/+13 * added print-preview-24.png.Damon Chaplin2001-07-262-1/+6 * New function. When a folder is selected set the OK button to be sensitiveJason Leach2001-07-262-2/+23 * accept an icaltimezone* of NULL for all the public functions, since NULLDamon Chaplin2001-07-262-1/+26 * fixed a mis-spelling of "Fashion" in the mail accounts window. (See bugAnna Marie Dirks2001-07-262-5/+20 * Don't make the key url:item if we have the url, just make it url. ThisJeffrey Stedfast2001-07-265-30/+14 * Don't make the key url:item if we have the url, just make it url. ThisJeffrey Stedfast2001-07-263-62/+73 * Make it so Enter always opens the message in another window.Peter Williams2001-07-262-6/+6 * Now take a CamelService parameter (as passed by Camel). Allows us to havePeter Williams2001-07-266-5/+61 * change the way x-evolution-any-field is converted to an ldap query. itChris Toshok2001-07-262-14/+12 * see if the address is already in the list of attendees (duplicate_error):JP Rosevear2001-07-262-16/+68 * if the property contaiJP Rosevear2001-07-262-0/+16 * Now takes a check_supported gboolean argument saying whether or not toJeffrey Stedfast2001-07-263-9/+25 * A warning fix from Jacob. Bug #5057.Jason Leach2001-07-262-4/+7 * $(BONOBO_CONF_CFLAGS) was here twice, took out one of them.Jason Leach2001-07-263-2/+10 * Initialize `me' to NULL. (forward_attached): If we are only forwarding aJeffrey Stedfast2001-07-262-12/+44 * Initialize `me' to NULL.Jeffrey Stedfast2001-07-263-12/+16 * Add another Sender pattern.Dan Winship2001-07-252-0/+6 * print preview for new appointmentJakub Steiner2001-07-252-0/+5 * #include <libgnome/gnome-defs.h> and <libgnome/gnome-i18n.h> instead ofJason Leach2001-07-252-4/+9 * Um, write the HTML signature settings in the right place. Whoops.Peter Williams2001-07-252-2/+7 * Properly dup the results of e_destination_get_email.Jon Trowbridge2001-07-254-3/+20 * Added checks for all of the args of the exposed functions, so that weJon Trowbridge2001-07-252-0/+23 * Properly ref the font we pass in as an ARG_FONT_E. (_do_tooltip): RemovedJon Trowbridge2001-07-252-3/+3 * Change the break into a continue, we should process as many as we canNot Zed2001-07-253-5/+17 * If we're the last row and we're deleting, select the previous message, notJason Leach2001-07-252-2/+14 * Add psion macros from Frodo Looijaard <frodol@dds.nl>Jody Goldberg2001-07-252-0/+57 * Pass the O_TRUNC flag to open so that we don't leave trailing garbage atJeffrey Stedfast2001-07-253-39/+48 * oops, we had a possible NULL value passed to a strcmpJeffrey Stedfast2001-07-251-1/+3 * fix some warnings.Jacob Leach2001-07-251-3/+3 * fixed a typoJeffrey Stedfast2001-07-251-1/+1 * calculate tmp_tm.tm_wday ourselves. strftime has a habit of crashing ifDamon Chaplin2001-07-252-0/+11 * Fix for bug #5174.Jeffrey Stedfast2001-07-252-2/+8 * Add shell/e-local-storage.c so "Local Folders" can get translated. FixesJason Leach2001-07-252-0/+6 * Another update. Evo is moving fast...Christian Rose2001-07-251-6/+10 * don't show the year in the popup submenu for the months, and center theDamon Chaplin2001-07-252-4/+15 * stip the delto and delfrom (popup_delegate_cb): show a delegate dialog andJP Rosevear2001-07-257-39/+662 * oops, and just in case value is NULL...Jeffrey Stedfast2001-07-251-1/+1 * Handle broken mailers that send unencoded 8bit header params. And thereJeffrey Stedfast2001-07-252-0/+41 * Updated Swedish translation.Christian Rose2001-07-252-144/+134 * Match the prefix for the "remember_passphrase" setting with where it'sJason Leach2001-07-252-8/+15 * "_Add Anyway" to "Add Anyway".Jason Leach2001-07-252-1/+6 * Added fallbacks for the name in the case of an e-card, to avoid theJon Trowbridge2001-07-252-1/+19 * check_specials if this is an application/pgp type as well.Jeffrey Stedfast2001-07-252-1/+4 * need the EDestination magic here too for when we modify an already shownChris Toshok2001-07-254-5/+52 * call widget_changed. (phone_entry_changed): same. (email_entry_changed):Chris Toshok2001-07-252-25/+100 * When dumping the CamelURL to a string, hide all the params.Jeffrey Stedfast2001-07-252-10/+15 * Do a case-insensitive comparison. (mail_generate_reply): Only resort toJeffrey Stedfast2001-07-257-49/+86 * get_boolean_with_default for the "Mark as read" timeout, notJason Leach2001-07-252-2/+7 * New #define, and there was much rejoicing. Rah.Jeffrey Stedfast2001-07-252-0/+7 * Check if evolution_shell_client_get_local_storage returnsJon Trowbridge2001-07-252-0/+20 * Move Insert File from the File menu into the Insert Menu. Change thePeter Williams2001-07-252-4/+9 * Add the "/My Evolution" path to the path_to_etree_node hash so thatJason Leach2001-07-252-4/+19 * Don't display "(0 unsent)" if the outbox is empty.Peter Williams2001-07-252-2/+5 * Don't stop the idle_queue and unref from here, since this might be calledDan Winship2001-07-252-11/+15 * Updated Swedish translation.Christian Rose2001-07-252-136/+145 * Add "Compose New Message" to the Actions menu as suggested in bug #866.Peter Williams2001-07-252-2/+8 * Set up the local trash in the folder cache.Peter Williams2001-07-252-0/+8 * Updated Slovak translation.Stanislav Visnovsky2001-07-242-712/+640 * Make the error reporting a little but more descriptive.Peter Williams2001-07-242-2/+7 * Add new label widgets with a message that SSL isn't supported.Peter Williams2001-07-245-8/+70 * Reworded a few questions.Aaron Weber2001-07-244-12/+16 * Correct minimal version testFrédéric Crozat2001-07-242-2/+7 * Updated Swedish translation.Christian Rose2001-07-242-325/+375 * Added a validate function that checks to make sure that vfolders that haveJon Trowbridge2001-07-243-0/+40 * Dont call notifyResult here if we've just launched a thread to do theNot Zed2001-07-242-13/+17 * Only show the warning dialog instead of using `gnome_dialog_run()' so itEttore Perazzoli2001-07-241-2/+10 * Somehow this missed the commit.Not Zed2001-07-241-2/+2 * Go back to calling mail_msg_free here. (mail_msg_destroy): Remove theNot Zed2001-07-243-8/+31 * Only show the warning dialog instead of using `gnome_dialog_run()' so itEttore Perazzoli2001-07-242-7/+13 * fixed the test to see whether we should draw the icons.Damon Chaplin2001-07-242-3/+8 * Added some warnings for bad cases.Not Zed2001-07-242-4/+26 * Oops. Uncomment this code since Trow fixed GtkHTML to actually have thisJeffrey Stedfast2001-07-242-1/+4 * Fixed the "Read" to be Read in the glade file per menesis' request.Jeffrey Stedfast2001-07-246-5/+94 * pass extra param to icalparser_get_next_char (icalparser_get_next_char):JP Rosevear2001-07-242-26/+43 * changed so it doesn't use mktime(). We are having problems becauseDamon Chaplin2001-07-242-17/+28 * fixed my fix to compileJeffrey Stedfast2001-07-241-2/+2 * Pulled instance of config-setupassist.sgml to make stuff build right.Kevin Breit2001-07-244-2/+8 * If the source and destination folders are the same, just mark the uids asJeffrey Stedfast2001-07-242-4/+21 * Carefully check for NULL everywhere, and do the right thing if the messageJon Trowbridge2001-07-242-2/+24 * validated.Aaron Weber2001-07-248-424/+26 * Add new feed to the shown listIain Holmes2001-07-242-0/+11 * Uhm, set the usize to `1, -1' instead.Ettore Perazzoli2001-07-242-1/+6 * Some commit mix ups left the KDE rdf url still set to the old, invalidJacob Leach2001-07-241-1/+1 * [Bug #5225: No UI way to mark as unimportant]Jason Leach2001-07-245-6/+49 * Make the storage registar(?) genericIain Holmes2001-07-242-35/+76 * Add the "Mark as Unimportant" cmd and menu item to the Edit menu. BugJason Leach2001-07-242-3/+12 * Fix the Newsforge name and the KDE rdfIain Holmes2001-07-242-2/+7 * Change the butt-ugly UI to a saner (and just as flexible) one. Instead ofPeter Williams2001-07-242-98/+114 * Set the usize for the contained hbox to 0x0.Ettore Perazzoli2001-07-242-0/+7 * Minor revisions.Aaron Weber2001-07-2418-960/+822 * Get the manuals from the `evolution-guide' dir as that's where they getEttore Perazzoli2001-07-242-5/+10 * Update the url (and site name) for the KDE rdf. Bug #5145.Jason Leach2001-07-242-1/+6 * Changed background transparency.Aaron Weber2001-07-242-0/+0 * Re-fix for my 07-18 not-quite-fix.Dan Winship2001-07-245-8/+84 * Don't handle button events whose button number is not 1.Ettore Perazzoli2001-07-242-1/+7 * Slight fix for when source == destination (we don't want to do this actionJeffrey Stedfast2001-07-242-0/+9 * Removing changes to Makefile.am; didn't know this was a global directoryAndrew Hughes Chatham2001-07-231-4/+2 * Handle GDK_KP_* cursor keys as well.Ettore Perazzoli2001-07-231-1/+5 * Added some operation progress reporting. Actual data transfer is 'tricky'Not Zed2001-07-234-12/+44 * Add an extra @type arg to the xferFolder and removeFolder methods inEttore Perazzoli2001-07-2314-17/+174 * Removing these macros from the global gnome macros directory. Sorry about that.Andrew Hughes Chatham2001-07-234-148/+0 * Add a `user_creatable' property to folder types and make componentsEttore Perazzoli2001-07-2219-18/+110 * typo in changelog.Jacob Leach2001-07-221-1/+1 * Capitalize "messgaes" in "Hide Read messages" menu item label. Bug #5091.Jason Leach2001-07-22