summaryrefslogtreecommitdiff
path: root/internal/federation/dereferencing/emoji.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2025-03-03 16:14:27 +0000
committerLibravatar GitHub <noreply@github.com>2025-03-03 16:14:27 +0000
commit24da574684b965e2f98a04eae795cc70eff22c39 (patch)
tree3e620a3555986019655256099d67dc03ebfb9edb /internal/federation/dereferencing/emoji.go
parent[feature] Refactor tokens, allow multiple app redirect_uris (#3849) (diff)
downloadgotosocial-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.go22
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
}