]> Sergey Matveev's repositories - public-inbox.git/log
public-inbox.git
8 years agowww: root atom feed is "new.atom" and not "atom.xml"
Eric Wong [Tue, 1 Sep 2015 08:55:25 +0000 (08:55 +0000)]
www: root atom feed is "new.atom" and not "atom.xml"

The MIME type entry for Atom feed relies on "atom",
so allow properly-configured static file servers to serve
it with the correct Content-Type header.

8 years agowww: compile mbox regexp only once
Eric Wong [Tue, 1 Sep 2015 08:55:24 +0000 (08:55 +0000)]
www: compile mbox regexp only once

No need for 'x' modifier to span more lines, though

8 years agoimplement per-thread Atom feeds
Eric Wong [Tue, 1 Sep 2015 08:55:23 +0000 (08:55 +0000)]
implement per-thread Atom feeds

This allows users to subscribe to only a single thread
with their feed reader without subscribing to the rest of
the thread.

Update our endpoint notes while we're at it.

8 years agofeed: extract atom header generation
Eric Wong [Tue, 1 Sep 2015 08:55:22 +0000 (08:55 +0000)]
feed: extract atom header generation

We'll be using it for per-thread subscriptions

8 years agofeed: use updated date based on git commit date
Eric Wong [Tue, 1 Sep 2015 08:55:21 +0000 (08:55 +0000)]
feed: use updated date based on git commit date

This will hopefully make life easier for feed readers.

8 years agosearch: show newest results first
Eric Wong [Tue, 1 Sep 2015 08:55:20 +0000 (08:55 +0000)]
search: show newest results first

Like revision control history, older stuff is less relevant,
so favor newer stuff, first.

8 years agosearch: allow querying all mail with ''
Eric Wong [Tue, 1 Sep 2015 08:55:19 +0000 (08:55 +0000)]
search: allow querying all mail with ''

This makes dumping recent topics easier, hopefully.

8 years agosearch: reduce redundant doc data
Eric Wong [Tue, 1 Sep 2015 08:55:18 +0000 (08:55 +0000)]
search: reduce redundant doc data

Redundant document data increases our database size, pull the
smsg->mid off the unique term, the smsg->ts off the value, and
only generate the formatted display date off smsg->ts.

8 years agowww: avoid BEGIN block for config loading
Eric Wong [Sun, 30 Aug 2015 10:12:54 +0000 (10:12 +0000)]
www: avoid BEGIN block for config loading

It fails the syntax check if a user does not have
~/.public-inbox/config setup.  Anyways we can safely
use ||= on a global since we do not support threads.

8 years agoview: avoid broken parent link in per-message view
Eric Wong [Sun, 30 Aug 2015 10:08:30 +0000 (10:08 +0000)]
view: avoid broken parent link in per-message view

Broken by commit f24d362fb0959cdfab37a6da0a66a985764a2752
("view: display thread outline in single-message view")

8 years agoview: remove "threadlink" from thread view
Eric Wong [Sun, 30 Aug 2015 01:51:22 +0000 (01:51 +0000)]
view: remove "threadlink" from thread view

We're already inside the thread, and our thread summary inside
/m/$MESSAGE_ID/ is already sufficient got navigate back to the
/t/$MESSAGE_ID/ page.  So I think it's sufficient to keep the
/t/$MESSAGE_ID/ page lighter with fewer links and avoid
introducing strange terminology.

In contrast, "permalink" is relatively well-known and
not an alien term to readers:

https://en.wikipedia.org/wiki/Permalink

8 years agoview: remove "threadlink" name in per-message view
Eric Wong [Sun, 30 Aug 2015 01:45:32 +0000 (01:45 +0000)]
view: remove "threadlink" name in per-message view

It's a strange word and I'm not quite comfortable with it
in a message view.  Instead, use a descriptive link for
the thread headers.

8 years agomid2path: clean MID of angle brackets '<>'
Eric Wong [Sun, 30 Aug 2015 01:26:46 +0000 (01:26 +0000)]
mid2path: clean MID of angle brackets '<>'

We screwed up and needed to fix URL generation with '<>'
in them.  Regardless, users may attempt to copy and paste
URLs with '<>' in them, do not punish them for that.

8 years agoview: fix broken threadlink
Eric Wong [Sun, 30 Aug 2015 01:20:55 +0000 (01:20 +0000)]
view: fix broken threadlink

