* cosmetics
This commit is contained in:
@ -861,8 +861,8 @@ msg_move (const char* src, const char *dst, GError **err)
|
|||||||
|
|
||||||
gchar*
|
gchar*
|
||||||
mu_maildir_move_message (const char* oldpath, const char* targetmdir,
|
mu_maildir_move_message (const char* oldpath, const char* targetmdir,
|
||||||
MuFlags newflags, gboolean ignore_dups, gboolean new_name,
|
MuFlags newflags, gboolean ignore_dups,
|
||||||
GError **err)
|
gboolean new_name, GError **err)
|
||||||
{
|
{
|
||||||
char *newfullpath;
|
char *newfullpath;
|
||||||
gboolean rv;
|
gboolean rv;
|
||||||
|
|||||||
@ -193,7 +193,8 @@ char* mu_maildir_get_maildir_from_path (const char* path);
|
|||||||
* of the message are affected; note that this may still involve a
|
* of the message are affected; note that this may still involve a
|
||||||
* moved to another directory (say, from new/ to cur/)
|
* moved to another directory (say, from new/ to cur/)
|
||||||
* @param flags to set for the target (influences the filename, path)
|
* @param flags to set for the target (influences the filename, path)
|
||||||
* @param ignore_dups whether to silent ignore the src=target case (and return TRUE)
|
* @param ignore_dups whether to silent ignore the src=target case
|
||||||
|
* (and return TRUE)
|
||||||
* @param new_name whether to create a new unique name, or keep the
|
* @param new_name whether to create a new unique name, or keep the
|
||||||
* old one
|
* old one
|
||||||
* @param err receives error information
|
* @param err receives error information
|
||||||
|
|||||||
@ -855,8 +855,8 @@ get_target_mdir (MuMsg *msg, const char *target_maildir, GError **err)
|
|||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
mu_msg_move_to_maildir (MuMsg *self, const char *maildir,
|
mu_msg_move_to_maildir (MuMsg *self, const char *maildir,
|
||||||
MuFlags flags, gboolean ignore_dups, gboolean new_name,
|
MuFlags flags, gboolean ignore_dups,
|
||||||
GError **err)
|
gboolean new_name, GError **err)
|
||||||
{
|
{
|
||||||
char *newfullpath;
|
char *newfullpath;
|
||||||
char *targetmdir;
|
char *targetmdir;
|
||||||
@ -872,9 +872,8 @@ mu_msg_move_to_maildir (MuMsg *self, const char *maildir,
|
|||||||
|
|
||||||
newfullpath = mu_maildir_move_message (mu_msg_get_path (self),
|
newfullpath = mu_maildir_move_message (mu_msg_get_path (self),
|
||||||
targetmdir, flags,
|
targetmdir, flags,
|
||||||
ignore_dups, new_name, err);
|
ignore_dups, new_name,
|
||||||
/* update the message path and the flags; they may have
|
err);
|
||||||
* changed */
|
|
||||||
if (!newfullpath) {
|
if (!newfullpath) {
|
||||||
g_free (targetmdir);
|
g_free (targetmdir);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
@ -1148,9 +1148,8 @@ do_move (MuStore *store, unsigned docid, MuMsg *msg, const char *maildir,
|
|||||||
if (!mu_msg_move_to_maildir (msg, maildir, flags, TRUE, new_name, err))
|
if (!mu_msg_move_to_maildir (msg, maildir, flags, TRUE, new_name, err))
|
||||||
return MU_G_ERROR_CODE (err);
|
return MU_G_ERROR_CODE (err);
|
||||||
|
|
||||||
/* note, after mu_msg_move_to_maildir, path will be the *new*
|
/* after mu_msg_move_to_maildir, path will be the *new* path,
|
||||||
* path, and flags and maildir fields will be updated as
|
* and flags and maildir fields will be updated as wel */
|
||||||
* wel */
|
|
||||||
rv = mu_store_update_msg (store, docid, msg, err);
|
rv = mu_store_update_msg (store, docid, msg, err);
|
||||||
if (rv == MU_STORE_INVALID_DOCID) {
|
if (rv == MU_STORE_INVALID_DOCID) {
|
||||||
mu_util_g_set_error (err, MU_ERROR_XAPIAN,
|
mu_util_g_set_error (err, MU_ERROR_XAPIAN,
|
||||||
@ -1169,8 +1168,8 @@ do_move (MuStore *store, unsigned docid, MuMsg *msg, const char *maildir,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static MuError
|
static MuError
|
||||||
move_msgid (MuStore *store, unsigned docid, const char* flagstr, gboolean new_name,
|
move_docid (MuStore *store, unsigned docid, const char* flagstr,
|
||||||
GError **err)
|
gboolean new_name, GError **err)
|
||||||
{
|
{
|
||||||
MuMsg *msg;
|
MuMsg *msg;
|
||||||
MuError rv;
|
MuError rv;
|
||||||
@ -1184,6 +1183,7 @@ move_msgid (MuStore *store, unsigned docid, const char* flagstr, gboolean new_na
|
|||||||
|
|
||||||
flags = flagstr ? get_flags (mu_msg_get_path(msg), flagstr) :
|
flags = flagstr ? get_flags (mu_msg_get_path(msg), flagstr) :
|
||||||
mu_msg_get_flags (msg);
|
mu_msg_get_flags (msg);
|
||||||
|
|
||||||
if (flags == MU_FLAG_INVALID) {
|
if (flags == MU_FLAG_INVALID) {
|
||||||
mu_util_g_set_error (err, MU_ERROR_IN_PARAMETERS,
|
mu_util_g_set_error (err, MU_ERROR_IN_PARAMETERS,
|
||||||
"invalid flags");
|
"invalid flags");
|
||||||
@ -1203,18 +1203,21 @@ leave:
|
|||||||
|
|
||||||
|
|
||||||
/* when called with a msgid, we need to take care of possibly multiple
|
/* when called with a msgid, we need to take care of possibly multiple
|
||||||
* message with this message id. this is a common case when sending
|
* messages with this message id. this is a common case when sending
|
||||||
* messages to ourselves (maybe through a mailing list), where there
|
* messages to ourselves (maybe through a mailing list), where there
|
||||||
* would a message in inbox and sentbox with the same id. we set the
|
* would a message in the inbox and sent folders with the same id. we
|
||||||
* flag on both */
|
* set the flag on both */
|
||||||
static gboolean
|
static gboolean
|
||||||
move_msgid_maybe (ServerContext *ctx, GHashTable *args, GError **err)
|
move_msgid_maybe (ServerContext *ctx, GHashTable *args, GError **err)
|
||||||
{
|
{
|
||||||
GSList *docids, *cur;
|
GSList *docids, *cur;
|
||||||
const char *maildir = get_string_from_args (args, "maildir", TRUE, err);
|
const char* maildir, *msgid, *flagstr;
|
||||||
const char *msgid = get_string_from_args (args, "msgid", TRUE, err);
|
gboolean new_name;
|
||||||
const char *flagstr = get_string_from_args (args, "flags", TRUE, err);
|
|
||||||
gboolean new_name = get_bool_from_args (args, "newname", TRUE, err);
|
maildir = get_string_from_args (args, "maildir", TRUE, err);
|
||||||
|
msgid = get_string_from_args (args, "msgid", TRUE, err);
|
||||||
|
flagstr = get_string_from_args (args, "flags", TRUE, err);
|
||||||
|
new_name = get_bool_from_args (args, "newname", TRUE, err);
|
||||||
|
|
||||||
/* you cannot use 'maildir' for multiple messages at once */
|
/* you cannot use 'maildir' for multiple messages at once */
|
||||||
if (!msgid || !flagstr || maildir)
|
if (!msgid || !flagstr || maildir)
|
||||||
@ -1226,7 +1229,7 @@ move_msgid_maybe (ServerContext *ctx, GHashTable *args, GError **err)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (cur = docids; cur; cur = g_slist_next(cur))
|
for (cur = docids; cur; cur = g_slist_next(cur))
|
||||||
if (move_msgid (ctx->store, GPOINTER_TO_SIZE(cur->data),
|
if (move_docid (ctx->store, GPOINTER_TO_SIZE(cur->data),
|
||||||
flagstr, new_name, err) != MU_OK)
|
flagstr, new_name, err) != MU_OK)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@ -73,8 +73,7 @@ If VAL is nil, return nil."
|
|||||||
|
|
||||||
(defun mu4e~draft-references-construct (msg)
|
(defun mu4e~draft-references-construct (msg)
|
||||||
"Construct the value of the References: header based on MSG as a
|
"Construct the value of the References: header based on MSG as a
|
||||||
comma-separated string. Normally, this the concatenation of thedmesg
|
comma-separated string. Normally, this the concatenation of the
|
||||||
q
|
|
||||||
existing References + In-Reply-To (which may be empty, an note
|
existing References + In-Reply-To (which may be empty, an note
|
||||||
that :references includes the old in-reply-to as well) and the
|
that :references includes the old in-reply-to as well) and the
|
||||||
message-id. If the message-id is empty, returns the old
|
message-id. If the message-id is empty, returns the old
|
||||||
|
|||||||
Reference in New Issue
Block a user