From cf9970ccd4fa10ca584412a2addf4f6aa0d217fc Mon Sep 17 00:00:00 2001 From: djcb Date: Tue, 16 Feb 2016 08:12:14 +0200 Subject: [PATCH] mu: server: add compose-type 'resend' Add a type 'resend', for resending existing messages. --- mu/mu-cmd-server.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mu/mu-cmd-server.c b/mu/mu-cmd-server.c index 8e5d9875..61b9c5fb 100644 --- a/mu/mu-cmd-server.c +++ b/mu/mu-cmd-server.c @@ -511,7 +511,7 @@ get_encrypted_msg_opts (GHashTable *args) return opts; } -enum { NEW, REPLY, FORWARD, EDIT, INVALID_TYPE }; +enum { NEW, REPLY, FORWARD, EDIT, RESEND, INVALID_TYPE }; static unsigned compose_type (const char *typestr) { @@ -521,18 +521,19 @@ compose_type (const char *typestr) return FORWARD; else if (EQSTR (typestr, "edit")) return EDIT; + else if (EQSTR (typestr, "resend")) + return RESEND; else if (EQSTR (typestr, "new")) return NEW; else return INVALID_TYPE; } -/* 'compose' produces the un-changed *original* message sexp (ie., the - * message to reply to, forward or edit) for a new message to - * compose). It takes two parameters: 'type' with the compose type - * (either reply, forward or edit), and 'docid' for the message to - * reply to. Note, type:new does not have an original message, and - * therefore does not need a docid +/* 'compose' produces the un-changed *original* message sexp (ie., the message + * to reply to, forward or edit) for a new message to compose). It takes two + * parameters: 'type' with the compose type (either reply, forward or + * edit/resend), and 'docid' for the message to reply to. Note, type:new does + * not have an original message, and therefore does not need a docid * * In returns a (:compose [:original ] [:include] ) * message (detals: see code below) @@ -557,7 +558,8 @@ cmd_compose (ServerContext *ctx, GHashTable *args, GError **err) return MU_OK; } - if (ctype == REPLY || ctype == FORWARD || ctype == EDIT) { + if (ctype == REPLY || ctype == FORWARD || + ctype == EDIT || ctype == RESEND) { MuMsg *msg; const char *docidstr; GET_STRING_OR_ERROR_RETURN (args, "docid", &docidstr, err);