This regression was accidentally introduced in
commit f24d362fb0959cdfab37a6da0a66a985764a2752
("view: display thread outline in single-message view")

8 years agopublic-inbox-index: resolve git directory if run inside one
Eric Wong [Sun, 30 Aug 2015 01:04:31 +0000 (01:04 +0000)]
public-inbox-index: resolve git directory if run inside one

I often forget to pass the correct path to a git directory
or run from inside one.  Fortunately git is script-friendly
and allows easily resolving the correct GIT_DIR path.

8 years agosearch: do not index references and inreplyto terms
Eric Wong [Sun, 30 Aug 2015 00:38:05 +0000 (00:38 +0000)]
search: do not index references and inreplyto terms

We no longer need them, as we can rely on index-time thread
resolution and thread merging.  This allows us to index less
data and hopefully increase efficiency.

8 years agoview: display thread outline in single-message view
Eric Wong [Sun, 30 Aug 2015 00:22:43 +0000 (00:22 +0000)]
view: display thread outline in single-message view

If Xapian search is available, we can load most of the
entire thread and show a more meaningful navigation tree
than the References: and In-Reply-To: headers.  Searching
on those headers themselves is unreliable because it is
possible for clients to omit some references.

8 years agoview: update linkification regexp to be more domain sensitive
Eric Wong [Sun, 30 Aug 2015 00:12:31 +0000 (00:12 +0000)]
view: update linkification regexp to be more domain sensitive

This avoids capturing links such as "http://#{foo}" => "http://#"
inside diffs

8 years agoview: remove dead commented line
Eric Wong [Sat, 29 Aug 2015 21:39:00 +0000 (21:39 +0000)]
view: remove dead commented line

Not needed since commit 9a2931759c3dcbd879728b49151aa3f8a641b506
("wire up to display non-suffixed Message-ID links")

8 years agoavoid length in boolean context
Eric Wong [Sat, 29 Aug 2015 21:30:27 +0000 (21:30 +0000)]
avoid length in boolean context

Perl does not currently optimize for this.

ref (from p5p):
http://mid.gmane.org/D5C27970-9176-4C7A-8B99-7D78360E67A2@pobox.com

8 years agopublic-inbox-init: make executable
Eric Wong [Sat, 29 Aug 2015 07:09:45 +0000 (07:09 +0000)]
public-inbox-init: make executable

Mainly for consistency and documentation purposes, as
"make install" automatically sets the executable bit

8 years agosearch: do not iterate through entire termlist
Eric Wong [Fri, 28 Aug 2015 00:00:47 +0000 (00:00 +0000)]
search: do not iterate through entire termlist

A document may have many terms, so this hurts performance
if we blindly iterate.  Unfortunately, we can't rely on the
order of the termlist just yet, either, so we must repeatedly
restart the search for now until we're ready to bump schema
versions.

8 years agosearch: do not load type into metadata
Eric Wong [Fri, 28 Aug 2015 00:17:59 +0000 (00:17 +0000)]
search: do not load type into metadata

Our search query already filters out ghost messages,
so it's wasteful to have type information loaded.

8 years agoGitCatFile: remove unnecessary FD_CLOEXEC setting
Eric Wong [Fri, 28 Aug 2015 00:21:46 +0000 (00:21 +0000)]
GitCatFile: remove unnecessary FD_CLOEXEC setting

Unless some idiot raises $^F, we should not have to care about
the close-on-exec flag.  Everything since Perl 3.0 seems to set
it by default, and 5.6 got more consistent about it.

8 years agoview: fix short followup links
Eric Wong [Thu, 27 Aug 2015 07:21:00 +0000 (07:21 +0000)]
view: fix short followup links

This was broken by commit 9a2931759c3dcbd879728b49151aa3f8a641b506
("wire up to display non-suffixed Message-ID links")

8 years agofilter: reject bad attachments outright
Eric Wong [Thu, 27 Aug 2015 06:41:14 +0000 (06:41 +0000)]
filter: reject bad attachments outright

Might as well be strict about it for new lists.
Importing old archives might be more of a challenge, though.

8 years agoimplement legacy redirects for old URLs
Eric Wong [Thu, 27 Aug 2015 04:34:02 +0000 (04:34 +0000)]
implement legacy redirects for old URLs

We should not break existing URLs.  Redirect them to
the newer, less-ambiguous URLs to improve cache hit
ratios.

