Changeset 3247e21
- Timestamp:
- Jun 9, 2013, 12:07:35 PM (12 years ago)
- Parents:
- 80c0fc7 (diff), 590466b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
t/variable.t
r4953c44 r590466b 17 17 BarnOwl::unset("-q", "intvar"); 18 18 is(BarnOwl::getvar("intvar"), "24", "intvar unset bogus"); 19 BarnOwl::new_variable_int("intvar", { default => 7 }); 20 isnt(BarnOwl::getvar("intvar"), "7", "intvar reinit shouldn't override preexisting value"); 19 21 20 22 BarnOwl::new_variable_bool("boolvar", { default => 1 }); … … 28 30 BarnOwl::unset("-q", "boolvar"); 29 31 is(BarnOwl::getvar("boolvar"), "off", "boolvar unset"); 32 BarnOwl::new_variable_bool("boolvar", { default => 1 }); 33 isnt(BarnOwl::getvar("boolvar"), "on", "boolvar reinit shouldn't override preexisting value"); 30 34 31 35 BarnOwl::new_variable_string("strvar", { default => "monkey" }); … … 37 41 BarnOwl::unset("-q", "strvar"); 38 42 is(BarnOwl::getvar("strvar"), "cuttlefish", "strvar unset bogus"); 43 BarnOwl::new_variable_string("strvar", { default => "monkey" }); 44 isnt(BarnOwl::getvar("strvar"), "monkey", "strvar reinit overrode set value"); 39 45 40 46 BarnOwl::new_variable_enum("enumvar", { validsettings => [qw/foo bar baz/], default => "bar" }); … … 46 52 BarnOwl::unset("-q", "enumvar"); 47 53 is(BarnOwl::getvar("enumvar"), "baz", "enumvar unset bogus"); 54 BarnOwl::new_variable_enum("enumvar", { validsettings => [qw/foo bar baz/], default => "bar" }); 55 isnt(BarnOwl::getvar("enumvar"), "bar", "enumvar reinit overrode set value"); 48 56 49 57 BarnOwl::new_variable_int("intvar2"); … … 78 86 $value = "something really long"; 79 87 is(BarnOwl::getvar("fullvar"), "value is something really long", "fullvar set out-of-band"); 88 # Kinda verbose, but better to test all forms 89 my $value = "foo"; 90 BarnOwl::new_variable_full("fullvar", { 91 validsettings => '<short-words>', 92 get_tostring => sub { "value is " . $value }, 93 set_fromstring => sub { 94 die "Too long" unless $_[0] =~ /^...?$/; 95 $value = $_[0]; 96 }, 97 takes_on_off => 1 98 }); 99 isnt(BarnOwl::getvar("fullvar"), "value is foo", "fullvar reinit overrode set value"); 80 100 81 101 1; -
.gitignore
r81691e8 rb58dea1 4 4 .deps 5 5 META.yml 6 MYMETA.yml 6 7 Makefile 7 8 Makefile.in -
AUTHORS
r1d2c4c3 r80c0fc7 3 3 4 4 The following people have provided patches or other contributions: 5 Alex Vandiver 6 Kevin Chen 7 Arun Tharuvai 5 8 Sam Hartman 6 Alex Vandiver7 Geoffrey Thomas8 9 Derrick Brashear 9 10 David Glasser 11 Eric Price 10 12 Matthew Goldstein 11 Arun Tharuvai 12 Kevin Chen 13 Eric Price 13 Geoffrey Thomas 14 Anders Kaseorg 15 Greg Price 16 Chris Lesniewski-Laas 17 Alex Dehnert 18 Edward Z. Yang 19 Karl Ramm 20 Evan Broder 21 David Benjamin 22 Cathy Zhang 23 Joshua Oreman 24 Leonid Grinberg 25 Kevin Riggle 26 Brian Sniffen 27 William Throwe 28 Jason Gross 29 Adam Glasgall 30 Tim Hill 31 DD Liu 32 Betsy Riley 33 Robert Jacobs 14 34 15 BarnOwl is based on code from Owl, which was originally primar ly35 BarnOwl is based on code from Owl, which was originally primarily 16 36 written by James Kretchmar. Erik Nygren also made substantial 17 contributions and improvem nts to the program.37 contributions and improvements to the program. 18 38 19 The following people provided patches and other tech incal support for39 The following people provided patches and other technical support for 20 40 Owl: 21 41 … … 30 50 Mark Eichin 31 51 32 Mark Eichin is also maintaining the debian package of Owl.52 Mark Eichin is also maintaining the Debian package of Owl. 33 53 34 54 The following people helped with beta testing the earliest versions of -
global.c
rd555aa1 r6383920 849 849 } filters[] = { 850 850 { "personal", 851 "isprivate ^true$ and ( not type ^zephyr$ or ( class ^message 851 "isprivate ^true$ and ( not type ^zephyr$ or ( class ^message$ ) )" }, 852 852 { "trash", 853 853 "class ^mail$ or opcode ^ping$ or type ^admin$ or ( not login ^none$ )" }, -
perl/lib/BarnOwl.pm
r104a4eb r1ced34f 14 14 error debug 15 15 create_style getnumcolors wordwrap 16 message_matches_filter 16 17 add_dispatch remove_dispatch 17 18 add_io_dispatch remove_io_dispatch … … 239 240 240 241 Returns the number of colors this BarnOwl is capable of displaying 242 243 =head2 message_matches_filter MESSAGE FILTER_NAME [QUIET = 0] 244 245 Returns 1 if C<FILTER_NAME> is the name of a valid filter, and 246 C<MESSAGE> matches that filter. Returns 0 otherwise. If 247 C<QUIET> is false, this method displays an error message if 248 if C<FILTER_NAME> does not name a valid filter. 241 249 242 250 =head2 add_dispatch FD CALLBACK -
perl/lib/BarnOwl/Message.pm
ra130fc5 r0adbce1 51 51 sub is_ping { return 0; } 52 52 sub is_mail { return 0; } 53 sub is_personal { return shift->is_private; }53 sub is_personal { return BarnOwl::message_matches_filter(shift, "personal"); } 54 54 sub class { return undef; } 55 55 sub instance { return undef; } -
perl/lib/BarnOwl/Message/Zephyr.pm
r6401db3 r0adbce1 65 65 66 66 sub is_ping { return (lc(shift->opcode) eq "ping"); } 67 68 sub is_personal {69 my ($m) = @_;70 return ((lc($m->class) eq "message")71 && $m->is_private);72 }73 67 74 68 sub is_mail { -
perlglue.xs
r3b9ca71 r1ced34f 256 256 } 257 257 258 bool 259 message_matches_filter(message, filter_name, quiet = false) 260 SV *message 261 const char *filter_name 262 bool quiet 263 PREINIT: 264 owl_message *m; 265 const owl_filter *f; 266 CODE: 267 { 268 if (!SvROK(message) || SvTYPE(SvRV(message)) != SVt_PVHV) { 269 croak("Usage: BarnOwl::message_matches_filter($message, $filter_name[, $quiet])"); 270 } 271 272 m = owl_perlconfig_hashref2message(message); 273 f = owl_global_get_filter(&g, filter_name); 274 if (!f && !quiet) { 275 owl_function_error("%s filter is not defined", filter_name); 276 } 277 RETVAL = f && owl_filter_message_match(f, m); 278 } 279 OUTPUT: 280 RETVAL 281 CLEANUP: 282 owl_message_delete(m); 283 258 284 const utf8 * 259 285 wordwrap(in, cols)
Note: See TracChangeset
for help on using the changeset viewer.