public static function unset_favourite_conversations(int $userid, array $conversationids) {
        global $CFG, $USER;

        // All the business logic checks that really shouldn't be in here.
        if (empty($CFG->messaging)) {
            throw new moodle_exception('disabled', 'message');
        }
        $params = [
            'userid' => $userid,
            'conversations' => $conversationids
        ];
        $params = self::validate_parameters(self::unset_favourite_conversations_parameters(), $params);
        $systemcontext = context_system::instance();
        self::validate_context($systemcontext);

        if (($USER->id != $params['userid']) && !has_capability('moodle/site:readallmessages', $systemcontext)) {
            throw new moodle_exception('You do not have permission to perform this action.');
        }

        foreach ($params['conversations'] as $conversationid) {
            \core_message\api::unset_favourite_conversation($conversationid, $params['userid']);
        }

        return [];
    }