]> Sergey Matveev's repositories - public-inbox.git/commitdiff
feed: inline feed entry generation
authorEric Wong <e@80x24.org>
Wed, 18 May 2016 02:27:07 +0000 (02:27 +0000)
committerEric Wong <e@80x24.org>
Wed, 18 May 2016 02:27:05 +0000 (02:27 +0000)
Remove unnecessary wrapper subroutines and constants
which are only used once.

lib/PublicInbox/Feed.pm
lib/PublicInbox/Hval.pm
lib/PublicInbox/View.pm

index 52fe0db4ac9ece1d5431a363b1646c1150e12449..0b864c2c272cdaa54aa968dbebea09e59106bca1 100644 (file)
@@ -316,10 +316,10 @@ sub add_to_feed {
        defined $mid or return 0;
        $mid = PublicInbox::Hval->new_msgid($mid);
        my $href = $mid->as_href;
-       my $content = PublicInbox::View->feed_entry($mime);
-       defined($content) or return 0;
-       $mime = undef;
 
+       my $content = qq(<pre\nstyle="white-space:pre-wrap">) .
+               PublicInbox::View::multipart_text_as_html($mime) .
+               '</pre>';
        my $date = $header_obj->header('Date');
        my $updated = feed_updated($date);
 
index 70bae7c67db9bfc59e36779016e1842a3292a7ff..9ba780975cf2d5b1a5ca5188affbe3efa891acf2 100644 (file)
@@ -16,7 +16,6 @@ our @EXPORT_OK = qw/ascii_html/;
 # and screw up rendering on some browsers.  This is the only CSS style
 # feature we use.
 use constant STYLE => '<style>pre{white-space:pre-wrap}</style>';
-use constant PRE => "<pre\nstyle=\"white-space:pre-wrap\">"; # legacy
 
 my $enc_ascii = find_encoding('us-ascii');
 
index 3fa7cfc23d11d032b3e77d1b57950e4e1f56e8f5..2513cd0b912326cc5a2d28d1e7cdc8697cbf3dfd 100644 (file)
@@ -73,13 +73,6 @@ sub msg_reply {
        '</pre><hr /><pre>' . $footer .  '</pre></body></html>';
 }
 
-sub feed_entry {
-       my ($class, $mime) = @_;
-
-       # no <head> here for <style>...
-       PublicInbox::Hval::PRE . multipart_text_as_html($mime) . '</pre>';
-}
-
 sub in_reply_to {
        my ($hdr) = @_;
        my $irt = $hdr->header_raw('In-Reply-To');