8 years agowire up to display non-suffixed Message-ID links
Eric Wong [Thu, 27 Aug 2015 04:34:01 +0000 (04:34 +0000)]
wire up to display non-suffixed Message-ID links

These URLs are preferable in case somebody decides to get cute and
use a suffix we would've used to prevent others from linking to
their message.  The common /m/$MESSAGE_ID/ URLs are now 4 characters
shorter so may fit better on terminals.

8 years agomid: extract Message-ID from inside '<>'
Eric Wong [Thu, 27 Aug 2015 04:34:00 +0000 (04:34 +0000)]
mid: extract Message-ID from inside '<>'

This is necessary for some mailers which include comment text
in in the In-Reply-To header, merely assuming there is nothing
outside of '<>' as we were doing is not enough.

8 years agowire up shorter, less ambiguous URLs
Eric Wong [Thu, 27 Aug 2015 04:33:59 +0000 (04:33 +0000)]
wire up shorter, less ambiguous URLs

We will prefer URLs without suffixes for now to avoid ambiguity
in case a Message-ID ends with ".html", ".txt", ".mbox.gz" or
any other suffix we may use.

Static file compatibility is preserved by using a trailing slash
as most servers can/will fall back to an index.html file in this
case.

For raw text files, we will follow gmane's lead with "/raw"

8 years agowww: minor cleanups to shorten code
Eric Wong [Thu, 27 Aug 2015 04:33:58 +0000 (04:33 +0000)]
www: minor cleanups to shorten code

Less scrolling is more efficient.

8 years agowww: reduce unused arguments in internal API
Eric Wong [Thu, 27 Aug 2015 03:14:45 +0000 (03:14 +0000)]
www: reduce unused arguments in internal API

Less code is easier-to-manage, although we make a few extra
hash insertions now.

8 years agombox: close file handle for single mbox
Eric Wong [Wed, 26 Aug 2015 02:37:43 +0000 (02:37 +0000)]
mbox: close file handle for single mbox

This doesn't seem needed for actual server use, but Plack tests
complain about it

8 years agofeed: fix "created" vs "updated" diff in topics
Eric Wong [Tue, 25 Aug 2015 09:40:50 +0000 (09:40 +0000)]
feed: fix "created" vs "updated" diff in topics

This fixes a regression introduced in
commit 72c0f7c71ff28de9755dc4aee8b6ce6f0e4f2ed7
(feed: merge subjects regardless of "[PATCH vN]")

8 years agofilter: loosen regexp on type matches
Eric Wong [Tue, 25 Aug 2015 09:04:50 +0000 (09:04 +0000)]
filter: loosen regexp on type matches

part_type still contains the filename, unfortunately, so
PGP signatures were truly stripped.  Oh well, nobody cares
to verify PGP signatures anyways.

8 years agofeed: merge subjects regardless of "[PATCH vN]"
Eric Wong [Tue, 25 Aug 2015 01:55:44 +0000 (01:55 +0000)]
feed: merge subjects regardless of "[PATCH vN]"

This normalizes rerolled patches with identical topics,
but does not normalize different patches even if they are
in the same thread (for now).

8 years agosearch: implement subject summarization
Eric Wong [Tue, 25 Aug 2015 02:03:16 +0000 (02:03 +0000)]
search: implement subject summarization

We ought to summarize subjects to avoid exploding
line lengths in the web interface.

8 years agoMakefile.PL: add "syntax" target to check syntax
Eric Wong [Tue, 25 Aug 2015 02:03:15 +0000 (02:03 +0000)]
Makefile.PL: add "syntax" target to check syntax

This is necessary since Xapian may not be installed and
we may hide a lot of errors this way.

8 years agomid: mid_compressed => mid_compress
Eric Wong [Tue, 25 Aug 2015 02:03:14 +0000 (02:03 +0000)]
mid: mid_compressed => mid_compress

Consistently name mid_* functions as verbs.

8 years agosearch: only sort by relevance if requested
Eric Wong [Tue, 25 Aug 2015 01:08:02 +0000 (01:08 +0000)]
search: only sort by relevance if requested

Many of our internal search queries do not care about relevance,
but is used for proper thread displays.

8 years agoview: refactor $state as a hash
Eric Wong [Mon, 24 Aug 2015 02:25:46 +0000 (02:25 +0000)]
view: refactor $state as a hash

Using hash means we no longer have to document and remember what
every field does.  The original array form was insane premature
optimization and crazy.  Who wrote that?  Oh wait, I was on
drugs :<

