|
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"
|
@@ -184,6 +185,30 @@ rule_check_item_category (rulePtr rule, itemPtr item)
|
184 | 185 | return FALSE;
|
185 | 186 | }
|
186 | 187 |
|
| 188 | +static gboolean |
| 189 | +rule_check_item_author (rulePtr rule, itemPtr item) |
| 190 | +{ |
| 191 | + GSList *iter; |
| 192 | + |
| 193 | + iter = metadata_list_get_values (item->metadata, "author"); |
| 194 | + while (iter) { |
| 195 | + if (rule_strcasecmp ((gchar *)iter->data, rule->valueCaseFolded)) { |
| 196 | + return TRUE; |
| 197 | + } |
| 198 | + iter = g_slist_next (iter); |
| 199 | + } |
| 200 | + |
| 201 | + iter = metadata_list_get_values (item->metadata, "creator"); |
| 202 | + while (iter) { |
| 203 | + if (rule_strcasecmp ((gchar *)iter->data, rule->valueCaseFolded)) { |
| 204 | + return TRUE; |
| 205 | + } |
| 206 | + iter = g_slist_next (iter); |
| 207 | + } |
| 208 | + return FALSE; |
| 209 | +} |
| 210 | + |
| 211 | + |
187 | 212 | static gboolean
|
188 | 213 | rule_check_feed_title (rulePtr rule, itemPtr item)
|
189 | 214 | {
|
@@ -250,6 +275,7 @@ rule_init (void)
|
250 | 275 | rule_info_add (rule_check_item_all, ITEM_MATCH_RULE_ID, _("Item"), _("does contain"), _("does not contain"), TRUE);
|
251 | 276 | rule_info_add (rule_check_item_title, ITEM_TITLE_MATCH_RULE_ID, _("Item title"), _("does contain"), _("does not contain"), TRUE);
|
252 | 277 | rule_info_add (rule_check_item_description, ITEM_DESC_MATCH_RULE_ID, _("Item body"), _("does contain"), _("does not contain"), TRUE);
|
| 278 | + rule_info_add (rule_check_item_author, ITEM_AUTHOR_MATCH_RULE_ID, _("Item author"), _("does contain"), _("does not contain"), TRUE); |
253 | 279 | rule_info_add (rule_check_item_is_unread, "unread", _("Read status"), _("is unread"), _("is read"), FALSE);
|
254 | 280 | rule_info_add (rule_check_item_is_flagged, "flagged", _("Flag status"), _("is flagged"), _("is unflagged"), FALSE);
|
255 | 281 | rule_info_add (rule_check_item_has_enc, "enclosure", _("Enclosure"), _("included"), _("not included"), FALSE);
|
|
0 commit comments