Don't try to sync power levels before creating room
This commit is contained in:
parent
d7d1abc3b7
commit
ef8a60977f
1 changed files with 10 additions and 8 deletions
18
portal.go
18
portal.go
|
@ -800,15 +800,17 @@ func (portal *Portal) UpdateMetadata(user *User, info *gmproto.Conversation) []i
|
||||||
if portal.shouldSetDMRoomMetadata() {
|
if portal.shouldSetDMRoomMetadata() {
|
||||||
update = portal.UpdateName(info.Name, false) || update
|
update = portal.UpdateName(info.Name, false) || update
|
||||||
}
|
}
|
||||||
pls, err := portal.MainIntent().PowerLevels(portal.MXID)
|
if portal.MXID != "" {
|
||||||
if err != nil {
|
pls, err := portal.MainIntent().PowerLevels(portal.MXID)
|
||||||
portal.zlog.Warn().Err(err).Msg("Failed to get power levels")
|
|
||||||
} else if portal.updatePowerLevels(info, pls) {
|
|
||||||
resp, err := portal.MainIntent().SetPowerLevels(portal.MXID, pls)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
portal.zlog.Warn().Err(err).Msg("Failed to update power levels")
|
portal.zlog.Warn().Err(err).Msg("Failed to get power levels")
|
||||||
} else {
|
} else if portal.updatePowerLevels(info, pls) {
|
||||||
portal.zlog.Debug().Str("event_id", resp.EventID.String()).Msg("Updated power levels")
|
resp, err := portal.MainIntent().SetPowerLevels(portal.MXID, pls)
|
||||||
|
if err != nil {
|
||||||
|
portal.zlog.Warn().Err(err).Msg("Failed to update power levels")
|
||||||
|
} else {
|
||||||
|
portal.zlog.Debug().Str("event_id", resp.EventID.String()).Msg("Updated power levels")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue