diff options
| author | 2025-03-03 16:14:27 +0000 | |
|---|---|---|
| committer | 2025-03-03 16:14:27 +0000 | |
| commit | 24da574684b965e2f98a04eae795cc70eff22c39 (patch) | |
| tree | 3e620a3555986019655256099d67dc03ebfb9edb /internal/federation/dereferencing/emoji.go | |
| parent | [feature] Refactor tokens, allow multiple app redirect_uris (#3849) (diff) | |
| download | gotosocial-24da574684b965e2f98a04eae795cc70eff22c39.tar.xz | |
[bugfix] fix refreshed additional media info being ignored (#3867)
* fix refreshed additional media info being ignored when force flag already set
* also update to always iterate through all additional info fields
* make similar changes for emoji, even if not necessary, just to keep in-sync
Diffstat (limited to 'internal/federation/dereferencing/emoji.go')
| -rw-r--r-- | internal/federation/dereferencing/emoji.go | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/internal/federation/dereferencing/emoji.go b/internal/federation/dereferencing/emoji.go index 1ac27f2b2..0a117f762 100644 --- a/internal/federation/dereferencing/emoji.go +++ b/internal/federation/dereferencing/emoji.go @@ -134,19 +134,23 @@ func (d *Dereferencer) RefreshEmoji( *gtsmodel.Emoji, error, ) { - // Check emoji is up-to-date - // with provided extra info. - switch { - case info.URI != nil && - *info.URI != emoji.URI: + // Check uri up-to-date. + if info.URI != nil && + *info.URI != emoji.URI { emoji.URI = *info.URI force = true - case info.ImageRemoteURL != nil && - *info.ImageRemoteURL != emoji.ImageRemoteURL: + } + + // Check image remote URL up-to-date. + if info.ImageRemoteURL != nil && + *info.ImageRemoteURL != emoji.ImageRemoteURL { emoji.ImageRemoteURL = *info.ImageRemoteURL force = true - case info.ImageStaticRemoteURL != nil && - *info.ImageStaticRemoteURL != emoji.ImageStaticRemoteURL: + } + + // Check image static remote URL up-to-date. + if info.ImageStaticRemoteURL != nil && + *info.ImageStaticRemoteURL != emoji.ImageStaticRemoteURL { emoji.ImageStaticRemoteURL = *info.ImageStaticRemoteURL force = true } |
