protected function get_maildigest($forumid) {
        $maildigest = -1;

        if (isset($this->forumdigesttypes[$forumid])) {
            $maildigest = $this->forumdigesttypes[$forumid];
        }

        if ($maildigest === -1 && !empty($this->recipient->maildigest)) {
            $maildigest = $this->recipient->maildigest;
        }

        if ($maildigest === -1) {
            // There is no maildigest type right now.
            $maildigest = 1;
        }

        return $maildigest;
    }