Shared channels auto-share DM & group messages (#26097)

* option for auto inviting plugin to all shared channels.
* auto-invite remotes to shared channels when flag set
Этот коммит содержится в:
Doug Lauder
2024-02-09 10:47:12 -05:00
коммит произвёл GitHub
родитель 7e419e98ee
Коммит 7b7bcff821
28 изменённых файлов: 525 добавлений и 323 удалений

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

@@ -1305,7 +1305,7 @@ func (api *PluginAPI) UnregisterPluginForSharedChannels(pluginID string) error {
func (api *PluginAPI) ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error) {
scShared, err := api.app.ShareChannel(api.ctx, sc)
if errors.Is(err, ErrChannelAlreadyShared) {
if errors.Is(err, model.ErrChannelAlreadyShared) {
// sharing an already shared channel is not an error; treat as idempotent and return the existing shared channel
return api.app.GetSharedChannel(sc.ChannelId)
}
@@ -1328,8 +1328,8 @@ func (api *PluginAPI) SyncSharedChannel(channelID string) error {
return api.app.SyncSharedChannel(channelID)
}
func (api *PluginAPI) InviteRemoteToChannel(channelID string, remoteID, userID string) error {
return api.app.InviteRemoteToChannel(channelID, remoteID, userID)
func (api *PluginAPI) InviteRemoteToChannel(channelID string, remoteID, userID string, shareIfNotShared bool) error {
return api.app.InviteRemoteToChannel(channelID, remoteID, userID, shareIfNotShared)
}
func (api *PluginAPI) UninviteRemoteFromChannel(channelID string, remoteID string) error {