| | 154 | int i; |
| | 155 | static const struct { |
| | 156 | const char *name; |
| | 157 | const char *desc; |
| | 158 | } filters[] = { |
| | 159 | { "personal", |
| | 160 | "isprivate ^true$ and ( not type ^zephyr$ or ( class ^message ) )" }, |
| | 161 | { "trash", |
| | 162 | "class ^mail$ or opcode ^ping$ or type ^admin$ or ( not login ^none$ )" }, |
| | 163 | { "wordwrap", "not ( type ^admin$ or type ^zephyr$ )" }, |
| | 164 | { "ping", "opcode ^ping$" }, |
| | 165 | { "auto", "opcode ^auto$" }, |
| | 166 | { "login", "not login ^none$" }, |
| | 167 | { "reply-lockout", "class ^noc or class ^mail$" }, |
| | 168 | { "out", "direction ^out$" }, |
| | 169 | { "aim", "type ^aim$" }, |
| | 170 | { "zephyr", "type ^zephyr$" }, |
| | 171 | { "none", "false" }, |
| | 172 | { "all", "true" }, |
| | 173 | { NULL, NULL } |
| | 174 | }; |
| 155 | | f=owl_malloc(sizeof(owl_filter)); |
| 156 | | owl_filter_init_fromstring(f, "personal", "isprivate ^true$ and ( not type ^zephyr$" |
| 157 | | " or ( class ^message ) )"); |
| 158 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| 159 | | |
| 160 | | f=owl_malloc(sizeof(owl_filter)); |
| 161 | | owl_filter_init_fromstring(f, "wordwrap", "not ( type ^admin$ or type ^zephyr$ ) "); |
| 162 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| 163 | | |
| 164 | | f=owl_malloc(sizeof(owl_filter)); |
| 165 | | owl_filter_init_fromstring(f, "trash", "class ^mail$ or opcode ^ping$ or type ^admin$ or ( not login ^none$ )"); |
| 166 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| 167 | | |
| 168 | | f=owl_malloc(sizeof(owl_filter)); |
| 169 | | owl_filter_init_fromstring(f, "ping", "opcode ^ping$"); |
| 170 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| 171 | | |
| 172 | | f=owl_malloc(sizeof(owl_filter)); |
| 173 | | owl_filter_init_fromstring(f, "auto", "opcode ^auto$"); |
| 174 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| 175 | | |
| 176 | | f=owl_malloc(sizeof(owl_filter)); |
| 177 | | owl_filter_init_fromstring(f, "login", "not login ^none$"); |
| 178 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| 179 | | |
| 180 | | f=owl_malloc(sizeof(owl_filter)); |
| 181 | | owl_filter_init_fromstring(f, "reply-lockout", "class ^noc or class ^mail$"); |
| 182 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| 183 | | |
| 184 | | f=owl_malloc(sizeof(owl_filter)); |
| 185 | | owl_filter_init_fromstring(f, "out", "direction ^out$"); |
| 186 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| 187 | | |
| 188 | | f=owl_malloc(sizeof(owl_filter)); |
| 189 | | owl_filter_init_fromstring(f, "aim", "type ^aim$"); |
| 190 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| 191 | | |
| 192 | | f=owl_malloc(sizeof(owl_filter)); |
| 193 | | owl_filter_init_fromstring(f, "zephyr", "type ^zephyr$"); |
| 194 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| 195 | | |
| 196 | | f=owl_malloc(sizeof(owl_filter)); |
| 197 | | owl_filter_init_fromstring(f, "none", "false"); |
| 198 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| 199 | | |
| 200 | | f=owl_malloc(sizeof(owl_filter)); |
| 201 | | owl_filter_init_fromstring(f, "all", "true"); |
| 202 | | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| | 177 | |
| | 178 | for (i = 0; filters[i].name != NULL; i++) { |
| | 179 | f = owl_malloc(sizeof(owl_filter)); |
| | 180 | owl_filter_init_fromstring(f, filters[i].name, filters[i].desc); |
| | 181 | owl_list_append_element(owl_global_get_filterlist(&g), f); |
| | 182 | } |