[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>
Этот коммит содержится в:
Shota Gvinepadze
2022-11-15 00:57:04 +04:00
коммит произвёл GitHub
родитель 2171ad8abf
Коммит 9f9e19e05d
3 изменённых файлов: 26 добавлений и 27 удалений

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

@@ -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 {