Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "html" reception mode #125 #127

Merged
merged 1 commit into from
Nov 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions src/lib/Sympa/List.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,6 @@ sub get_recipients_per_mode {
my (@tabrcpt_mail, @tabrcpt_mail_verp,
@tabrcpt_notice, @tabrcpt_notice_verp,
@tabrcpt_txt, @tabrcpt_txt_verp,
@tabrcpt_html, @tabrcpt_html_verp,
@tabrcpt_urlize, @tabrcpt_urlize_verp,
@tabrcpt_digestplain, @tabrcpt_digestplain_verp,
@tabrcpt_digest, @tabrcpt_digest_verp,
Expand Down Expand Up @@ -1486,12 +1485,6 @@ sub get_recipients_per_mode {
} else {
push @tabrcpt_txt, $user->{'email'};
}
} elsif ($user->{'reception'} eq 'html') {
if ($user->{'bounce_address'}) {
push @tabrcpt_html_verp, $user->{'email'};
} else {
push @tabrcpt_html, $user->{'email'};
}
} elsif ($user->{'reception'} eq 'urlize') {
if ($user->{'bounce_address'}) {
push @tabrcpt_urlize_verp, $user->{'email'};
Expand All @@ -1511,12 +1504,10 @@ sub get_recipients_per_mode {
unless @tabrcpt_mail
or @tabrcpt_notice
or @tabrcpt_txt
or @tabrcpt_html
or @tabrcpt_urlize
or @tabrcpt_mail_verp
or @tabrcpt_notice_verp
or @tabrcpt_txt_verp
or @tabrcpt_html_verp
or @tabrcpt_urlize_verp;

my $available_recipients;
Expand All @@ -1532,10 +1523,6 @@ sub get_recipients_per_mode {
$available_recipients->{'txt'}{'noverp'} = \@tabrcpt_txt if @tabrcpt_txt;
$available_recipients->{'txt'}{'verp'} = \@tabrcpt_txt_verp
if @tabrcpt_txt_verp;
$available_recipients->{'html'}{'noverp'} = \@tabrcpt_html
if @tabrcpt_html;
$available_recipients->{'html'}{'verp'} = \@tabrcpt_html_verp
if @tabrcpt_html_verp;
$available_recipients->{'urlize'}{'noverp'} = \@tabrcpt_urlize
if @tabrcpt_urlize;
$available_recipients->{'urlize'}{'verp'} = \@tabrcpt_urlize_verp
Expand Down Expand Up @@ -8891,9 +8878,10 @@ sub is_msg_topic_tagging_required {
####################################################
# Select users subscribed to a topic that is in
# the topic list incoming when reception mode is 'mail', 'notice', 'not_me',
# 'txt', 'html' or 'urlize', and the other
# 'txt' or 'urlize', and the other
# subscribers (recpetion mode different from 'mail'), 'mail' and no topic
# subscription
# subscription.
# Note: 'html' mode was deprecated as of 6.2.23b.2.
#
# IN : -$self(+) : ref(List)
# -$string_topic(+) : string splitted by ','
Expand Down
12 changes: 7 additions & 5 deletions src/lib/Sympa/ListDef.pm
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,15 @@ our %pinfo = (
'Only these modes will be allowed for the subscribers of this list. If a subscriber has a reception mode not in the list, Sympa uses the mode specified in the default_user_options paragraph.',
'format' => [
'mail', 'notice', 'digest', 'digestplain',
'summary', 'nomail', 'txt', 'html',
'urlize', 'not_me'
'summary', 'nomail', 'txt', 'urlize',
'not_me'
],
'synonym' => {'html' => 'mail'},
'field_type' => 'reception',
'occurrence' => '1-n',
'split_char' => ',',
'default' =>
'mail,notice,digest,digestplain,summary,nomail,txt,html,urlize,not_me'
'mail,notice,digest,digestplain,summary,nomail,txt,urlize,not_me'
}
}
},
Expand All @@ -419,9 +420,10 @@ our %pinfo = (
'gettext_comment' => 'Mail reception mode.',
'format' => [
'mail', 'notice', 'digest', 'digestplain',
'summary', 'nomail', 'txt', 'html',
'urlize', 'not_me'
'summary', 'nomail', 'txt', 'urlize',
'not_me'
],
'synonym' => {'html' => 'mail'},
'field_type' => 'reception',
'occurrence' => '1',
'default' => 'mail'
Expand Down
1 change: 0 additions & 1 deletion src/lib/Sympa/ListOpt.pm
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ my %reception_mode = (
'summary' => {'gettext_id' => 'summary mode'},
'notice' => {'gettext_id' => 'notice mode'},
'txt' => {'gettext_id' => 'text-only mode'},
'html' => {'gettext_id' => 'html-only mode'},
'urlize' => {'gettext_id' => 'urlize mode'},
'nomail' => {'gettext_id' => 'no mail'},
'not_me' => {'gettext_id' => 'not receiving your own posts'}
Expand Down
35 changes: 12 additions & 23 deletions src/lib/Sympa/Message.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1424,16 +1424,7 @@ sub prepare_message_according_to_mode {

my $robot_id = $list->{'domain'};

if ($mode eq 'mail') {
##Prepare message for normal reception mode
## Add a footer
unless ($self->{'protected'}) {
my $entity = $self->as_entity->dup;

_decorate_parts($entity, $list);
$self->set_entity($entity);
}
} elsif ($mode eq 'nomail'
if ($mode eq 'nomail'
or $mode eq 'summary'
or $mode eq 'digest'
or $mode eq 'digestplain') {
Expand All @@ -1455,16 +1446,6 @@ sub prepare_message_according_to_mode {
## Add a footer
_decorate_parts($entity, $list);
$self->set_entity($entity);
} elsif ($mode eq 'html') {
##Prepare message for html reception mode
my $entity = $self->as_entity->dup;

if (_as_singlepart($entity, 'text/html')) {
$log->syslog('notice', 'Multipart message changed to singlepart');
}
## Add a footer
_decorate_parts($entity, $list);
$self->set_entity($entity);
} elsif ($mode eq 'urlize') {
# Prepare message for urlize reception mode.
# Not extract message/rfc822 parts.
Expand All @@ -1482,8 +1463,15 @@ sub prepare_message_according_to_mode {
## Add a footer
_decorate_parts($entity, $list);
$self->set_entity($entity);
} else {
die sprintf 'Unknown variable/reception mode %s', $mode;
} else { # 'mail'
# Prepare message for normal reception mode,
# and add a footer.
unless ($self->{'protected'}) {
my $entity = $self->as_entity->dup;

_decorate_parts($entity, $list);
$self->set_entity($entity);
}
}

return $self;
Expand Down Expand Up @@ -3712,7 +3700,8 @@ Customized text, or C<undef> if error occurred.

I<Instance method>.
Transforms the message according to reception mode:
C<'mail'>, C<'notice'>, C<'txt'> or C<'html'>.
C<'mail'>, C<'notice'> or C<'txt'>.
Note: 'html' mode was deprecated as of 6.2.23b.2.

By C<'nomail'>, C<'digest'>, C<'digestplain'> or C<'summary'> mode,
the message is not modified.
Expand Down