aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-store.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-07-20 05:43:44 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-07-20 05:43:44 +0800
commit827e1ce10e61a178d755d7f73e373f4a6241fa36 (patch)
tree96c882452a721a68624c21b6302235e747db0259 /camel/providers/imap/camel-imap-store.c
parentf98b82add6e74f3ed03236c45aca16428e83e6fd (diff)
downloadgsoc2013-evolution-827e1ce10e61a178d755d7f73e373f4a6241fa36.tar
gsoc2013-evolution-827e1ce10e61a178d755d7f73e373f4a6241fa36.tar.gz
gsoc2013-evolution-827e1ce10e61a178d755d7f73e373f4a6241fa36.tar.bz2
gsoc2013-evolution-827e1ce10e61a178d755d7f73e373f4a6241fa36.tar.lz
gsoc2013-evolution-827e1ce10e61a178d755d7f73e373f4a6241fa36.tar.xz
gsoc2013-evolution-827e1ce10e61a178d755d7f73e373f4a6241fa36.tar.zst
gsoc2013-evolution-827e1ce10e61a178d755d7f73e373f4a6241fa36.zip
General cleanup working towards getting Actions->Expunge working
2000-07-19 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c: General cleanup working towards getting Actions->Expunge working correctly. * providers/imap/camel-imap-store.c (cammel_imap_command_extended): Added code to look for "* %d RECENT" and to emit the folder_changed signal if there are any recent messages. Note: this is a hack and needs to be rewritten badly. svn path=/trunk/; revision=4226
Diffstat (limited to 'camel/providers/imap/camel-imap-store.c')
-rw-r--r--camel/providers/imap/camel-imap-store.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index f61c7c9dac..f20cbfca2f 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -719,10 +719,10 @@ camel_imap_command_extended (CamelImapStore *store, CamelFolder *folder, char **
CamelService *service = CAMEL_SERVICE (store);
CamelURL *url = service->url;
CamelStreamBuffer *stream = CAMEL_STREAM_BUFFER (store->istream);
- GPtrArray *data;
+ gint len = 0, recent = 0, status = CAMEL_IMAP_OK;
gchar *cmdid, *cmdbuf, *respbuf;
+ GPtrArray *data;
va_list app;
- gint len = 0, status = CAMEL_IMAP_OK;
/* First make sure we're connected... */
if (!service->connected) {
@@ -786,6 +786,8 @@ camel_imap_command_extended (CamelImapStore *store, CamelFolder *folder, char **
data = g_ptr_array_new ();
while (1) {
+ char *ptr;
+
respbuf = camel_stream_buffer_read_line (stream);
if (!respbuf || !strncmp (respbuf, cmdid, strlen (cmdid))) {
/* IMAP's last response starts with our command id */
@@ -797,6 +799,15 @@ camel_imap_command_extended (CamelImapStore *store, CamelFolder *folder, char **
g_ptr_array_add (data, respbuf);
len += strlen (respbuf) + 1;
+
+ if (folder && *respbuf == '*' && (ptr = e_strstrcase (respbuf, "RECENT"))) {
+ char *rcnt;
+
+ for (rcnt = respbuf; rcnt < ptr && (*rcnt < '0' || *rcnt > '9'); rcnt++);
+
+ if (rcnt < ptr)
+ recent = atoi (rcnt);
+ }
}
if (respbuf) {
@@ -834,6 +845,9 @@ camel_imap_command_extended (CamelImapStore *store, CamelFolder *folder, char **
}
g_ptr_array_free (data, TRUE);
+
+ if (folder && recent > 0)
+ gtk_signal_emit_by_name (GTK_OBJECT (folder), "folder_changed", 0);
return status;
}