MM-53924 - Implement NotificationWillBePushed plugin hook (#24263)

* add NotificationWillBePushed hook

* mocks

* use a struct for hook parameters; simplify number of parameters sent across RPC

* missing wg.Wait

* change to a bool return value
Этот коммит содержится в:
Christopher Poile
2023-08-18 12:01:50 -04:00
коммит произвёл GitHub
родитель 56a0becbca
Коммит f13a531bca
10 изменённых файлов: 257 добавлений и 4 удалений

Просмотреть файл

@@ -50,6 +50,7 @@ const (
deprecatedGetCollectionMetadataByIdsID = 32
deprecatedGetTopicMetadataByIdsID = 33
ConfigurationWillBeSavedID = 34
NotificationWillBePushedID = 35
TotalHooksID = iota
)
@@ -284,4 +285,12 @@ type Hooks interface {
// config object can be returned to be stored in place of the provided one.
// Minimum server version: 8.0
ConfigurationWillBeSaved(newCfg *model.Config) (*model.Config, error)
// NotificationWillBePushed is invoked before a push notification is sent to the push
// notification server. The intention is to allow plugins to cancel a push notification.
//
// To cancel a push notification, return true.
//
// Minimum server version: 9.0
NotificationWillBePushed(pushNotification *model.PluginPushNotification) (cancel bool)
}