MM-11575: change plugin nil semantics (#9212)
* change MessageWillBePosted nil return semantics * change FileWillBeUploaded nil return semantics * use LogDebug to verify plugin inputs vs. the confusing Delete(User|Team)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1ecb98d9f5
Коммит
04749027f6
@@ -45,7 +45,7 @@ func TestPluginDeadlock(t *testing.T) {
|
||||
|
||||
func (p *MyPlugin) MessageWillBePosted(c *plugin.Context, post *model.Post) (*model.Post, string) {
|
||||
if _, from_plugin := post.Props["from_plugin"]; from_plugin {
|
||||
return post, ""
|
||||
return nil, ""
|
||||
}
|
||||
|
||||
p.API.CreatePost(&model.Post{
|
||||
@@ -57,7 +57,7 @@ func TestPluginDeadlock(t *testing.T) {
|
||||
},
|
||||
})
|
||||
|
||||
return post, ""
|
||||
return nil, ""
|
||||
}
|
||||
|
||||
func main() {
|
||||
@@ -120,7 +120,7 @@ func TestPluginDeadlock(t *testing.T) {
|
||||
|
||||
func (p *MyPlugin) MessageWillBePosted(c *plugin.Context, post *model.Post) (*model.Post, string) {
|
||||
if _, from_plugin := post.Props["from_plugin"]; from_plugin {
|
||||
return post, ""
|
||||
return nil, ""
|
||||
}
|
||||
|
||||
p.API.CreatePost(&model.Post{
|
||||
@@ -132,7 +132,7 @@ func TestPluginDeadlock(t *testing.T) {
|
||||
},
|
||||
})
|
||||
|
||||
return post, ""
|
||||
return nil, ""
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
Ссылка в новой задаче
Block a user