mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/config: add option to disable kicking matrix users
This commit is contained in:
parent
8b70baa336
commit
981addddc9
4 changed files with 6 additions and 1 deletions
|
|
@ -78,6 +78,7 @@ type BridgeConfig struct {
|
|||
CrossRoomReplies bool `yaml:"cross_room_replies"`
|
||||
OutgoingMessageReID bool `yaml:"outgoing_message_re_id"`
|
||||
RevertFailedStateChanges bool `yaml:"revert_failed_state_changes"`
|
||||
KickMatrixUsers bool `yaml:"kick_matrix_users"`
|
||||
CleanupOnLogout CleanupOnLogouts `yaml:"cleanup_on_logout"`
|
||||
Relay RelayConfig `yaml:"relay"`
|
||||
Permissions PermissionConfig `yaml:"permissions"`
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ func doUpgrade(helper up.Helper) {
|
|||
helper.Copy(up.Bool, "bridge", "deduplicate_matrix_messages")
|
||||
helper.Copy(up.Bool, "bridge", "cross_room_replies")
|
||||
helper.Copy(up.Bool, "bridge", "revert_failed_state_changes")
|
||||
helper.Copy(up.Bool, "bridge", "kick_matrix_users")
|
||||
helper.Copy(up.Bool, "bridge", "cleanup_on_logout", "enabled")
|
||||
helper.Copy(up.Str, "bridge", "cleanup_on_logout", "manual", "private")
|
||||
helper.Copy(up.Str, "bridge", "cleanup_on_logout", "manual", "relayed")
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ bridge:
|
|||
cross_room_replies: false
|
||||
# If a state event fails to bridge, should the bridge revert any state changes made by that event?
|
||||
revert_failed_state_changes: false
|
||||
# In portals with no relay set, should Matrix users be kicked if they're
|
||||
# not logged into an account that's in the remote chat?
|
||||
kick_matrix_users: true
|
||||
|
||||
# What should be done to portal rooms when a user logs out or is logged out?
|
||||
# Permitted values:
|
||||
|
|
|
|||
|
|
@ -4411,7 +4411,7 @@ func (portal *Portal) syncParticipants(
|
|||
if memberEvt.Membership == event.MembershipLeave || memberEvt.Membership == event.MembershipBan {
|
||||
continue
|
||||
}
|
||||
if !portal.Bridge.IsGhostMXID(extraMember) && portal.Relay != nil {
|
||||
if !portal.Bridge.IsGhostMXID(extraMember) && (portal.Relay != nil || !portal.Bridge.Config.KickMatrixUsers) {
|
||||
continue
|
||||
}
|
||||
_, err = portal.Bridge.Bot.SendState(ctx, portal.MXID, event.StateMember, extraMember.String(), &event.Content{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue