plugin

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const PluginId = "com.github.matterpoll.matterpoll"
View Source
const PluginVersion = "1.1.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type MatterpollPlugin

type MatterpollPlugin struct {
	plugin.MattermostPlugin

	Store store.Store

	ServerConfig *model.Config
	// contains filtered or unexported fields
}

MatterpollPlugin is the object to run the plugin

func (*MatterpollPlugin) ConvertCreatorIDToDisplayName

func (p *MatterpollPlugin) ConvertCreatorIDToDisplayName(creatorID string) (string, *model.AppError)

ConvertCreatorIDToDisplayName returns the display name to a given user ID of a poll creator

func (*MatterpollPlugin) ConvertUserIDToDisplayName

func (p *MatterpollPlugin) ConvertUserIDToDisplayName(userID string) (string, *model.AppError)

ConvertUserIDToDisplayName returns the display name to a given user ID

func (*MatterpollPlugin) ExecuteCommand

ExecuteCommand parses a given input and creates a poll if the input is correct

func (*MatterpollPlugin) HasPermission

func (p *MatterpollPlugin) HasPermission(poll *poll.Poll, issuerID string) (bool, *model.AppError)

HasPermission checks if a given user has the permission to end or delete a given poll

func (*MatterpollPlugin) InitAPI

func (p *MatterpollPlugin) InitAPI() *mux.Router

InitAPI initializes the REST API

func (*MatterpollPlugin) LocalizeDefaultMessage added in v1.1.0

func (p *MatterpollPlugin) LocalizeDefaultMessage(l *i18n.Localizer, m *i18n.Message) string

LocalizeDefaultMessage localizer the provided message

func (*MatterpollPlugin) LocalizeWithConfig added in v1.1.0

func (p *MatterpollPlugin) LocalizeWithConfig(l *i18n.Localizer, lc *i18n.LocalizeConfig) string

LocalizeWithConfig localizer the provided localize config

func (*MatterpollPlugin) OnActivate

func (p *MatterpollPlugin) OnActivate() error

OnActivate ensures a configuration is set and initializes the API

func (*MatterpollPlugin) OnConfigurationChange

func (p *MatterpollPlugin) OnConfigurationChange() error

OnConfigurationChange loads the plugin configuration, validates it and saves it.

func (*MatterpollPlugin) OnDeactivate

func (p *MatterpollPlugin) OnDeactivate() error

OnDeactivate unregisters the command

func (*MatterpollPlugin) SendEphemeralPost added in v1.1.0

func (p *MatterpollPlugin) SendEphemeralPost(channelID, userID, message string)

func (*MatterpollPlugin) ServeHTTP

func (p *MatterpollPlugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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