plugin

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MatterpollPostType is post_type of posts generated by Matterpoll
	MatterpollPostType = "custom_matterpoll"
)

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 NewMatterpollPlugin added in v1.4.0

func NewMatterpollPlugin() *MatterpollPlugin

func (*MatterpollPlugin) CanManagePoll added in v1.5.0

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

CanManagePoll checks if a given user has the permission to manage i.e. end or delete a given poll

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) InitAPI

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

InitAPI initializes the REST API

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 marks the plugin as deactivated

func (*MatterpollPlugin) SendEphemeralPost added in v1.1.0

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

SendEphemeralPost sends an ephemeral post to a user as the bot account

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