Revision 814

libsylph/procheader.c (revision 814)
252 252
	return hlist;
253 253
}
254 254

  
255
GSList *procheader_get_header_list_from_msginfo(MsgInfo *msginfo)
256
{
257
	GSList *hlist = NULL;
258

  
259
	g_return_val_if_fail(msginfo != NULL, NULL);
260

  
261
	if (msginfo->subject)
262
		hlist = procheader_add_header_list(hlist, "Subject",
263
						   msginfo->subject);
264
	if (msginfo->from)
265
		hlist = procheader_add_header_list(hlist, "From",
266
						   msginfo->from);
267
	if (msginfo->to)
268
		hlist = procheader_add_header_list(hlist, "To", msginfo->to);
269
	if (msginfo->cc)
270
		hlist = procheader_add_header_list(hlist, "Cc", msginfo->cc);
271
	if (msginfo->newsgroups)
272
		hlist = procheader_add_header_list(hlist, "Newsgroups",
273
						   msginfo->newsgroups);
274
	if (msginfo->date)
275
		hlist = procheader_add_header_list(hlist, "Date",
276
						   msginfo->date);
277

  
278
	return hlist;
279
}
280

  
255 281
GSList *procheader_add_header_list(GSList *hlist, const gchar *header_name,
256 282
				  const gchar *body)
257 283
{
libsylph/procheader.h (revision 814)
52 52

  
53 53
GSList *procheader_get_header_list_from_file	(const gchar	*file);
54 54
GSList *procheader_get_header_list		(FILE		*fp);
55
GSList *procheader_get_header_list_from_msginfo	(MsgInfo	*msginfo);
55 56
GSList *procheader_add_header_list		(GSList		*hlist,
56 57
						 const gchar	*header_name,
57 58
						 const gchar	*body);
libsylph/filter.c (revision 814)
440 440
	return matched;
441 441
}
442 442

  
443
gboolean filter_rule_requires_full_headers(FilterRule *rule)
444
{
445
	GSList *cur;
446

  
447
	for (cur = rule->cond_list; cur != NULL; cur = cur->next) {
448
		FilterCond *cond = (FilterCond *)cur->data;
449
		const gchar *name = cond->header_name;
450

  
451
		if (cond->type == FLT_COND_HEADER && name) {
452
			if (g_ascii_strcasecmp(name, "Date") != 0 &&
453
			    g_ascii_strcasecmp(name, "From") != 0 &&
454
			    g_ascii_strcasecmp(name, "To") != 0 &&
455
			    g_ascii_strcasecmp(name, "Newsgroups") != 0 &&
456
			    g_ascii_strcasecmp(name, "Subject") != 0)
457
				return TRUE;
458
		} else if (cond->type == FLT_COND_ANY_HEADER ||
459
			   cond->type == FLT_COND_TO_OR_CC)
460
			return TRUE;
461
	}
462

  
463
	return FALSE;
464
}
465

  
443 466
#define RETURN_IF_TAG_NOT_MATCH(tag_name)			\
444 467
	if (strcmp2(xmlnode->tag->tag, tag_name) != 0) {	\
445 468
		g_warning("tag name != \"" tag_name "\"\n");	\
libsylph/filter.h (revision 814)
163 163
					 GSList			*hlist,
164 164
					 FilterInfo		*fltinfo);
165 165

  
166
gboolean filter_rule_requires_full_headers	(FilterRule	*rule);
167

  
166 168
/* read / write config */
167 169
GSList *filter_xml_node_to_filter_list	(GNode			*node);
168 170
void filter_read_config			(void);
ChangeLog.ja (revision 814)
1 1
2005-12-09
2 2

  
3
	* src/filter.[ch]: filter_rule_requires_full_headers(): ?ɲá?
4
	* libsylph/procheader.[ch]: procheader_get_header_list_from_msginfo():
5
	  ?ɲá?
6

  
7
2005-12-09
8

  
3 9
	* src/prefs_filter_edit.[ch]: prefs_filter_edit_cond_hbox_to_cond():
4 10
	  ?羮ʸ???ζ??̤Τ????ΰ??????ɲá?
5 11

  
ChangeLog (revision 814)
1 1
2005-12-09
2 2

  
3
	* src/filter.[ch]: filter_rule_requires_full_headers(): added.
4
	* libsylph/procheader.[ch]: procheader_get_header_list_from_msginfo():
5
	  added.
6

  
7
2005-12-09
8

  
3 9
	* src/prefs_filter_edit.[ch]: prefs_filter_edit_cond_hbox_to_cond():
4 10
	  added an argument for case sensitivity.
5 11

  

Also available in: Unified diff