]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Inbox.pm
view: introduce WwwStream interface
[public-inbox.git] / lib / PublicInbox / Inbox.pm
index 4bcab96f61469df0ff22a806f64741e12d1d281d..c982d0b41bc2212211164a333de8ff82d3385563 100644 (file)
@@ -64,16 +64,6 @@ sub cloneurl {
        $self->{cloneurl} = \@url;
 }
 
-# TODO: can we remove this?
-sub footer_html {
-       my ($self) = @_;
-       my $footer = $self->{footer};
-       return $footer if defined $footer;
-       $footer = try_cat("$self->{mainrepo}/public-inbox/footer.html");
-       chomp $footer;
-       $self->{footer} = $footer;
-}
-
 sub base_url {
        my ($self, $prq) = @_; # Plack::Request
        if (defined $prq) {
@@ -83,7 +73,7 @@ sub base_url {
        } else {
                # either called from a non-PSGI environment (e.g. NNTP/POP3)
                $self->{-base_url} ||= do {
-                       my $url = $self->{url};
+                       my $url = $self->{url} or return undef;
                        # expand protocol-relative URLs to HTTPS if we're
                        # not inside a web server
                        $url = "https:$url" if $url =~ m!\A//!;
@@ -93,4 +83,11 @@ sub base_url {
        }
 }
 
+sub nntp_usable {
+       my ($self) = @_;
+       my $ret = $self->mm && $self->search;
+       $self->{mm} = $self->{search} = undef;
+       $ret;
+}
+
 1;