File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export interface ITeamSyncConfig {
3636 alias_prefix ?: string ;
3737 allow_private ?: boolean ;
3838 allow_public ?: boolean ;
39+ allow_membership_sync ?: boolean ;
3940 hint_channel_admins ?: boolean ;
4041 } ;
4142 users ?: {
@@ -78,6 +79,9 @@ export class TeamSyncer {
7879 if ( ! teamConfig . channels . allow_public && ! teamConfig . channels . allow_private ) {
7980 throw Error ( 'At least one of allow_public, allow_private must be true in the teamSync config' ) ;
8081 }
82+ if ( teamConfig . channels . allow_membership_sync === undefined ) {
83+ teamConfig . channels . allow_membership_sync = true ;
84+ }
8185 // Send hint to channel admins
8286 teamConfig . channels . hint_channel_admins =
8387 teamConfig . channels . hint_channel_admins === undefined
@@ -433,6 +437,14 @@ export class TeamSyncer {
433437 throw Error ( "Could not find team" ) ;
434438 }
435439
440+ const config : false | ITeamSyncConfig = this . getTeamSyncConfig ( teamId , "channel" ) ;
441+ if ( config ) {
442+ if ( config . channels ?. allow_membership_sync === false ) {
443+ log . info ( "Skipping membership sync because disabled in config" ) ;
444+ return ;
445+ }
446+ }
447+
436448 // create Set for both matrix membership state and slack membership state
437449 // compare them to figure out who all needs to join the matrix room and leave the matrix room
438450 // this obviously assumes we treat slack as the source of truth for membership
You can’t perform that action at this time.
0 commit comments