Skip to content

Commit

Permalink
bridgev2/portal: assume newly created rooms are unmuted and untagged
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Oct 4, 2024
1 parent 7e041c6 commit d48a5ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bridgev2/portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3176,13 +3176,13 @@ func (portal *Portal) updateUserLocalInfo(ctx context.Context, info *UserLocalPo
if info == nil {
return
}
if info.MutedUntil != nil && (didJustCreate || !portal.Bridge.Config.MuteOnlyOnCreate) {
if info.MutedUntil != nil && (didJustCreate || !portal.Bridge.Config.MuteOnlyOnCreate) && (!didJustCreate || info.MutedUntil.After(time.Now())) {
err := dp.MuteRoom(ctx, portal.MXID, *info.MutedUntil)
if err != nil {
zerolog.Ctx(ctx).Err(err).Msg("Failed to mute room")
}
}
if info.Tag != nil && (didJustCreate || !portal.Bridge.Config.TagOnlyOnCreate) {
if info.Tag != nil && (didJustCreate || !portal.Bridge.Config.TagOnlyOnCreate) && (!didJustCreate || *info.Tag != "") {
err := dp.TagRoom(ctx, portal.MXID, *info.Tag, *info.Tag != "")
if err != nil {
zerolog.Ctx(ctx).Err(err).Msg("Failed to tag room")
Expand Down

0 comments on commit d48a5ca

Please sign in to comment.