diff options
author | Eric Wong <e@yhbt.net> | 2020-06-10 07:04:00 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-06-13 07:55:45 +0000 |
commit | 90f11ce471c53365a77896c847d0a39b0995b5b5 (patch) | |
tree | da22ca9fd8df2a85ed4245812999bd67f0577e49 /lib/PublicInbox/Smsg.pm | |
parent | a7018ba43dec712675d21ace5ea1e19d901fdb0f (diff) | |
download | public-inbox-90f11ce471c53365a77896c847d0a39b0995b5b5.tar.gz |
It shares a bit of code with NNTP. It's copy+pasted for now since this provides new ground to experiment with APIs for dealing with slow storage and many inboxes.
Diffstat (limited to 'lib/PublicInbox/Smsg.pm')
-rw-r--r-- | lib/PublicInbox/Smsg.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/PublicInbox/Smsg.pm b/lib/PublicInbox/Smsg.pm index e8f9c9a3..725d4206 100644 --- a/lib/PublicInbox/Smsg.pm +++ b/lib/PublicInbox/Smsg.pm @@ -131,14 +131,20 @@ sub populate { my @DoW = qw(Sun Mon Tue Wed Thu Fri Sat); my @MoY = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); -sub date ($) { +sub date ($) { # for NNTP my ($self) = @_; my $ds = $self->{ds}; return unless defined $ds; my ($sec, $min, $hour, $mday, $mon, $year, $wday) = gmtime($ds); "$DoW[$wday], " . sprintf("%02d $MoY[$mon] %04d %02d:%02d:%02d +0000", $mday, $year+1900, $hour, $min, $sec); +} +sub internaldate { # for IMAP + my ($self) = @_; + my ($sec, $min, $hour, $mday, $mon, $year) = gmtime($self->{ts} // 0); + sprintf("%02d-$MoY[$mon]-%04d %02d:%02d:%02d +0000", + $mday, $year+1900, $hour, $min, $sec); } our $REPLY_RE = qr/^re:\s+/i; |