/[suikacvs]/messaging/bunshin/Bunshin.pm
Suika

Diff of /messaging/bunshin/Bunshin.pm

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

revision 1.2 by wakaba, Sun Jun 16 10:46:29 2002 UTC revision 1.3 by wakaba, Thu Jun 20 11:36:32 2002 UTC
# Line 140  sub _make_a_msg ($@) { Line 140  sub _make_a_msg ($@) {
140    ;    ;
141    my $hdr = $msg->header;    my $hdr = $msg->header;
142    ## Originator and date    ## Originator and date
143      my $from = $hdr->field ('from')->add ($p{from_mail});      my $from = $hdr->field ('from')->add ($p{from_mail} || 'foo@bar.invalid');
144      $from->display_name ($p{from_name}) if length $p{from_name};      $from->display_name ($p{from_name}) if length $p{from_name};
145      my $date = $hdr->field ('date');      my $date = $hdr->field ('date');
146      $p{date_year} ||= (gmtime)[5];      $p{date_year} ||= (gmtime)[5];
147      $date->set_datetime (@p{qw/date_year date_month      $date->set_datetime (@p{qw/date_year date_month
148        date_day date_hour date_minute date_second/},        date_day date_hour date_minute date_second/},
149        zone => $p{date_zone});        zone => $p{date_zone});
150      $hdr->add ('x-uri' => $p{from_uri}) if $p{from_uri};      $hdr->add (x_uri => $p{from_uri}) if $p{from_uri};
151      if ($p{from_face}) {      if ($p{from_face}) {
152        $msg->header->field ('x-face')->value ($p{from_face});        $msg->header->field ('x-face')->value ($p{from_face});
153      } elsif ($p{faces}->{$p{from_mail}}) {      } elsif ($p{faces}->{$p{from_mail}}) {
# Line 158  sub _make_a_msg ($@) { Line 158  sub _make_a_msg ($@) {
158    ## Message attribute    ## Message attribute
159      if (length $p{msg_id}) {      if (length $p{msg_id}) {
160        $hdr->add ('message-id' => $p{msg_id});        $hdr->add ('message-id' => $p{msg_id});
161      } else {      } elsif ($p{msg_id_from} || $p{msg_id_right} || $p{list_id}) {
       my $id_right = $p{msg_id_right} || $p{list_id};  
162        my $c = $p{msg_count};        my $c = $p{msg_count};
163        $c = '.d'.(0+$date) unless defined $p{msg_count};        $c = '.d'.(0+$date) unless defined $p{msg_count};
164        my $mid = sprintf '<msg%s.BS%%list@%s>', $c, $id_right;        my $mid;
165        $mid = sprintf '<msg%s.BS%%%s>', $c, $p{msg_id_from} if $p{msg_id_from};        if ($p{msg_id_from}) {
166            $mid = sprintf '<msg%s.BS%%%s%%%s>', $c, $p{list_id}, $p{msg_id_from};
167          } elsif ($p{msg_id_right}) {
168            $mid = sprintf '<msg%s.BS%%%s%%list@%s>', $c, $p{list_id}, $p{msg_id_right};
169          } else { #if ($p{list_id}) {
170            $mid = sprintf '<msg%s.BS%%list@%s>', $c, $p{list_id};
171          }
172        $hdr->add (($DEBUG?'x-':'').'message-id' => $mid);        $hdr->add (($DEBUG?'x-':'').'message-id' => $mid);
173      }      }
174      $hdr->add (subject => $p{subject}) if length $p{subject};      if (length $p{subject}) {
175          $hdr->add (subject => $p{subject});
176        } elsif (length $p{DEFAULT_subject}) {
177          $hdr->add (subject => $p{DEFAULT_subject});
178        }
179      my $a;      my $a;
180      for (grep {/^misc_/} keys %p) {      for (grep {/^misc_/} keys %p) {
181        $a = $hdr->field ('content-x-properties') unless ref $a;        $a = $hdr->field ('content-x-properties') unless ref $a;
# Line 188  sub _make_a_msg ($@) { Line 197  sub _make_a_msg ($@) {
197        $lid->value ($p{list_id});        $lid->value ($p{list_id});
198        $lid->display_name ($p{list_name}) if length $p{list_name};        $lid->display_name ($p{list_name}) if length $p{list_name};
199      }      }
200      $hdr->add ('x-mail-count' => $p{msg_count}) if defined $p{msg_count};      $hdr->add (x_mail_count => $p{msg_count}) if defined $p{msg_count};
201      $hdr->add ('x-ml-info' => $p{list_info}) if defined $p{list_info};      $hdr->add (x_ml_info => $p{list_info}) if defined $p{list_info};
202      if ($p{base_uri}) {      if ($p{base_uri}) {
203        my $uri = $hdr->add (x_uri => '');        my $uri = $hdr->add (x_uri => '');
204        $uri->value ($p{base_uri});        $uri->value ($p{base_uri});
# Line 201  sub _make_a_msg ($@) { Line 210  sub _make_a_msg ($@) {
210          date_time       => $date->unix_time,          date_time       => $date->unix_time,
211          zone    => $date->zone,          zone    => $date->zone,
212          fmt2str => $self->{fmt2str},          fmt2str => $self->{fmt2str},
213        });        }, \%p);
214        $hdr->add ('x-uri')->value ($urn);        $hdr->add ('x-uri')->value ($urn);
215      }      }
216    ## Additional information    ## Additional information

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24