|
30 | 30 | #define ITEM_MATCH_RULE_ID "exact"
|
31 | 31 | #define ITEM_TITLE_MATCH_RULE_ID "exact_title"
|
32 | 32 | #define ITEM_DESC_MATCH_RULE_ID "exact_desc"
|
| 33 | +#define ITEM_AUTHOR_MATCH_RULE_ID "exact_author" |
33 | 34 | #define FEED_TITLE_MATCH_RULE_ID "feed_title"
|
34 | 35 | #define FEED_SOURCE_MATCH_RULE_ID "feed_source"
|
35 | 36 | #define PARENT_FOLDER_MATCH_RULE_ID "parent_folder"
|
@@ -199,6 +200,30 @@ rule_check_item_category (rulePtr rule, itemPtr item)
|
199 | 200 | return FALSE;
|
200 | 201 | }
|
201 | 202 |
|
| 203 | +static gboolean |
| 204 | +rule_check_item_author (rulePtr rule, itemPtr item) |
| 205 | +{ |
| 206 | + GSList *iter; |
| 207 | + |
| 208 | + iter = metadata_list_get_values (item->metadata, "author"); |
| 209 | + while (iter) { |
| 210 | + if (rule_strcasecmp ((gchar *)iter->data, rule->valueCaseFolded)) { |
| 211 | + return TRUE; |
| 212 | + } |
| 213 | + iter = g_slist_next (iter); |
| 214 | + } |
| 215 | + |
| 216 | + iter = metadata_list_get_values (item->metadata, "creator"); |
| 217 | + while (iter) { |
| 218 | + if (rule_strcasecmp ((gchar *)iter->data, rule->valueCaseFolded)) { |
| 219 | + return TRUE; |
| 220 | + } |
| 221 | + iter = g_slist_next (iter); |
| 222 | + } |
| 223 | + return FALSE; |
| 224 | +} |
| 225 | + |
| 226 | + |
202 | 227 | static gboolean
|
203 | 228 | rule_check_feed_title (rulePtr rule, itemPtr item)
|
204 | 229 | {
|
@@ -265,6 +290,7 @@ rule_init (void)
|
265 | 290 | rule_info_add (rule_check_item_all, ITEM_MATCH_RULE_ID, _("Item"), _("does contain"), _("does not contain"), TRUE);
|
266 | 291 | rule_info_add (rule_check_item_title, ITEM_TITLE_MATCH_RULE_ID, _("Item title"), _("does contain"), _("does not contain"), TRUE);
|
267 | 292 | rule_info_add (rule_check_item_description, ITEM_DESC_MATCH_RULE_ID, _("Item body"), _("does contain"), _("does not contain"), TRUE);
|
| 293 | + rule_info_add (rule_check_item_author, ITEM_AUTHOR_MATCH_RULE_ID, _("Item author"), _("does contain"), _("does not contain"), TRUE); |
268 | 294 | rule_info_add (rule_check_item_is_unread, "unread", _("Read status"), _("is unread"), _("is read"), FALSE);
|
269 | 295 | rule_info_add (rule_check_item_is_flagged, "flagged", _("Flag status"), _("is flagged"), _("is unflagged"), FALSE);
|
270 | 296 | rule_info_add (rule_check_item_has_enc, "enclosure", _("Enclosure"), _("included"), _("not included"), FALSE);
|
|
0 commit comments