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:
progserega
2019-07-16 19:16:17 +10:00
committed by Tulir Asokan
parent 29f5ae45c4
commit 92958343dd
3 changed files with 11 additions and 1 deletions

View File

@ -460,13 +460,17 @@ func (portal *Portal) Sync(user *User, contact whatsapp.Contact) {
func (portal *Portal) GetBasePowerLevels() *mautrix.PowerLevels {
anyone := 0
nope := 99
invite := 99
if portal.bridge.Config.Bridge.AllowUserInvite {
invite = 0
}
return &mautrix.PowerLevels{
UsersDefault: anyone,
EventsDefault: anyone,
RedactPtr: &anyone,
StateDefaultPtr: &nope,
BanPtr: &nope,
InvitePtr: &nope,
InvitePtr: &invite,
Users: map[string]int{
portal.MainIntent().UserID: 100,
},