MM-53924 - Implement push notifications plugin hook and plugin api method (#24350)
* Revert "MM-52804 - Implement SendPushNotification plugin api method (#24273)" This reverts commit8418eefb75. * Revert "MM-53924 - Implement NotificationWillBePushed plugin hook (#24263)" This reverts commitf13a531bca. * implement NotificationWillBePushed plugin hook * implement SendPushNotification plugin api method * move where we're setting post and channel type * fix comment --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
dad579daee
Коммит
69c11cfe14
@@ -119,7 +119,7 @@ type ConfigurationWillBeSavedIFace interface {
|
||||
}
|
||||
|
||||
type NotificationWillBePushedIFace interface {
|
||||
NotificationWillBePushed(pushNotification *model.PluginPushNotification) (cancel bool)
|
||||
NotificationWillBePushed(pushNotification *model.PushNotification, userID string) (*model.PushNotification, string)
|
||||
}
|
||||
|
||||
type HooksAdapter struct {
|
||||
@@ -615,11 +615,11 @@ func (a *HooksAdapter) ConfigurationWillBeSaved(newCfg *model.Config) (*model.Co
|
||||
|
||||
}
|
||||
|
||||
func (a *HooksAdapter) NotificationWillBePushed(pushNotification *model.PluginPushNotification) (cancel bool) {
|
||||
func (a *HooksAdapter) NotificationWillBePushed(pushNotification *model.PushNotification, userID string) (*model.PushNotification, string) {
|
||||
if _, ok := a.implemented[NotificationWillBePushedID]; !ok {
|
||||
panic("product hooks must implement NotificationWillBePushed")
|
||||
}
|
||||
|
||||
return a.productHooks.(NotificationWillBePushedIFace).NotificationWillBePushed(pushNotification)
|
||||
return a.productHooks.(NotificationWillBePushedIFace).NotificationWillBePushed(pushNotification, userID)
|
||||
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user