[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.4-95-gb690768413
? sunnavy
sunnavy at bestpractical.com
Fri Apr 10 11:00:50 EDT 2020
The branch, 4.4-trunk has been updated
via b690768413800a19fa60ee951f071742a96ad7b1 (commit)
from be6be835d01a39f595503dd7fd4480aed178b482 (commit)
Summary of changes:
share/html/Elements/ShowTransactionAttachments | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit b690768413800a19fa60ee951f071742a96ad7b1
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Apr 10 22:29:27 2020 +0800
Add ModifyContent callback to ShowTransactionAttachments
This is initially for skipping quote folding for some transactions.
diff --git a/share/html/Elements/ShowTransactionAttachments b/share/html/Elements/ShowTransactionAttachments
index d1af2090f8..33d4167dea 100644
--- a/share/html/Elements/ShowTransactionAttachments
+++ b/share/html/Elements/ShowTransactionAttachments
@@ -193,6 +193,16 @@ my $render_attachment = sub {
." of '$content_type' type"
);
+ my $skip_quote_folding;
+ $m->callback(
+ CallbackName => 'ModifyContent',
+ ARGSRef => \%ARGS,
+ Object => $Object,
+ Transaction => $Transaction,
+ Content => \$content,
+ SkipQuoteFolding => \$skip_quote_folding,
+ );
+
# if it's a text/html clean the body and show it
if ( $content_type eq 'text/html' ) {
$content = $m->comp( '/Elements/ScrubHTML', Content => $content );
@@ -217,7 +227,8 @@ my $render_attachment = sub {
object => $Object,
);
- if ( !length $name && RT->Config->Get( 'QuoteFolding', $session{CurrentUser} ) ) {
+ if ( !$skip_quote_folding && !length $name && RT->Config->Get( 'QuoteFolding', $session{CurrentUser} ) ) {
+
eval {
require HTML::Quoted;
$content = HTML::Quoted->extract($content)
@@ -244,7 +255,7 @@ my $render_attachment = sub {
# It's a text type we don't have special handling for
else {
- if ( !length $name && RT->Config->Get( 'QuoteFolding', $session{CurrentUser} ) ) {
+ if ( !$skip_quote_folding && !length $name && RT->Config->Get( 'QuoteFolding', $session{CurrentUser} ) ) {
eval {
require Text::Quoted;
Text::Quoted::set_quote_characters(undef);
-----------------------------------------------------------------------
More information about the rt-commit
mailing list