mirror of https://github.com/djcb/mu.git
mu: server: add compose-type 'resend'
Add a type 'resend', for resending existing messages.
This commit is contained in:
parent
6337151918
commit
cf9970ccd4
|
@ -511,7 +511,7 @@ get_encrypted_msg_opts (GHashTable *args)
|
||||||
return opts;
|
return opts;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum { NEW, REPLY, FORWARD, EDIT, INVALID_TYPE };
|
enum { NEW, REPLY, FORWARD, EDIT, RESEND, INVALID_TYPE };
|
||||||
static unsigned
|
static unsigned
|
||||||
compose_type (const char *typestr)
|
compose_type (const char *typestr)
|
||||||
{
|
{
|
||||||
|
@ -521,18 +521,19 @@ compose_type (const char *typestr)
|
||||||
return FORWARD;
|
return FORWARD;
|
||||||
else if (EQSTR (typestr, "edit"))
|
else if (EQSTR (typestr, "edit"))
|
||||||
return EDIT;
|
return EDIT;
|
||||||
|
else if (EQSTR (typestr, "resend"))
|
||||||
|
return RESEND;
|
||||||
else if (EQSTR (typestr, "new"))
|
else if (EQSTR (typestr, "new"))
|
||||||
return NEW;
|
return NEW;
|
||||||
else
|
else
|
||||||
return INVALID_TYPE;
|
return INVALID_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 'compose' produces the un-changed *original* message sexp (ie., the
|
/* 'compose' produces the un-changed *original* message sexp (ie., the message
|
||||||
* message to reply to, forward or edit) for a new message to
|
* to reply to, forward or edit) for a new message to compose). It takes two
|
||||||
* compose). It takes two parameters: 'type' with the compose type
|
* parameters: 'type' with the compose type (either reply, forward or
|
||||||
* (either reply, forward or edit), and 'docid' for the message to
|
* edit/resend), and 'docid' for the message to reply to. Note, type:new does
|
||||||
* reply to. Note, type:new does not have an original message, and
|
* not have an original message, and therefore does not need a docid
|
||||||
* therefore does not need a docid
|
|
||||||
*
|
*
|
||||||
* In returns a (:compose <type> [:original <original-msg>] [:include] )
|
* In returns a (:compose <type> [:original <original-msg>] [:include] )
|
||||||
* message (detals: see code below)
|
* message (detals: see code below)
|
||||||
|
@ -557,7 +558,8 @@ cmd_compose (ServerContext *ctx, GHashTable *args, GError **err)
|
||||||
return MU_OK;
|
return MU_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctype == REPLY || ctype == FORWARD || ctype == EDIT) {
|
if (ctype == REPLY || ctype == FORWARD ||
|
||||||
|
ctype == EDIT || ctype == RESEND) {
|
||||||
MuMsg *msg;
|
MuMsg *msg;
|
||||||
const char *docidstr;
|
const char *docidstr;
|
||||||
GET_STRING_OR_ERROR_RETURN (args, "docid", &docidstr, err);
|
GET_STRING_OR_ERROR_RETURN (args, "docid", &docidstr, err);
|
||||||
|
|
Loading…
Reference in New Issue