commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-531-g0e8ae1c


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-531-g0e8ae1c
Date: Thu, 15 Dec 2011 08:17:23 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=0e8ae1c37611759936ce66eefff2ef392c3b8de0

The branch, master has been updated
       via  0e8ae1c37611759936ce66eefff2ef392c3b8de0 (commit)
      from  7d68b3cd17901190e6030327230df8e124161643 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0e8ae1c37611759936ce66eefff2ef392c3b8de0
Author: Sergey Poznyakoff <address@hidden>
Date:   Wed Dec 14 23:15:58 2011 +0200

    Implement UID command in mu imap

-----------------------------------------------------------------------

Summary of changes:
 mu/imap.c |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/mu/imap.c b/mu/imap.c
index 4c114f3..f615de9 100644
--- a/mu/imap.c
+++ b/mu/imap.c
@@ -61,6 +61,7 @@ static struct argp imap_argp = {
 
 
 static mu_imap_t imap;
+static int uid_mode;
 
 static enum mu_imap_session_state
 current_imap_state ()
@@ -315,7 +316,20 @@ imap_fetch_callback (void *data, int code, size_t sdat, 
void *pdat)
   mu_list_foreach (list, fetch_response_printer, str);
   mu_stream_printf (str, "\n\n");
 }
+
+static int
+com_uid (int argc, char **argv)
+{
+  int bv;
   
+  if (argc == 1)
+    mu_printf ("%s\n", uid_mode ? _("UID is on") : _("UID is off"));
+  else if (get_bool (argv[1], &bv) == 0)
+    uid_mode = bv;
+  else
+    mu_error (_("invalid boolean value"));
+  return 0;
+}
 
 static int
 com_disconnect (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
@@ -346,10 +360,10 @@ com_connect (int argc, char **argv)
       if (strcmp (argv[i], "-tls") == 0)
        {
 #ifdef WITH_TLS
-           tls = 1;
+         tls = 1;
 #else
-            mu_error (_("TLS not supported"));
-           return 0;
+         mu_error (_("TLS not supported"));
+         return 0;
 #endif
        }
       else
@@ -753,7 +767,7 @@ com_fetch (int argc, char **argv)
   mu_imap_register_callback_function (imap, MU_IMAP_CB_FETCH,
                                      imap_fetch_callback,
                                      out);
-  status = mu_imap_fetch (imap, 0, argv[1], argv[2]);
+  status = mu_imap_fetch (imap, uid_mode, argv[1], argv[2]);
   mu_stream_destroy (&out);
   mu_imap_register_callback_function (imap, MU_IMAP_CB_FETCH,
                                      imap_fetch_callback,
@@ -766,7 +780,7 @@ com_fetch (int argc, char **argv)
 static int
 com_store (int argc, char **argv)
 {
-  int status = mu_imap_store (imap, 0, argv[1], argv[2]);
+  int status = mu_imap_store (imap, uid_mode, argv[1], argv[2]);
   if (status)
     report_failure ("store", status);
   return 0;
@@ -1085,6 +1099,10 @@ struct mutool_command imap_comtab[] = {
     com_unsubscribe,
     N_("MBOX"),
     N_("Remove mailbox from subscription list") },
+  { "uid",          1, 2, 0,
+    com_uid,
+    N_("[on|off]"),
+    N_("control UID mode") },
   { "quit",         1, 1, 0,
     com_logout,
     NULL,


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]