Index: openacs-4/packages/forums/lib/message/threads-chunk-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/Attic/threads-chunk-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/forums/lib/message/threads-chunk-oracle.xql 14 Jun 2007 06:45:19 -0000 1.4 +++ openacs-4/packages/forums/lib/message/threads-chunk-oracle.xql 15 Jun 2007 18:58:54 -0000 1.5 @@ -49,8 +49,22 @@ - + + + case when fi.reading_date is null then 't' else 'f' end as unread_p + + + + + + left join forums_reading_info fi on fm.message_id=fi.root_message_id and fi.user_id = :user_id + + + + + case when fm.last_child_post > sysdate-1 then 't' else 'f' end as unread_p + Index: openacs-4/packages/forums/lib/message/threads-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/Attic/threads-chunk-postgresql.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/forums/lib/message/threads-chunk-postgresql.xql 14 Jun 2007 06:46:41 -0000 1.6 +++ openacs-4/packages/forums/lib/message/threads-chunk-postgresql.xql 15 Jun 2007 18:58:54 -0000 1.7 @@ -49,10 +49,25 @@ - - case when fm.last_child_post > (now() - interval '1 day') then 't' else 'f' end as unread_p + + + case when fi.reading_date is null then 't' else 'f' end as unread_p + + + + left join forums_reading_info fi on fm.message_id=fi.root_message_id and fi.user_id = :user_id + + + + + case when fm.last_child_post > (now() - interval '1 day') then 't' else 'f' end as new_p + + + + + Index: openacs-4/packages/forums/lib/message/threads-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/threads-chunk.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/forums/lib/message/threads-chunk.tcl 14 Jun 2007 06:43:56 -0000 1.10 +++ openacs-4/packages/forums/lib/message/threads-chunk.tcl 15 Jun 2007 18:58:54 -0000 1.11 @@ -15,14 +15,10 @@ set useReadingInfo [forum::use_ReadingInfo_p] if { $useReadingInfo } { - set unread_or_new_query_clause { - case when fi.reading_date is null then 't' else 'f' end as unread_p - } - set unread_join { - left join forums_reading_info fi on fm.message_id=fi.root_message_id and fi.user_id = :user_id - } + set unread_or_new_query_clause [db_map unread_query] + set unread_join [db_map unread_join] } else { - set unread_or_new_query_clause [db_map unread_or_new_query] + set unread_or_new_query_clause [db_map new_query] set unread_join "" } if {![info exists base_url]} {