diff options
Diffstat (limited to 'hyperkitty/views/accounts.py')
-rw-r--r-- | hyperkitty/views/accounts.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hyperkitty/views/accounts.py b/hyperkitty/views/accounts.py index b283392..e35b6eb 100644 --- a/hyperkitty/views/accounts.py +++ b/hyperkitty/views/accounts.py @@ -190,7 +190,12 @@ def last_views(request): last_views = last_views_paginator.page(last_views_paginator.num_pages) for last_view in last_views: thread = store.get_thread(last_view.list_address, last_view.threadid) - thread.unread = bool( thread.date_active > last_view.view_date ) + if thread.date_active > last_view.view_date: + # small optimization: only query the replies if necessary + # XXX: Storm-specific (count method) + thread.unread = thread.replies_after(last_view.view_date).count() + else: + thread.unread = 0 last_view.thread = thread return render(request, 'ajax/last_views.html', { |