PLT-6965 jira integration (plus plugin scaffolding) (#6918)

* plugin scaffolding / jira integration

* add vendored testify packages

* webhook fix

* don't change i18n ids

* support configuration watching

* add basic jira plugin configuration to admin console

* fix eslint errors

* fix another eslint warning

* polish

* undo unintentional config.json commit >:(

* test fix

* add jira plugin diagnostics, remove dm support, add bot tag, generate web-safe secrets

* rebase, implement requested changes

* requested changes

* remove tests and minimize makefile change

* add missing license headers

* add missing comma

* remove bad line from Makefile
Этот коммит содержится в:
Chris
2017-08-02 01:36:54 -07:00
коммит произвёл GitHub
родитель c6bf235ec2
Коммит 65817e13c7
24 изменённых файлов: 891 добавлений и 33 удалений

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

@@ -1206,3 +1206,19 @@ func GetPinnedPosts(channelId string) (*model.PostList, *model.AppError) {
return result.Data.(*model.PostList), nil
}
}
func GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError) {
result := <-Srv.Store.Channel().GetByName("", model.GetDMNameFromIds(userId1, userId2), true)
if result.Err != nil && result.Err.Id == store.MISSING_CHANNEL_ERROR {
result := <-Srv.Store.Channel().CreateDirectChannel(userId1, userId2)
if result.Err != nil {
return nil, model.NewAppError("GetOrCreateDMChannel", "web.incoming_webhook.channel.app_error", nil, "err="+result.Err.Message, http.StatusBadRequest)
}
InvalidateCacheForUser(userId1)
InvalidateCacheForUser(userId2)
return result.Data.(*model.Channel), nil
} else if result.Err != nil {
return nil, model.NewAppError("GetOrCreateDMChannel", "web.incoming_webhook.channel.app_error", nil, "err="+result.Err.Message, result.Err.StatusCode)
}
return result.Data.(*model.Channel), nil
}