8 years agomda: remove unnecessary import
Eric Wong [Sun, 23 Aug 2015 18:51:07 +0000 (18:51 +0000)]
mda: remove unnecessary import

Relying on Email::MIME means encoding is handled transparently
for us.

8 years agoview: simplify root filtering in followup display
Eric Wong [Sun, 23 Aug 2015 22:28:10 +0000 (22:28 +0000)]
view: simplify root filtering in followup display

The root message-ID may be too long to compare.  Instead,
check fields based on the consistency of our DB.

8 years agoview: case-insensitive "Re:" check for replies
Eric Wong [Sun, 23 Aug 2015 20:09:12 +0000 (20:09 +0000)]
view: case-insensitive "Re:" check for replies

This is to match what Mail::Thread nad our own search
relies on.  However, we will be more lenient on spaces,
though.

8 years agocleanup calls to header_obj
Eric Wong [Sun, 23 Aug 2015 20:05:41 +0000 (20:05 +0000)]
cleanup calls to header_obj

Dereference header_obj only once when performance may be
critical, or simplify our code by calling "header" directly on
the Email::{Simple,MIME} object if not.

8 years agohopefully fix broken permissions for search
Eric Wong [Sun, 23 Aug 2015 19:41:28 +0000 (19:41 +0000)]
hopefully fix broken permissions for search

We must preserve the umask for the entirety of the indexing
operation, as Xapian transactions replace entire files
atomically instead of writing them in place.

8 years agocleanup Email::Address usage
Eric Wong [Sun, 23 Aug 2015 19:04:21 +0000 (19:04 +0000)]
cleanup Email::Address usage

Email::Address::name never fails assuming it was able to parse
anything.

8 years agosearch: respect core.sharedRepository in for Xapian DB
Eric Wong [Sun, 23 Aug 2015 18:14:04 +0000 (18:14 +0000)]
search: respect core.sharedRepository in for Xapian DB

Extend the purpose of core.sharedRepository to apply to
the $GIT_DIR/public-inbox/xapian* directory.

8 years agofeed: r= parameter supports "HEAD" as a revision
Eric Wong [Sun, 23 Aug 2015 02:40:20 +0000 (02:40 +0000)]
feed: r= parameter supports "HEAD" as a revision

public-inbox git repositories require a "HEAD" ref to
function correctly anyways.

8 years agoGitCatFile: use offset for read instead of appending
Eric Wong [Sun, 23 Aug 2015 02:40:19 +0000 (02:40 +0000)]
GitCatFile: use offset for read instead of appending

There is no need to perform string appends when the
"read" and "sysread" functions take an offset argument
to append to the given buffer.

This avoid needless string creation.

8 years agombox: clarify our use of the the mboxrd variant
Eric Wong [Sun, 23 Aug 2015 00:31:28 +0000 (00:31 +0000)]
mbox: clarify our use of the the mboxrd variant

Commenting it in the From: line seems appropriate and
reduces compatibility problems in case a MUA cannot handle
trailing comments after the timestamp.

8 years agombox: use mboxrd quoting rules
Eric Wong [Sun, 23 Aug 2015 00:02:35 +0000 (00:02 +0000)]
mbox: use mboxrd quoting rules

This redundantly quotes >From from to prevent losing information
as described by qmail

8 years ago.txt links return an mbox instead
Eric Wong [Sun, 23 Aug 2015 00:02:34 +0000 (00:02 +0000)]
.txt links return an mbox instead

This improves compatibility and allows individual messages
to be concatenated into an existing mbox without further
modifications.  "git format-patch" does something similar
(but does not do "From " line escaping(!))

8 years agoview: wire up mbox.gz links
Eric Wong [Sat, 22 Aug 2015 11:41:24 +0000 (11:41 +0000)]
view: wire up mbox.gz links

To reduce clutter, we will not link to uncompressed versions.
Users should be able to download entire threads for offline
reading, enable this feature for them.

8 years agombox: support uncompressed mbox
Eric Wong [Sat, 22 Aug 2015 11:41:23 +0000 (11:41 +0000)]
mbox: support uncompressed mbox

Some folks may want to view the mbox inline as a string of raw text,
when guessing URLs.  Let them do this...

8 years agosearch: consistently pass options and flags
Eric Wong [Sat, 22 Aug 2015 11:41:22 +0000 (11:41 +0000)]
search: consistently pass options and flags

