/[suikacvs]/messaging/manakai/lib/Message/Field/Subject.pm
Suika

Diff of /messaging/manakai/lib/Message/Field/Subject.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by wakaba, Thu Aug 1 06:42:38 2002 UTC revision 1.10 by wakaba, Thu Aug 1 09:19:46 2002 UTC
# Line 40  push @ISA, q(Message::Field::Structured) Line 40  push @ISA, q(Message::Field::Structured)
40          $REG{prefix_general} = qr/((?:$REG{prefix_re}|$REG{prefix_fwd})\^?[\[\(]?\d*[\]\)]?[:>]$REG{FWS})+/x;          $REG{prefix_general} = qr/((?:$REG{prefix_re}|$REG{prefix_fwd})\^?[\[\(]?\d*[\]\)]?[:>]$REG{FWS})+/x;
41          $REG{prefix_general_list} = qr/($REG{prefix_general}|$REG{FWS}$REG{prefix_list}$REG{FWS})+/x;          $REG{prefix_general_list} = qr/($REG{prefix_general}|$REG{FWS}$REG{prefix_list}$REG{FWS})+/x;
42    
 ## Initialize of this class -- called by constructors  
43  %DEFAULT = (  %DEFAULT = (
44          -_MEMBERS       => [qw/is list_count list_name news_control was_subject/],          -_MEMBERS       => [qw/is list_count list_name news_control was_subject/],
45          -_METHODS       => [qw/as_plain_string is list_count list_name news_control was_subject value value_type/],          -_METHODS       => [qw/as_plain_string is list_count list_name
46                                   news_control was_subject value value_type/],
47          #encoding_after_encode          #encoding_after_encode
48          #encoding_before_decode          #encoding_before_decode
49          -format_news_control    => 'cmsg %s',          -format_news_control    => 'cmsg %s',
50          -format_prefix_fwd      => 'Fwd: %s',          -format_prefix_fwd      => 'Fwd: %s',
51            -format_prefix_list     => '[%s:%05d] %s',
52          -format_prefix_re       => 'Re: %s',          -format_prefix_re       => 'Re: %s',
53          -format_was_subject     => '%s (was: %s)',          -format_was_subject     => '%s (was: %s)',
54          #field_param_name          #field_param_name
# Line 59  push @ISA, q(Message::Field::Structured) Line 60  push @ISA, q(Message::Field::Structured)
60          #hook_encode_string          #hook_encode_string
61          #hook_decode_string          #hook_decode_string
62          -output_general_prefix  => 1,          -output_general_prefix  => 1,
63          -output_list_prefix     => 1,          -output_list_prefix     => 0,
64          -output_news_control    => 1,          -output_news_control    => 1,
65          -output_was_subject     => 1,   ## ["-"] 1*DIGIT          -output_was_subject     => 1,   ## ["-"] 1*DIGIT
66          #parse_all          #parse_all
67          -parse_was_subject      => 1,          -parse_was_subject      => 1,
68          -use_general_prefix     => 1,          -use_general_prefix     => 1,
69          -use_list_prefix        => 0,          -use_list_prefix        => 1,
70          -use_message_from_subject       => 0,          -use_message_from_subject       => 0,
71          -use_news_control       => 1,          -use_news_control       => 1,
72          -use_was_subject        => 1,          -use_was_subject        => 1,
# Line 86  sub _init ($;%) { Line 87  sub _init ($;%) {
87    my %options = @_;    my %options = @_;
88    $self->SUPER::_init (%DEFAULT, %options);    $self->SUPER::_init (%DEFAULT, %options);
89        
90      my $fname = $self->{option}->{field_name};
91      if ($fname =~ /^x-.subject$/) {
92        $self->{option}->{use_list_prefix} = 0 unless defined $options{-use_list_prefix};
93        $self->{option}->{use_news_control} = 0 unless defined $options{-use_news_control};
94        $self->{option}->{use_message_from_subject} = 0 unless defined $options{-use_message_from_subject};
95      }
96      
97    #$self->{option}->{value_type}->{news_control} = ['Message::Field::UsenetControl',{}, [qw//]];    #$self->{option}->{value_type}->{news_control} = ['Message::Field::UsenetControl',{}, [qw//]];
98    $self->{option}->{value_type}->{was_subject} = ['Message::Field::Subject',{},    $self->{option}->{value_type}->{was_subject} = ['Message::Field::Subject',{},
99      [qw/format_news_control format_prefix_fwd format_prefix_re      [qw/format_news_control format_prefix_fwd format_prefix_re
# Line 221  sub stringify ($;%) { Line 229  sub stringify ($;%) {
229        $value = sprintf $option{format_prefix_re}, $value if $self->{is}->{reply};        $value = sprintf $option{format_prefix_re}, $value if $self->{is}->{reply};
230        $value = sprintf $option{format_prefix_fwd}, $value if $self->{is}->{foward};        $value = sprintf $option{format_prefix_fwd}, $value if $self->{is}->{foward};
231      }      }
232        if ($option{use_list_prefix} && $option{output_list_prefix}) {
233          $value = sprintf $option{format_prefix_list},
234            $self->{list_name}, $self->{list_count}, $value
235            if length $self->{list_name} && defined $self->{list_count};
236        }
237      if ($option{use_was_subject} && $option{output_was_subject} > 0) {      if ($option{use_was_subject} && $option{output_was_subject} > 0) {
238        my $was;        my $was;
239        if (ref $self->{was_subject}) {        if (ref $self->{was_subject}) {

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24