Add option to allow inviting other users in portal rooms (#77)
This doesn't mean the invited users get bridged, but for some use cases that doesn't matter
This commit is contained in:
parent
29f5ae45c4
commit
92958343dd
@ -50,6 +50,8 @@ type BridgeConfig struct {
|
|||||||
InviteOwnPuppetForBackfilling bool `yaml:"invite_own_puppet_for_backfilling"`
|
InviteOwnPuppetForBackfilling bool `yaml:"invite_own_puppet_for_backfilling"`
|
||||||
PrivateChatPortalMeta bool `yaml:"private_chat_portal_meta"`
|
PrivateChatPortalMeta bool `yaml:"private_chat_portal_meta"`
|
||||||
|
|
||||||
|
AllowUserInvite bool `yaml:"allow_user_invite"`
|
||||||
|
|
||||||
CommandPrefix string `yaml:"command_prefix"`
|
CommandPrefix string `yaml:"command_prefix"`
|
||||||
|
|
||||||
Permissions PermissionConfig `yaml:"permissions"`
|
Permissions PermissionConfig `yaml:"permissions"`
|
||||||
|
@ -101,6 +101,10 @@ bridge:
|
|||||||
# but causes room avatar/name bugs.
|
# but causes room avatar/name bugs.
|
||||||
private_chat_portal_meta: false
|
private_chat_portal_meta: false
|
||||||
|
|
||||||
|
# Allow invite permission for user. User can invite any bots to room with whatsapp
|
||||||
|
# users (private chat and groups)
|
||||||
|
allow_user_invite: false
|
||||||
|
|
||||||
# The prefix for commands. Only required in non-management rooms.
|
# The prefix for commands. Only required in non-management rooms.
|
||||||
command_prefix: "!wa"
|
command_prefix: "!wa"
|
||||||
|
|
||||||
|
@ -460,13 +460,17 @@ func (portal *Portal) Sync(user *User, contact whatsapp.Contact) {
|
|||||||
func (portal *Portal) GetBasePowerLevels() *mautrix.PowerLevels {
|
func (portal *Portal) GetBasePowerLevels() *mautrix.PowerLevels {
|
||||||
anyone := 0
|
anyone := 0
|
||||||
nope := 99
|
nope := 99
|
||||||
|
invite := 99
|
||||||
|
if portal.bridge.Config.Bridge.AllowUserInvite {
|
||||||
|
invite = 0
|
||||||
|
}
|
||||||
return &mautrix.PowerLevels{
|
return &mautrix.PowerLevels{
|
||||||
UsersDefault: anyone,
|
UsersDefault: anyone,
|
||||||
EventsDefault: anyone,
|
EventsDefault: anyone,
|
||||||
RedactPtr: &anyone,
|
RedactPtr: &anyone,
|
||||||
StateDefaultPtr: &nope,
|
StateDefaultPtr: &nope,
|
||||||
BanPtr: &nope,
|
BanPtr: &nope,
|
||||||
InvitePtr: &nope,
|
InvitePtr: &invite,
|
||||||
Users: map[string]int{
|
Users: map[string]int{
|
||||||
portal.MainIntent().UserID: 100,
|
portal.MainIntent().UserID: 100,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user