diff --git a/etc/dev-start.sh b/etc/dev-start.sh index 4efd440..82b5cc9 100755 --- a/etc/dev-start.sh +++ b/etc/dev-start.sh @@ -8,7 +8,7 @@ export INBUCKET_WEB_TEMPLATECACHE="false" export INBUCKET_WEB_COOKIEAUTHKEY="not-secret" export INBUCKET_STORAGE_TYPE="file" export INBUCKET_STORAGE_PARAMS="path:/tmp/inbucket" -export INBUCKET_STORAGE_RETENTIONPERIOD="5m" +export INBUCKET_STORAGE_RETENTIONPERIOD="15m" if ! test -x ./inbucket; then echo "$PWD/inbucket not found/executable!" >&2 diff --git a/pkg/message/manager.go b/pkg/message/manager.go index ff0a8a9..35d0fcd 100644 --- a/pkg/message/manager.go +++ b/pkg/message/manager.go @@ -12,6 +12,7 @@ import ( "github.com/jhillyerd/inbucket/pkg/policy" "github.com/jhillyerd/inbucket/pkg/storage" "github.com/jhillyerd/inbucket/pkg/stringutil" + "github.com/rs/zerolog/log" ) // Manager is the interface controllers use to interact with messages. @@ -127,6 +128,8 @@ func (s *StoreManager) GetMessage(mailbox, id string) (*Message, error) { // MarkSeen marks the message as having been read. func (s *StoreManager) MarkSeen(mailbox, id string) error { + log.Debug().Str("module", "manager").Str("mailbox", mailbox).Str("id", id). + Msg("Marking as seen") return s.Store.MarkSeen(mailbox, id) } @@ -164,5 +167,6 @@ func makeMetadata(m storage.Message) *Metadata { Date: m.Date(), Subject: m.Subject(), Size: m.Size(), + Seen: m.Seen(), } } diff --git a/ui/static/inbucket.css b/ui/static/inbucket.css index c895626..ece379e 100644 --- a/ui/static/inbucket.css +++ b/ui/static/inbucket.css @@ -29,6 +29,10 @@ body { font-size: 18px; } +.message-list-entry .unseen { + font-weight: bold; +} + .message-list-scroll { overflow-y: auto; } diff --git a/ui/static/mailbox.js b/ui/static/mailbox.js index 5a624c6..efe52d4 100644 --- a/ui/static/mailbox.js +++ b/ui/static/mailbox.js @@ -5,6 +5,7 @@ var messageListMargin = 275; var clipboard = null; var messageListScroll = false; var messageListData = null; +var seenDelay = null; // clearMessageSearch resets the message list search function clearMessageSearch() { @@ -55,8 +56,11 @@ function loadList() { url: '/api/v1/mailbox/' + mailbox, success: function(data) { messageListData = data.reverse(); + for (i=0; i