Prep for reactions, some fixes and improvements
Some checks failed
/ docker (push) Failing after 1m35s

This commit is contained in:
Melody Becker 2025-06-16 08:13:11 +02:00
parent 4b62c32247
commit 8947d97825
Signed by: mstar
SSH key fingerprint: SHA256:vkXfS9FG2pVNVfvDrzd1VW9n8VJzqqdKQGljxxX8uK8
13 changed files with 262 additions and 43 deletions

View file

@ -0,0 +1,30 @@
package translators
import (
"context"
"git.mstar.dev/mstar/linstrom/config"
"git.mstar.dev/mstar/linstrom/storage-new/dbgen"
)
func EmoteTagFromStorage(ctx context.Context, id string) (*Tag, error) {
emote, err := dbgen.Emote.Where(dbgen.Emote.ID.Eq(id)).First()
if err != nil {
return nil, err
}
emoteId := config.GlobalConfig.General.GetFullPublicUrl() + "/api/activitypub/emote/" + id
emoteMedia, err := MediaFromStorage(ctx, emote.MetadataId)
if err != nil {
return nil, err
}
out := Tag{
Type: "Emoji",
Name: emote.Name,
Href: nil,
Id: &emoteId,
Updated: &emote.UpdatedAt,
Icon: emoteMedia,
}
return &out, nil
}