Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Don't use invalid fallback user for profile lookup
Browse files Browse the repository at this point in the history
Also log fallback usage
  • Loading branch information
AndrewFerr committed Feb 21, 2024
1 parent a546016 commit 6bee8a4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions puppet.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,21 @@ func (puppet *Puppet) UpdateInfo(ctx context.Context, source *User) {
log.Err(err).Msg("Failed to fetch contact info")
return
}

log.Trace().Msg("Updating puppet info")

if sourceUUID != uuid.Nil {
source = puppet.bridge.GetUserBySignalID(sourceUUID)
if source == nil || source.Client == nil {
log.Warn().
Stringer("source_uuid", sourceUUID).
Msg("No fallback user for profile info update")
return
}
log.Debug().
Stringer("source_mxid", source.MXID).
Msg("Using fallback user for profile info update")
}

log.Trace().Msg("Updating puppet info")

update := false
if info.E164 != "" && puppet.Number != info.E164 {
puppet.Number = info.E164
Expand Down

0 comments on commit 6bee8a4

Please sign in to comment.