[MM-59361] custom groups & read only channels (#28892)

* added group mention, read only view and post event tracking

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Guillermo Vayá
2024-10-28 13:41:29 +01:00
коммит произвёл GitHub
родитель c64215f6c2
Коммит a532b70317
13 изменённых файлов: 309 добавлений и 12 удалений

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

@@ -23,6 +23,7 @@ import (
"github.com/mattermost/mattermost/server/v8/channels/store"
"github.com/mattermost/mattermost/server/v8/channels/store/sqlstore"
"github.com/mattermost/mattermost/server/v8/platform/services/cache"
"github.com/mattermost/mattermost/server/v8/platform/services/telemetry"
)
const (
@@ -79,6 +80,22 @@ func (a *App) CreatePostAsUser(c request.CTX, post *model.Post, currentSessionId
)
}
}
if channel.SchemeId != nil && *channel.SchemeId != "" {
isReadOnly, ircErr := a.Srv().Store().Channel().IsChannelReadOnlyScheme(*channel.SchemeId)
if ircErr != nil {
mlog.Warn("Error trying to check if it was a post to a readonly channel", mlog.Err(ircErr))
}
if isReadOnly {
a.Srv().telemetryService.SendTelemetryForFeature(
telemetry.TrackReadOnlyFeature,
"read_only_channel_posted",
map[string]any{
telemetry.TrackPropertyUser: post.UserId,
telemetry.TrackPropertyChannel: post.ChannelId,
},
)
}
}
return rp, nil
}