* mu-cmd.c: update for mu-msg-part changes

This commit is contained in:
djcb
2012-08-01 17:04:26 +03:00
parent 3c59b97fc9
commit a65af12dbb

View File

@ -63,17 +63,21 @@ view_msg_sexp (MuMsg *msg, MuConfig *opts)
static void static void
each_part (MuMsg *msg, MuMsgPart *part, gchar **attach) each_part (MuMsg *msg, MuMsgPart *part, gchar **attach)
{ {
if (mu_msg_part_looks_like_attachment (part, TRUE) && char *fname, *tmp;
(part->file_name)) {
char *tmp = *attach; if (!mu_msg_part_looks_like_attachment (part, TRUE))
return;
*attach = g_strdup_printf ("%s%s'%s'", fname = mu_msg_part_get_filename (part, FALSE);
*attach ? *attach : "", if (!fname)
*attach ? ", " : "", return;
part->file_name);
g_free (tmp); tmp = *attach;
} *attach = g_strdup_printf ("%s%s'%s'",
*attach ? *attach : "",
*attach ? ", " : "",
fname);
g_free (tmp);
} }
/* return comma-sep'd list of attachments */ /* return comma-sep'd list of attachments */
@ -83,9 +87,8 @@ get_attach_str (MuMsg *msg)
gchar *attach; gchar *attach;
attach = NULL; attach = NULL;
mu_msg_part_foreach (msg, (MuMsgPartForeachFunc)each_part, &attach, mu_msg_part_foreach (msg, MU_MSG_OPTION_NONE,
MU_MSG_OPTION_NONE); (MuMsgPartForeachFunc)each_part, &attach);
return attach; return attach;
} }
@ -188,8 +191,6 @@ handle_msg (const char *fname, MuConfig *opts, GError **err)
if (!msg) if (!msg)
return FALSE; return FALSE;
mu_msg_set_auto_decrypt (msg, opts->decrypt);
switch (opts->format) { switch (opts->format) {
case MU_CONFIG_FORMAT_PLAIN: case MU_CONFIG_FORMAT_PLAIN:
rv = view_msg_plain (msg, opts); rv = view_msg_plain (msg, opts);
@ -451,18 +452,14 @@ mu_cmd_verify (MuConfig *opts, GError **err)
if (!msg) if (!msg)
return MU_ERROR; return MU_ERROR;
msgopts = MU_MSG_OPTION_CHECK_SIGNATURES; msgopts = mu_config_get_msg_options (opts);
if (opts->auto_retrieve)
msgopts |= MU_MSG_OPTION_AUTO_RETRIEVE_KEY;
if (opts->use_agent)
msgopts |= MU_MSG_OPTION_USE_AGENT;
vdata.status = MU_MSG_PART_SIG_STATUS_UNKNOWN; vdata.status = MU_MSG_PART_SIG_STATUS_UNKNOWN;
vdata.opts = opts; vdata.opts = opts;
vdata.msg = NULL; vdata.msg = NULL;
mu_msg_part_foreach (msg,(MuMsgPartForeachFunc)each_sig, &vdata, /* TODO: update for decryption */
msgopts); mu_msg_part_foreach (msg, msgopts, (MuMsgPartForeachFunc)each_sig, &vdata);
/* if there's anything bad, all goodness goes away */ /* if there's anything bad, all goodness goes away */
if (vdata.status & MU_MSG_PART_SIG_STATUS_BAD || if (vdata.status & MU_MSG_PART_SIG_STATUS_BAD ||