[feature] PATCH /api/v1/admin/custom_emojis/{id} endpoint (#1061)

* start adding admin emoji PATCH stuff

* updating works OK, now how about copying

* allow emojis to be copied

* update swagger docs

* update admin processer to use non-interface storage driver

* remove shortcode updating for local emojis

* go fmt

Co-authored-by: f0x52 <f0x@cthu.lu>
This commit is contained in:
tobi 2022-11-24 19:12:07 +01:00 committed by GitHub
commit b6dbe21026
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 1139 additions and 4 deletions

View file

@ -115,6 +115,7 @@ func (p *ProcessingEmoji) LoadEmoji(ctx context.Context) (*gtsmodel.Emoji, error
"image_file_size",
"image_static_file_size",
"image_updated_at",
"shortcode",
"uri",
}
if _, err := p.database.UpdateEmoji(ctx, p.emoji, columns...); err != nil {
@ -340,7 +341,7 @@ func (m *manager) preProcessEmoji(ctx context.Context, data DataFunc, postData P
emoji.ImageStaticURL = uris.GenerateURIForAttachment(instanceAccount.ID, string(TypeEmoji), string(SizeStatic), newPathID, mimePng)
emoji.ImageStaticPath = fmt.Sprintf("%s/%s/%s/%s.%s", instanceAccount.ID, TypeEmoji, SizeStatic, newPathID, mimePng)
// update these fields as we go
emoji.Shortcode = shortcode
emoji.URI = uri
} else {
disabled := false