Пример #1
0
Файл: mu-cmd.c Проект: antono/mu
/* we ignore fields for now */
static gboolean
view_msg_plain (MuMsg *msg, const gchar *fields, gboolean summary,
	  gboolean color)
{
	gchar *attachs;
	time_t date;
	const GSList *lst;

	print_field ("From", mu_msg_get_from (msg), color);
	print_field ("To",   mu_msg_get_to (msg), color);
	print_field ("Cc",   mu_msg_get_cc (msg), color);
	print_field ("Bcc",  mu_msg_get_bcc (msg), color);
	print_field ("Subject",  mu_msg_get_subject (msg), color);

	if ((date = mu_msg_get_date (msg)))
		print_field ("Date", mu_date_str_s ("%c", date),
			     color);

	if ((lst = mu_msg_get_tags (msg))) {
		gchar *tags;
		tags = mu_str_from_list (lst,',');
		print_field ("Tags", tags, color);
		g_free (tags);
	}

	if ((attachs = get_attach_str (msg))) {
		print_field ("Attachments", attachs, color);
		g_free (attachs);
	}

	body_or_summary (msg, summary, color);

	return TRUE;
}
Пример #2
0
static const char*
field_string_list (MuMsg *msg, MuMsgFieldId mfid)
{
	char *str;
	const GSList *lst;
	static char buf[80];

	lst = mu_msg_get_field_string_list (msg, mfid);
	if (!lst)
		return NULL;

	str = mu_str_from_list (lst, ',');
	if (str) {
		strncpy (buf, str, sizeof(buf));
		g_free (str);
		return buf;
	}

	return NULL;
}