[MM-48161] Change data types for collections and topics (#21634)
* Change data types for collections and topics * Address suggestions Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2171ad8abf
Коммит
9f9e19e05d
@@ -486,10 +486,19 @@ func (a *App) DisablePlugin(id string) *model.AppError {
|
||||
}
|
||||
|
||||
func (ch *Channels) disablePlugin(id string) *model.AppError {
|
||||
for _, collectionType := range ch.collectionTypes[id] {
|
||||
delete(ch.topicTypes, collectionType)
|
||||
// find all collectionTypes registered by plugin
|
||||
for collectionTypeToRemove, existingPluginId := range ch.collectionTypes {
|
||||
if existingPluginId != id {
|
||||
continue
|
||||
}
|
||||
// find all topicTypes for existing collectionType
|
||||
for topicTypeToRemove, existingCollectionType := range ch.topicTypes {
|
||||
if existingCollectionType == collectionTypeToRemove {
|
||||
delete(ch.topicTypes, topicTypeToRemove)
|
||||
}
|
||||
}
|
||||
delete(ch.collectionTypes, collectionTypeToRemove)
|
||||
}
|
||||
delete(ch.collectionTypes, id)
|
||||
|
||||
pluginsEnvironment := ch.GetPluginsEnvironment()
|
||||
if pluginsEnvironment == nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user