MM-52804 - Implement SendPushNotification plugin api method (#24273)
* add SendPushNotification plugin api method * lint; add testing.Short bc of the sleep * add interface and generated layers * add fields to PluginPushNotification; generate mocks * SendPushNotification -> SendPluginPushNotification; improved comments * more comments; fix test * send api.ctx
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f13a531bca
Коммит
8418eefb75
@@ -143,9 +143,12 @@ func (a *App) sendPushNotification(notification *PostNotification, user *model.U
|
||||
cancelled := false
|
||||
a.ch.RunMultiHook(func(hooks plugin.Hooks) bool {
|
||||
cancelled = hooks.NotificationWillBePushed(&model.PluginPushNotification{
|
||||
Post: notification.Post.ForPlugin(),
|
||||
Channel: notification.Channel,
|
||||
UserID: user.Id,
|
||||
Post: notification.Post.ForPlugin(),
|
||||
Channel: notification.Channel,
|
||||
UserID: user.Id,
|
||||
ExplicitMention: explicitMention,
|
||||
ChannelWideMention: channelWideMention,
|
||||
ReplyToThreadType: replyToThreadType,
|
||||
})
|
||||
if cancelled {
|
||||
mlog.Info("Notification cancelled by plugin")
|
||||
|
||||
Ссылка в новой задаче
Block a user