Repository: louislam/uptime-kuma
File: server/notification-providers/bark.js (JavaScript)

Code before:
            return await this.postNotification(title, msg, barkEndpoint);
        }
    }

    /**
     * Add additional parameter for better on device styles (iOS 15
     * optimized)
     * @param {string} postUrl URL to append parameters to
     * @returns {string}
     */
    appendAdditionalParameters(notification, postUrl) {
        // grouping all our notifications
        if (notification.barkGroup != null) {
            postUrl += "&group=" + notification.barkGroup;
        } else {
            postUrl += "&group=" + "UptimeKuma";
            // default group
        }
        // set icon to uptime kuma icon, 11kb should be fine
        postUrl += "&icon=" + barkNotificationAvatar;
        // picked a sound, this should follow system's mute status when arrival
        if (notification.barkSound != null) {
            postUrl += "&sound=" + notification.barkSound;
        } else {
            postUrl += "&sound=" + "telegraph";
            // default sound
        }
        return postUrl;
    }

    /**
     * Check if result is successful
     * @param {Object} result Axios response object
     * @throws {Error} The status code is not in range 2xx
     */
    checkResult(result) {
        if (result.status == null) {
            throw new Error("Bark notification failed with invalid response!");
        }
        if (result.status < 200 || result.status >= 300) {
            throw new Error("Bark notification failed with status code " + result.status);
        }
    }

    /**
     * Send the message
     * @param {string} title Message title
     * @param {string} subtitle Message
     * @param {string} endpoint Endpoint to send request to
     * @returns {string}
     */

Review comment (suggestion):
```suggestion
            // default sound
            postUrl += "&sound=" + "telegraph";
```

Code after:
            return await this.postNotification(title, msg, barkEndpoint);
        }
    }

    /**
     * Add additional parameter for better on device styles (iOS 15
     * optimized)
     * @param {string} postUrl URL to append parameters to
     * @returns {string}
     */
    appendAdditionalParameters(notification, postUrl) {
        // set icon to uptime kuma icon, 11kb should be fine
        postUrl += "&icon=" + barkNotificationAvatar;
        // grouping all our notifications
        if (notification.barkGroup != null) {
            postUrl += "&group=" + notification.barkGroup;
        } else {
            // default name
            postUrl += "&group=" + "UptimeKuma";
        }
        // picked a sound, this should follow system's mute status when arrival
        if (notification.barkSound != null) {
            postUrl += "&sound=" + notification.barkSound;
        } else {
            // default sound
            postUrl += "&sound=" + "telegraph";
        }
        return postUrl;
    }

    /**
     * Check if result is successful
     * @param {Object} result Axios response object
     * @throws {Error} The status code is not in range 2xx
     */
    checkResult(result) {
        if (result.status == null) {
            throw new Error("Bark notification failed with invalid response!");
        }
        if (result.status < 200 || result.status >= 300) {
            throw new Error("Bark notification failed with status code " + result.status);
        }
    }

    /**
     * Send the message
     * @param {string} title Message title
     * @param {string} subtitle Message
     * @param {string} endpoint Endpoint to send request to
     * @returns {string}
     */