Most of our special query functions require exact matches, so none
of the flags we normally use are necessary for query parsing.

8 years agoview: reference total followups
Eric Wong [Sat, 22 Aug 2015 11:41:21 +0000 (11:41 +0000)]
view: reference total followups

In case there's huge threads, readers should know about them
even though we currently lack the navigation to display them.

8 years agoview: misc cleanups and simplifications
Eric Wong [Sat, 22 Aug 2015 11:41:20 +0000 (11:41 +0000)]
view: misc cleanups and simplifications

Less code should be easier-to-read.

8 years agosearch: split search indexing to a separate file
Eric Wong [Sat, 22 Aug 2015 11:41:19 +0000 (11:41 +0000)]
search: split search indexing to a separate file

This makes organization easier and reduces the amount of code
loaded for a PSGI, mod_perl or CGI instance.

8 years agoview: prevent 'once' warnings for sub ref
Eric Wong [Sat, 22 Aug 2015 08:07:57 +0000 (08:07 +0000)]
view: prevent 'once' warnings for sub ref

Perl seems to incorrectly warn for this, workaround it.

8 years agoremove XML::Atom::SimpleFeed dependency
Eric Wong [Sat, 22 Aug 2015 08:00:37 +0000 (08:00 +0000)]
remove XML::Atom::SimpleFeed dependency

We will attempt to generate Atom feeds "by hand" as the
XML::Atom::SimpleFeed API does not support streaming output.
Since email is large and servers are small, this should prevent
wasting memory when we generate larger feeds.

Of course, we hope clients use SAX parsers capable of handling
large streams without slurping.

8 years agowww: enable and expand preload from mod_perl2
Eric Wong [Sat, 22 Aug 2015 05:06:57 +0000 (05:06 +0000)]
www: enable and expand preload from mod_perl2

Hopefully this saves us some memory with CoW on *nix.

8 years agoINSTALL: document IO::Compress::Gzip dependency
Eric Wong [Sat, 22 Aug 2015 05:06:56 +0000 (05:06 +0000)]
INSTALL: document IO::Compress::Gzip dependency

Otherwise folks won't get downloadable mboxes

8 years agocgi: remove static file generation support for now
Eric Wong [Sat, 22 Aug 2015 05:06:55 +0000 (05:06 +0000)]
cgi: remove static file generation support for now

We may not support this after all, CGI.pm is already
legacy-enough and far more powerful.

8 years agostream HTML views as much as possible
Eric Wong [Sat, 22 Aug 2015 00:06:45 +0000 (00:06 +0000)]
stream HTML views as much as possible

This should allow progressive rendering on the client and reduce
memory usage on the server.  Unfortunately XML::Atom::SimpleFeed
does not yet support streaming, so we may not use it in the
future.

8 years agosearch: s/count/total/ for results
Eric Wong [Fri, 21 Aug 2015 23:43:12 +0000 (23:43 +0000)]
search: s/count/total/ for results

This is hopefully less ambiguous, as the word "count" confused
me, too.

8 years agombox: drop unnecessary imports
Eric Wong [Fri, 21 Aug 2015 23:34:29 +0000 (23:34 +0000)]
mbox: drop unnecessary imports

These are not necessary, anymore

8 years agoswitch to gzipped mboxes
Eric Wong [Fri, 21 Aug 2015 21:42:23 +0000 (21:42 +0000)]
switch to gzipped mboxes

Mboxes may be huge, so only support downloading gzipped mboxes
to save bandwidth and to get free checksumming.

Streaming output means we should not be wasting too much memory
on this unless the chosen server sucks.

8 years agombox: stream entire thread, regardless of size
Eric Wong [Fri, 21 Aug 2015 21:42:22 +0000 (21:42 +0000)]
mbox: stream entire thread, regardless of size

Since mbox is usually downloaded, support fetching infinitely large
responses via streaming.

8 years agosupport dumping thread as an mbox
Eric Wong [Fri, 21 Aug 2015 01:29:04 +0000 (01:29 +0000)]
support dumping thread as an mbox

Some folks may not want to download and install Perl code like
ssoma, so allow downloading an mbox containing the entire
thread.

8 years agoview: "next" link in thread view goes to next Subject line
Eric Wong [Fri, 21 Aug 2015 01:29:03 +0000 (01:29 +0000)]
view: "next" link in thread view goes to next Subject line

It's a bit disconcerting to jump to the authorship line.

