diff options
Diffstat (limited to 'app/plugin_api.go')
-rw-r--r-- | app/plugin_api.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/plugin_api.go b/app/plugin_api.go index c3ab8fab2..503feabee 100644 --- a/app/plugin_api.go +++ b/app/plugin_api.go @@ -258,6 +258,18 @@ func (api *PluginAPI) CreatePost(post *model.Post) (*model.Post, *model.AppError return api.app.CreatePostMissingChannel(post, true) } +func (api *PluginAPI) AddReaction(reaction *model.Reaction) (*model.Reaction, *model.AppError) { + return api.app.SaveReactionForPost(reaction) +} + +func (api *PluginAPI) RemoveReaction(reaction *model.Reaction) *model.AppError { + return api.app.DeleteReactionForPost(reaction) +} + +func (api *PluginAPI) GetReactions(postId string) ([]*model.Reaction, *model.AppError) { + return api.app.GetReactionsForPost(postId) +} + func (api *PluginAPI) SendEphemeralPost(userId string, post *model.Post) *model.Post { return api.app.SendEphemeralPost(userId, post) } @@ -279,6 +291,14 @@ func (api *PluginAPI) CopyFileInfos(userId string, fileIds []string) ([]string, return api.app.CopyFileInfos(userId, fileIds) } +func (api *PluginAPI) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) { + return api.app.GetFileInfo(fileId) +} + +func (api *PluginAPI) ReadFile(path string) ([]byte, *model.AppError) { + return api.app.ReadFile(path) +} + func (api *PluginAPI) KVSet(key string, value []byte) *model.AppError { return api.app.SetPluginKey(api.id, key, value) } @@ -299,6 +319,18 @@ func (api *PluginAPI) PublishWebSocketEvent(event string, payload map[string]int }) } +func (api *PluginAPI) HasPermissionTo(userId string, permission *model.Permission) bool { + return api.app.HasPermissionTo(userId, permission) +} + +func (api *PluginAPI) HasPermissionToTeam(userId, teamId string, permission *model.Permission) bool { + return api.app.HasPermissionToTeam(userId, teamId, permission) +} + +func (api *PluginAPI) HasPermissionToChannel(userId, channelId string, permission *model.Permission) bool { + return api.app.HasPermissionToChannel(userId, channelId, permission) +} + func (api *PluginAPI) LogDebug(msg string, keyValuePairs ...interface{}) { api.logger.Debug(msg, keyValuePairs...) } |