[MM-16709] Add helper method for plugins using MessageHasBeenPosted (#12539)
The PR introduces a method in helper interface. The method has common code for filtering to be used across plugins which use MessageHasBeenPosted.
Этот коммит содержится в:
коммит произвёл
Ben Schumacher
родитель
9b6a0674f7
Коммит
f2fcfa8f9d
@@ -57,6 +57,18 @@ type Helpers interface {
|
||||
//
|
||||
// Minimum server version: 5.6
|
||||
KVSetWithExpiryJSON(key string, value interface{}, expireInSeconds int64) error
|
||||
|
||||
// ShouldProcessMessage returns if the message should be processed by a message hook.
|
||||
//
|
||||
// Use this method to avoid processing unnecessary messages in a MessageHasBeenPosted
|
||||
// or MessageWillBePosted hook, and indeed in some cases avoid an infinite loop between
|
||||
// two automated bots or plugins.
|
||||
//
|
||||
// The behaviour is customizable using the given options, since plugin needs may vary.
|
||||
// By default, system messages and messages from bots will be skipped.
|
||||
//
|
||||
// Minimum server version: 5.2
|
||||
ShouldProcessMessage(post *model.Post, options ...ShouldProcessMessageOption) (bool, error)
|
||||
}
|
||||
|
||||
// HelpersImpl implements the helpers interface with an API that retrieves data on behalf of the plugin.
|
||||
|
||||
Ссылка в новой задаче
Block a user