MM-62751: [Shared Channels] Allow remote users to be discoverable in the create DM/GM modal (#30918)

Этот коммит содержится в:
catalintomai
2025-06-13 16:51:12 +02:00
коммит произвёл GitHub
родитель 476b46d1d7
Коммит c46ed6c681
24 изменённых файлов: 2133 добавлений и 38 удалений

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

@@ -3459,6 +3459,8 @@ type ConnectedWorkspacesSettings struct {
EnableSharedChannels *bool
EnableRemoteClusterService *bool
DisableSharedChannelsStatusSync *bool
SyncUsersOnConnectionOpen *bool
GlobalUserSyncBatchSize *int
MaxPostsPerSync *int
}
@@ -3483,6 +3485,14 @@ func (c *ConnectedWorkspacesSettings) SetDefaults(isUpdate bool, e ExperimentalS
c.DisableSharedChannelsStatusSync = NewPointer(false)
}
if c.SyncUsersOnConnectionOpen == nil {
c.SyncUsersOnConnectionOpen = NewPointer(false)
}
if c.GlobalUserSyncBatchSize == nil {
c.GlobalUserSyncBatchSize = NewPointer(25) // Default to MaxUsersPerSync
}
if c.MaxPostsPerSync == nil {
c.MaxPostsPerSync = NewPointer(ConnectedWorkspacesSettingsDefaultMaxPostsPerSync)
}

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

@@ -25,6 +25,9 @@ type FeatureFlags struct {
// Enable plugins in shared channels.
EnableSharedChannelsPlugins bool
// Enable syncing all users for remote clusters in shared channels
EnableSyncAllUsersForRemoteCluster bool
// AppsEnabled toggles the Apps framework functionalities both in server and client side
AppsEnabled bool
@@ -69,6 +72,7 @@ func (f *FeatureFlags) SetDefaults() {
f.TestBoolFeature = false
f.EnableRemoteClusterService = false
f.EnableSharedChannelsDMs = false
f.EnableSyncAllUsersForRemoteCluster = false
f.EnableSharedChannelsPlugins = true
f.AppsEnabled = false
f.NormalizeLdapDNs = false

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

@@ -53,37 +53,39 @@ func (bm *Bitmask) UnsetBit(flag Bitmask) {
}
type RemoteCluster struct {
RemoteId string `json:"remote_id"`
RemoteTeamId string `json:"remote_team_id"` // Deprecated: this field is no longer used. It's only kept for backwards compatibility.
Name string `json:"name"`
DisplayName string `json:"display_name"`
SiteURL string `json:"site_url"`
DefaultTeamId string `json:"default_team_id"`
CreateAt int64 `json:"create_at"`
DeleteAt int64 `json:"delete_at"`
LastPingAt int64 `json:"last_ping_at"`
Token string `json:"token"`
RemoteToken string `json:"remote_token"`
Topics string `json:"topics"`
CreatorId string `json:"creator_id"`
PluginID string `json:"plugin_id"` // non-empty when sync message are to be delivered via plugin API
Options Bitmask `json:"options"` // bit-flag set of options
RemoteId string `json:"remote_id"`
RemoteTeamId string `json:"remote_team_id"` // Deprecated: this field is no longer used. It's only kept for backwards compatibility.
Name string `json:"name"`
DisplayName string `json:"display_name"`
SiteURL string `json:"site_url"`
DefaultTeamId string `json:"default_team_id"`
CreateAt int64 `json:"create_at"`
DeleteAt int64 `json:"delete_at"`
LastPingAt int64 `json:"last_ping_at"`
LastGlobalUserSyncAt int64 `json:"last_global_user_sync_at"` // Timestamp of last global user sync
Token string `json:"token"`
RemoteToken string `json:"remote_token"`
Topics string `json:"topics"`
CreatorId string `json:"creator_id"`
PluginID string `json:"plugin_id"` // non-empty when sync message are to be delivered via plugin API
Options Bitmask `json:"options"` // bit-flag set of options
}
func (rc *RemoteCluster) Auditable() map[string]any {
return map[string]any{
"remote_id": rc.RemoteId,
"remote_team_id": rc.RemoteTeamId,
"name": rc.Name,
"display_name": rc.DisplayName,
"site_url": rc.SiteURL,
"default_team_id": rc.DefaultTeamId,
"create_at": rc.CreateAt,
"delete_at": rc.DeleteAt,
"last_ping_at": rc.LastPingAt,
"creator_id": rc.CreatorId,
"plugin_id": rc.PluginID,
"options": rc.Options,
"remote_id": rc.RemoteId,
"remote_team_id": rc.RemoteTeamId,
"name": rc.Name,
"display_name": rc.DisplayName,
"site_url": rc.SiteURL,
"default_team_id": rc.DefaultTeamId,
"create_at": rc.CreateAt,
"delete_at": rc.DeleteAt,
"last_ping_at": rc.LastPingAt,
"last_global_user_sync_at": rc.LastGlobalUserSyncAt,
"creator_id": rc.CreatorId,
"plugin_id": rc.PluginID,
"options": rc.Options,
}
}

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

@@ -40,6 +40,8 @@ type UserGetOptions struct {
Page int
// Page size
PerPage int
// Filters the users that have been updated after the given time
UpdatedAfter int64
}
type UserGetByIdsOptions struct {