8 years agoview: cleanup and reduce duplication
Eric Wong [Fri, 21 Aug 2015 01:29:02 +0000 (01:29 +0000)]
view: cleanup and reduce duplication

This also avoids incorrectly incrementing $part_nr when
we skip a part due to bad Content-Type.

8 years agofeed: fix extra, unnecessary quote
Eric Wong [Thu, 20 Aug 2015 19:15:18 +0000 (19:15 +0000)]
feed: fix extra, unnecessary quote

Oops!

8 years agosearch: preserve References: order in document data
Eric Wong [Thu, 20 Aug 2015 10:17:34 +0000 (10:17 +0000)]
search: preserve References: order in document data

We need proper ordering of References to thread messages
correctly.  We would lose this order if we load the terms
from the database, so set it directly document data.

Do not bother with a separate In-Reply-To, since Mail::Thread
just merges the IRT into References.  This bumps our schema
version once again.

8 years agoavoid using header_raw for Message-ID retrieval
Eric Wong [Thu, 20 Aug 2015 08:54:32 +0000 (08:54 +0000)]
avoid using header_raw for Message-ID retrieval

This is for consistency with ssoma.  I doubt it makes
a difference in practice, but in case somebody decides
any of the Message-ID-containing headers should have
strange characters, we'll decode and attempt to thread
them.  This isn't an attack vector, just a way to
make messages thread improperly which is pointless...

8 years agoview: simplify message threading dumpers
Eric Wong [Thu, 20 Aug 2015 08:51:51 +0000 (08:51 +0000)]
view: simplify message threading dumpers

8 years agodead code cleanup
Eric Wong [Thu, 20 Aug 2015 06:44:39 +0000 (06:44 +0000)]
dead code cleanup

We may not be using subject_path after all.

8 years agowww: remove useless no-op assignment statement
Eric Wong [Thu, 20 Aug 2015 06:23:27 +0000 (06:23 +0000)]
www: remove useless no-op assignment statement

Oops

8 years agomisc documentation updates
Eric Wong [Thu, 20 Aug 2015 04:15:31 +0000 (04:15 +0000)]
misc documentation updates

Threading in Xapian is mostly supported by now; so start
documenting things.

8 years agoreplace references to lynx
Eric Wong [Thu, 20 Aug 2015 04:01:59 +0000 (04:01 +0000)]
replace references to lynx

Table rendering in lynx is crap compared to w3m and links.
However, we still use it for filtering HTML since the renderer
is otherwise nice...

8 years agosearch: index_sync allows specifying alternate HEAD
Eric Wong [Tue, 18 Aug 2015 06:23:06 +0000 (06:23 +0000)]
search: index_sync allows specifying alternate HEAD

This should allow us to sync the index to a temporary head
to update the Xapian index before we update the real HEAD
index.

8 years agoview: do not fold top-level messages in thread
Eric Wong [Thu, 20 Aug 2015 02:51:28 +0000 (02:51 +0000)]
view: do not fold top-level messages in thread

This hopefully reduces clicking.  We may drop folding entirely
since we can use Xapian to make searching easier.

8 years agoindex: layout fix + title and Atom feed links at top
Eric Wong [Thu, 20 Aug 2015 02:43:20 +0000 (02:43 +0000)]
index: layout fix + title and Atom feed links at top

Add some spacing between topics to improve readability when
scanning or in case a subject gets too long.

The title and Atom feed may not be highly-visible otherwise.
While we're at it, use the proper "Atom feed" terminology since
some folks may not understand just what "atom" means.

8 years agosearch: bump schema version to 5 for subject_path
Eric Wong [Thu, 20 Aug 2015 02:32:29 +0000 (02:32 +0000)]
search: bump schema version to 5 for subject_path

In "index: simplify main landing page if search-enabled",
subject normalization went a little farther to drop trailing
'.' characters, so we will need to re-index.

8 years agoview: reduce memory usage when displaying large threads
Eric Wong [Thu, 20 Aug 2015 02:30:32 +0000 (02:30 +0000)]
view: reduce memory usage when displaying large threads

We want to minimize the time any large objects or strings
are referenced.  We can do threading entirely from the
mini_mime-generated messages and lazilly load full messages
when rendering the display.

8 years agosearch: reject ghosts in all cases
Eric Wong [Thu, 20 Aug 2015 02:30:31 +0000 (02:30 +0000)]
search: reject ghosts in all cases

We do not need ghost messages in any of our thread views

