profilemanager

package
v0.0.0-...-f6c4056 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package profilemanager implements util functions for managing push notification settings profiles for Matrix users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyProfile

func ApplyProfile(cli *gomatrix.Client, name string) error

ApplyProfile retrieves and apply a notification profile. Returns matrix.ErrProfileNotExists if the required profile doesn't exist. Returns an error if retrieving the profile or applying it failed.

func DeleteProfile

func DeleteProfile(cli *gomatrix.Client, name string) error

DeleteProfile deletes a notification profile from the user's account data. Returns an error if either the deletion failed or no profile exists for this name (in which case it returns matrix.ErrProfileNotExists).

func EnableDebugLogging

func EnableDebugLogging()

EnableDebugLogging enable debug logs.

func SnapshotSettings

func SnapshotSettings(cli *gomatrix.Client, name string, overwrite bool) error

SnapshotSettings takes a snapshot of the current notifications settings for the user and saves it as a profile in the user's account data. If a profile already exists with this name, returns matrix.ErrProfileExists unless overwrite is true, in which case it overwrites the existing profile for this name. Returns an error if either retrieving the settings or saving the profile failed.

Types

type Action

type Action int

Action is the action to take for a given rule.

const (
	// ACTION_ADD accompanies a rule that needs to be added to the user's
	// settings.
	ACTION_ADD Action = iota
	// ACTION_DELETE accompanies a rule that needs to be deleted from the user's
	// settings.
	ACTION_DELETE
)

Directories

Path Synopsis
Package matrix implements Matrix-specific operations and logic for managing push notification settings profiles for Matrix users.
Package matrix implements Matrix-specific operations and logic for managing push notification settings profiles for Matrix users.
Package types implements types for managing push notification settings profiles for Matrix users.
Package types implements types for managing push notification settings profiles for Matrix users.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL