Changeset 3247e21


Ignore:
Timestamp:
Jun 9, 2013, 12:07:35 PM (11 years ago)
Author:
Robert Jacobs <github@eamp.org>
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.
Message:
Merge 590466bd0b606fc50dc489d946089bf50a837dec into 80c0fc7442dbbcdb248b6b588246470d35b6f8ec
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • t/variable.t

    r4953c44 r590466b  
    1717BarnOwl::unset("-q", "intvar");
    1818is(BarnOwl::getvar("intvar"), "24", "intvar unset bogus");
     19BarnOwl::new_variable_int("intvar", { default => 7 });
     20isnt(BarnOwl::getvar("intvar"), "7", "intvar reinit shouldn't override preexisting value");
    1921
    2022BarnOwl::new_variable_bool("boolvar", { default => 1 });
     
    2830BarnOwl::unset("-q", "boolvar");
    2931is(BarnOwl::getvar("boolvar"), "off", "boolvar unset");
     32BarnOwl::new_variable_bool("boolvar", { default => 1 });
     33isnt(BarnOwl::getvar("boolvar"), "on", "boolvar reinit shouldn't override preexisting value");
    3034
    3135BarnOwl::new_variable_string("strvar", { default => "monkey" });
     
    3741BarnOwl::unset("-q", "strvar");
    3842is(BarnOwl::getvar("strvar"), "cuttlefish", "strvar unset bogus");
     43BarnOwl::new_variable_string("strvar", { default => "monkey" });
     44isnt(BarnOwl::getvar("strvar"), "monkey", "strvar reinit overrode set value");
    3945
    4046BarnOwl::new_variable_enum("enumvar", { validsettings => [qw/foo bar baz/], default => "bar" });
     
    4652BarnOwl::unset("-q", "enumvar");
    4753is(BarnOwl::getvar("enumvar"), "baz", "enumvar unset bogus");
     54BarnOwl::new_variable_enum("enumvar", { validsettings => [qw/foo bar baz/], default => "bar" });
     55isnt(BarnOwl::getvar("enumvar"), "bar", "enumvar reinit overrode set value");
    4856
    4957BarnOwl::new_variable_int("intvar2");
     
    7886$value = "something really long";
    7987is(BarnOwl::getvar("fullvar"), "value is something really long", "fullvar set out-of-band");
     88# Kinda verbose, but better to test all forms
     89my $value = "foo";
     90BarnOwl::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});
     99isnt(BarnOwl::getvar("fullvar"), "value is foo", "fullvar reinit overrode set value");
    80100
    811011;
  • .gitignore

    r81691e8 rb58dea1  
    44.deps
    55META.yml
     6MYMETA.yml
    67Makefile
    78Makefile.in
  • AUTHORS

    r1d2c4c3 r80c0fc7  
    33
    44The following people have provided patches or other contributions:
     5  Alex Vandiver
     6  Kevin Chen
     7  Arun Tharuvai
    58  Sam Hartman
    6   Alex Vandiver
    7   Geoffrey Thomas
    89  Derrick Brashear
    910  David Glasser
     11  Eric Price
    1012  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
    1434
    15 BarnOwl is based on code from Owl, which was originally primarly
     35BarnOwl is based on code from Owl, which was originally primarily
    1636written by James Kretchmar.  Erik Nygren also made substantial
    17 contributions and improvemnts to the program.
     37contributions and improvements to the program.
    1838
    19 The following people provided patches and other techincal support for
     39The following people provided patches and other technical support for
    2040Owl:
    2141
     
    3050  Mark Eichin
    3151
    32 Mark Eichin is also maintaining the debian package of Owl.
     52Mark Eichin is also maintaining the Debian package of Owl.
    3353
    3454The following people helped with beta testing the earliest versions of
  • global.c

    rd555aa1 r6383920  
    849849  } filters[] = {
    850850    { "personal",
    851       "isprivate ^true$ and ( not type ^zephyr$ or ( class ^message  ) )" },
     851      "isprivate ^true$ and ( not type ^zephyr$ or ( class ^message$ ) )" },
    852852    { "trash",
    853853      "class ^mail$ or opcode ^ping$ or type ^admin$ or ( not login ^none$ )" },
  • perl/lib/BarnOwl.pm

    r104a4eb r1ced34f  
    1414                    error debug
    1515                    create_style getnumcolors wordwrap
     16                    message_matches_filter
    1617                    add_dispatch remove_dispatch
    1718                    add_io_dispatch remove_io_dispatch
     
    239240
    240241Returns the number of colors this BarnOwl is capable of displaying
     242
     243=head2 message_matches_filter MESSAGE FILTER_NAME [QUIET = 0]
     244
     245Returns 1 if C<FILTER_NAME> is the name of a valid filter, and
     246C<MESSAGE> matches that filter.  Returns 0 otherwise.  If
     247C<QUIET> is false, this method displays an error message if
     248if C<FILTER_NAME> does not name a valid filter.
    241249
    242250=head2 add_dispatch FD CALLBACK
  • perl/lib/BarnOwl/Message.pm

    ra130fc5 r0adbce1  
    5151sub is_ping     { return 0; }
    5252sub is_mail     { return 0; }
    53 sub is_personal { return shift->is_private; }
     53sub is_personal { return BarnOwl::message_matches_filter(shift, "personal"); }
    5454sub class       { return undef; }
    5555sub instance    { return undef; }
  • perl/lib/BarnOwl/Message/Zephyr.pm

    r6401db3 r0adbce1  
    6565
    6666sub 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 }
    7367
    7468sub is_mail {
  • perlglue.xs

    r3b9ca71 r1ced34f  
    256256        }
    257257
     258bool
     259message_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
    258284const utf8 *
    259285wordwrap(in, cols)
Note: See TracChangeset for help on using the changeset viewer.