8 years agosearch: avoid needless decode
Eric Wong [Thu, 20 Aug 2015 02:30:30 +0000 (02:30 +0000)]
search: avoid needless decode

Email::MIME should handle everything for us and make things
work nicely with Xapian (assuming I understand how encoding
works in Perl).

While we're at it, reduce temporary strings and arrays by
using destructive operations and clobbering parts as we
iterate through them.

8 years agoindex: simplify main landing page if search-enabled
Eric Wong [Thu, 20 Aug 2015 02:30:29 +0000 (02:30 +0000)]
index: simplify main landing page if search-enabled

We can display /t/$MESSAGE_ID.html easily with a Xapian search
index, so rely on it instead of trying to display messages inline.

8 years agoview: avoid nesting <a> tags from auto-linkification
Eric Wong [Thu, 20 Aug 2015 02:30:28 +0000 (02:30 +0000)]
view: avoid nesting <a> tags from auto-linkification

It is wrong HTML to have <a> tags nested due to auto-linkification.

8 years agouse tables for rendering comment nesting
Eric Wong [Thu, 20 Aug 2015 02:30:27 +0000 (02:30 +0000)]
use tables for rendering comment nesting

This is more space efficient since we don't need to place padding
bytes in front of every line.  While this unfortunately does not
render well on lynx; w3m, links, elinks can all render tables
sanely.

Tables are also superior for long lines which require wrapping
inside <pre> containers.

8 years agofeed: move timestamp parsing to view
Eric Wong [Thu, 20 Aug 2015 02:30:26 +0000 (02:30 +0000)]
feed: move timestamp parsing to view

We don't need share duplicate logic across both files.

8 years agofeed: remove threading from index
Eric Wong [Thu, 20 Aug 2015 02:30:25 +0000 (02:30 +0000)]
feed: remove threading from index

We'll be making the index smarter for people with search
support enabled.  Otherwise, it'll be chronological and
a bit dumb.  At least it'll use less memory.

8 years agowww: redirect /f/$MESSAGE_ID.txt links to /m/$MESSAGE_ID.txt
Eric Wong [Wed, 19 Aug 2015 19:46:22 +0000 (19:46 +0000)]
www: redirect /f/$MESSAGE_ID.txt links to /m/$MESSAGE_ID.txt

Some people (e.g. myself :p) may try to guess URLs and hit a
404.  Redirect to the /m/ version.

Note: we prefer to redirect to canonical URLs to improve
caching.

8 years agoview: return empty string to avoid undefined values
Eric Wong [Wed, 19 Aug 2015 19:36:11 +0000 (19:36 +0000)]
view: return empty string to avoid undefined values

Sometimes we have filter bugs and let HTML slip through...

8 years agoview: fix spacing on missing ghosts
Eric Wong [Wed, 19 Aug 2015 19:31:08 +0000 (19:31 +0000)]
view: fix spacing on missing ghosts

We must not prematurely indent if we have no message header to
display.

8 years agoview: close anchor tag correctly before starting another
Eric Wong [Tue, 18 Aug 2015 03:17:17 +0000 (03:17 +0000)]
view: close anchor tag correctly before starting another

Noticed by tidy

8 years agopublic-inbox-index: exit with usage if not given an arg
Eric Wong [Tue, 18 Aug 2015 03:17:16 +0000 (03:17 +0000)]
public-inbox-index: exit with usage if not given an arg

I often forget how to use this myself :x

8 years agothread: another workaround for a Mail::Thread bug
Eric Wong [Tue, 18 Aug 2015 02:05:32 +0000 (02:05 +0000)]
thread: another workaround for a Mail::Thread bug

Yay for monkey patching!

ref: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=795913
ref: https://rt.cpan.org/Ticket/Display.html?id=106498

8 years agosearch: bump SCHEMA_VERSION to 4
Eric Wong [Tue, 18 Aug 2015 01:13:03 +0000 (01:13 +0000)]
search: bump SCHEMA_VERSION to 4

The following two commits affect indexing behavior, so
change the schema version to avoid compatibility problems
or missing messages:

search: common Subject: normalization for Re: prefixes
search: avoid creating ghosts for circular References

8 years agosearch: expose $PublicInbox::Search::LANG variable
Eric Wong [Tue, 18 Aug 2015 01:11:06 +0000 (01:11 +0000)]
search: expose $PublicInbox::Search::LANG variable

This makes it easier to reconfigure for non-English users