MDL-67610 mod_forum: Do not include private replies in unread count
commitd65f46103a3c806d9d73727e016eb13c26c63ecd
authorJun Pataleta <jun@moodle.com>
Fri, 13 Aug 2021 16:24:52 +0000 (14 00:24 +0800)
committerJun Pataleta <jun@moodle.com>
Tue, 7 Sep 2021 15:20:33 +0000 (7 23:20 +0800)
tree537d39d5c182b32863598d58cd714dcfe57cdbc3
parent3e6900105a7eb6455dbb89ca992e54d8e6e7a7a5
MDL-67610 mod_forum: Do not include private replies in unread count

Fetching the counts of unread posts should only include unread regular
posts or unread private reply posts directed to the user unless the user
has the capability to read private replies.
In order to retrieve the correct counts, we also need to loop through
each forum instance in the course to check the capability of the user to
read private replies in each forum.
mod/forum/lib.php
mod/forum/tests/lib_test.php