WebhookSettingsStore.h header

#include <ew/app/WebhookSettingsStore.h>

Namespace ew::app

Functions

std::vector< WebhookDestination > ew::app::webhook::loadWebhookDestinations(const settings::Settings &settings)

Reads the user's webhook destinations from settings.

Returns an empty list when none are configured, which is the state every install starts in and the state the feature is designed around: no destinations means the notification feature is simply absent.

void ew::app::webhook::saveWebhookDestinations(settings::Settings &settings, const std::vector< WebhookDestination > &destinations)

Writes destinations to settings, replacing whatever was there.

The old entries are removed before the new ones are written. Settings is a flat key/value store with no notion of a list, so a shorter list would otherwise leave the tail of the previous one behind – and a destination the user deleted would keep receiving their messages, which is the worst failure this feature could have.