aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--imap.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/imap.c b/imap.c
index b2028579..90a48f6f 100644
--- a/imap.c
+++ b/imap.c
@@ -580,6 +580,22 @@ int imap_getauth(int sock, struct query *ctl, char *greeting)
return(PS_SUCCESS);
}
+static int internal_expunge(int sock)
+/* ship an expunge, resetting associated counters */
+{
+ int ok;
+
+ if ((ok = gen_transact(sock, "EXPUNGE")))
+ return(ok);
+
+ expunged += deletions;
+ deletions = 0;
+
+#ifdef IMAP_UID /* not used */
+ expunge_uids(ctl);
+#endif /* IMAP_UID */
+}
+
static int imap_getrange(int sock,
struct query *ctl,
const char *folder,
@@ -599,11 +615,7 @@ static int imap_getrange(int sock,
*/
ok = 0;
if (deletions && ctl->expunge > 1)
- ok = gen_transact(sock, "EXPUNGE");
-#ifdef IMAP_UID /* not used */
- if (!ok)
- expunge_uids(ctl);
-#endif /* IMAP_UID */
+ internal_expunge(sock);
count = -1;
if (ok || gen_transact(sock, "NOOP"))
{
@@ -806,22 +818,6 @@ static int imap_trail(int sock, struct query *ctl, int number)
return(PS_SUCCESS);
}
-static int internal_expunge(int sock)
-/* ship an expunge, resetting associated counters */
-{
- int ok;
-
- if ((ok = gen_transact(sock, "EXPUNGE")))
- return(ok);
-
- expunged = deletions;
- deletions = 0;
-
-#ifdef IMAP_UID /* not used */
- expunge_uids(ctl);
-#endif /* IMAP_UID */
-}
-
static int imap_delete(int sock, struct query *ctl, int number)
/* set delete flag for given message */
{