mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Adds an exported const string that can be used by plugins to signal a client that the incoming post should be dismissed, instead of the current behavior which just leaves it pending.
This commit is contained in:
@@ -36,6 +36,11 @@ const (
|
||||
TotalHooksId = iota
|
||||
)
|
||||
|
||||
const (
|
||||
// DismissPostError dismisses a pending post when the error is returned from MessageWillBePosted.
|
||||
DismissPostError = "plugin.message_will_be_posted.dismiss_post"
|
||||
)
|
||||
|
||||
// Hooks describes the methods a plugin may implement to automatically receive the corresponding
|
||||
// event.
|
||||
//
|
||||
@@ -90,6 +95,7 @@ type Hooks interface {
|
||||
// To reject a post, return an non-empty string describing why the post was rejected.
|
||||
// To modify the post, return the replacement, non-nil *model.Post and an empty string.
|
||||
// To allow the post without modification, return a nil *model.Post and an empty string.
|
||||
// To dismiss the post, return a nil *model.Post and the const DismissPostError string.
|
||||
//
|
||||
// If you don't need to modify or reject posts, use MessageHasBeenPosted instead.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user