mirror of https://github.com/djcb/mu.git
* fix mu-msg-sexp.c for make line33
This commit is contained in:
parent
49353e9685
commit
b0de0fdfea
|
@ -87,7 +87,14 @@ get_name_addr_pair (MuMsgContact *c)
|
||||||
return pair;
|
return pair;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
add_prefix_maybe (GString *gstr, gboolean *field, const char *prefix)
|
||||||
|
{
|
||||||
|
if (!*field)
|
||||||
|
g_string_append (gstr, prefix);
|
||||||
|
|
||||||
|
*field = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
each_contact (MuMsgContact *c, ContactData *cdata)
|
each_contact (MuMsgContact *c, ContactData *cdata)
|
||||||
|
@ -96,39 +103,30 @@ each_contact (MuMsgContact *c, ContactData *cdata)
|
||||||
MuMsgContactType ctype;
|
MuMsgContactType ctype;
|
||||||
|
|
||||||
ctype = mu_msg_contact_type (c);
|
ctype = mu_msg_contact_type (c);
|
||||||
|
|
||||||
if (cdata->prev_ctype != ctype && cdata->prev_ctype != (unsigned)-1)
|
if (cdata->prev_ctype != ctype && cdata->prev_ctype != (unsigned)-1)
|
||||||
g_string_append (cdata->gstr, ")\n");
|
g_string_append (cdata->gstr, ")\n");
|
||||||
|
|
||||||
switch (ctype) {
|
switch (ctype) {
|
||||||
|
|
||||||
case MU_MSG_CONTACT_TYPE_FROM:
|
case MU_MSG_CONTACT_TYPE_FROM:
|
||||||
if (!cdata->from)
|
add_prefix_maybe (cdata->gstr, &cdata->from, "\t:from (");
|
||||||
g_string_append (cdata->gstr, "\t:from (");
|
|
||||||
cdata->from = TRUE;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MU_MSG_CONTACT_TYPE_TO:
|
case MU_MSG_CONTACT_TYPE_TO:
|
||||||
if (!cdata->to)
|
add_prefix_maybe (cdata->gstr, &cdata->to, "\t:to (");
|
||||||
g_string_append_printf (cdata->gstr,"\t:to (");
|
|
||||||
cdata->to = TRUE;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MU_MSG_CONTACT_TYPE_CC:
|
case MU_MSG_CONTACT_TYPE_CC:
|
||||||
if (!cdata->cc)
|
add_prefix_maybe (cdata->gstr, &cdata->cc, "\t:cc (");
|
||||||
g_string_append_printf (cdata->gstr,"\t:cc (");
|
|
||||||
cdata->cc = TRUE;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MU_MSG_CONTACT_TYPE_BCC:
|
case MU_MSG_CONTACT_TYPE_BCC:
|
||||||
if (!cdata->bcc)
|
add_prefix_maybe (cdata->gstr, &cdata->bcc, "\t:bcc (");
|
||||||
g_string_append_printf (cdata->gstr, "\t:bcc (");
|
|
||||||
cdata->bcc = TRUE;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: g_return_val_if_reached (FALSE);
|
default: g_return_val_if_reached (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cdata->prev_ctype = ctype;
|
cdata->prev_ctype = ctype;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue