Documentation ¶
Overview ¶
Package matrix implements Matrix-specific operations and logic for managing push notification settings profiles for Matrix users.
Index ¶
- Constants
- Variables
- func AddPushRule(cli *gomatrix.Client, rule types.PushRule) error
- func DeleteProfile(cli *gomatrix.Client, name string) error
- func DeletePushRule(cli *gomatrix.Client, rule types.PushRule) error
- func GetProfiles(cli *gomatrix.Client) (profiles map[string]types.PushRules, err error)
- func GetPushRules(cli *gomatrix.Client) (rules types.PushRules, err error)
- func SaveProfile(cli *gomatrix.Client, name string, profile types.PushRules, overwrite bool) error
Constants ¶
const ACCOUNT_DATA_TYPE = "bzh.abolivier.profiles.push"
ACCOUNT_DATA_TYPE is the type of the data that gets added to the user's account data.
Variables ¶
var ( // ErrProfileExists is returned when trying to create a profile with a name // that already has a profile attached to it. ErrProfileExists = errors.New("A profile already exists with this name, use another name or the -overwrite flag to overwrite it") // ErrProfileNotExists is returned when trying to delete a profile which // doesn't exist. ErrProfileNotExists = errors.New("No profile exists with this name") )
Functions ¶
func AddPushRule ¶
AddPushRule adds a rule to the user's notification settings. Returns an error if the addition failed.
func DeleteProfile ¶
DeleteProfile deletes a profile from the user's account data. Returns ErrProfileNotExists if there's no profile with this name in the user's account data. Returns an error if there was an issue talking with the Matrix homeserver.
func DeletePushRule ¶
DeletePushRule deletes a rule from the user's notification settings. Returns an error if the deletion failed.
func GetProfiles ¶
GetProfiles retrieves the list of profile for the user's account data. Returns an error if the retrieval failed.
func GetPushRules ¶
GetPushRules retrieves the notifications settings for the user. Returns an error if the retrieval failed.
func SaveProfile ¶
SaveProfile saves a profile to the user's account data. Returns ErrProfileExists if a profile already exists for the provided name, unless overwrite is true, in which case it overwrites the profile the name is attached to. Returns an error if there was an issue talking with the Matrix homeserver.
Types ¶
This section is empty.