protected function fill_user_subscription_cache() {
        foreach ($this->forums as $forum) {
            $cm = get_fast_modinfo($this->courses[$forum->course])->instances['forum'][$forum->id];
            $modcontext = \context_module::instance($cm->id);

            $this->subscribedusers[$forum->id] = [];
            if ($users = \mod_forum\subscriptions::fetch_subscribed_users($forum, 0, $modcontext, 'u.id, u.maildigest', true)) {
                foreach ($users as $user) {
                    // This user is subscribed to this forum.
                    $this->subscribedusers[$forum->id][$user->id] = $user->id;
                    if (!isset($this->users[$user->id])) {
                        // Store minimal user info.
                        $this->users[$user->id] = $user;
                    }
                }
                // Release memory.
                unset($users);
            }
        }
    }