diff --git a/bridgev2/status/bridgestate.go b/bridgev2/status/bridgestate.go index 671303e0..3bc5a59b 100644 --- a/bridgev2/status/bridgestate.go +++ b/bridgev2/status/bridgestate.go @@ -22,7 +22,7 @@ import ( "go.mau.fi/util/ptr" "maunium.net/go/mautrix" - "maunium.net/go/mautrix/crypto/attachment" + "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/id" ) @@ -89,8 +89,7 @@ type RemoteProfile struct { Name string `json:"name,omitempty"` Avatar id.ContentURIString `json:"avatar,omitempty"` - // Only used for backups of local bridge states - AvatarKeys *attachment.EncryptedFile `json:"avatar_keys,omitempty"` + AvatarFile *event.EncryptedFileInfo `json:"avatar_file,omitempty"` } func coalesce[T ~string](a, b T) T { @@ -106,14 +105,14 @@ func (rp *RemoteProfile) Merge(other RemoteProfile) RemoteProfile { other.Username = coalesce(rp.Username, other.Username) other.Name = coalesce(rp.Name, other.Name) other.Avatar = coalesce(rp.Avatar, other.Avatar) - if rp.AvatarKeys != nil { - other.AvatarKeys = rp.AvatarKeys + if rp.AvatarFile != nil { + other.AvatarFile = rp.AvatarFile } return other } func (rp *RemoteProfile) IsEmpty() bool { - return rp == nil || (rp.Phone == "" && rp.Email == "" && rp.Username == "" && rp.Name == "" && rp.Avatar == "") + return rp == nil || (rp.Phone == "" && rp.Email == "" && rp.Username == "" && rp.Name == "" && rp.Avatar == "" && rp.AvatarFile == nil) } type BridgeState struct {