Plugin API for Shared Channels: support auto invite (#25834)

* option for auto inviting plugin to all shared channels.

* auto-invite remotes to shared channels when flag set

* fix unit test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Doug Lauder
2024-01-08 12:12:18 -05:00
коммит произвёл GitHub
родитель b05093d508
Коммит 000aa0d891
8 изменённых файлов: 69 добавлений и 6 удалений

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

@@ -305,6 +305,7 @@ type RegisterPluginOpts struct {
PluginID string // id of this plugin registering
CreatorID string // id of the user/bot registering
AutoShareDMs bool // when true, all DMs are automatically shared to this remote
AutoInvited bool // when true, the plugin is automatically invited and sync'd with all shared channels.
}
// GetOptionFlags returns a Bitmask of option flags as specified by the boolean options.
@@ -313,5 +314,8 @@ func (po RegisterPluginOpts) GetOptionFlags() Bitmask {
if po.AutoShareDMs {
flags |= BitflagOptionAutoShareDMs
}
if po.AutoInvited {
flags |= BitflagOptionAutoInvited
}
return flags
}