diff options
author | 2022-11-24 19:12:07 +0100 | |
---|---|---|
committer | 2022-11-24 18:12:07 +0000 | |
commit | b6dbe21026615ef3fbaacff98c7cc860cef39d16 (patch) | |
tree | cef207c759ba936c9432c456e751c862e2c0830c /internal/api/model/emoji.go | |
parent | [bugfix] Fix status boosts giving 404 (#1137) (diff) | |
download | gotosocial-b6dbe21026615ef3fbaacff98c7cc860cef39d16.tar.xz |
[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>
Diffstat (limited to 'internal/api/model/emoji.go')
-rw-r--r-- | internal/api/model/emoji.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/api/model/emoji.go b/internal/api/model/emoji.go index eb636f63c..2c75ceadd 100644 --- a/internal/api/model/emoji.go +++ b/internal/api/model/emoji.go @@ -54,3 +54,28 @@ type EmojiCreateRequest struct { // CategoryName length should not exceed 64 characters. CategoryName string `form:"category"` } + +// EmojiUpdateRequest represents a request to update a custom emoji, made through the admin API. +// +// swagger:model emojiUpdateRequest +type EmojiUpdateRequest struct { + // Type of action. One of disable, modify, copy. + Type EmojiUpdateType `form:"type" json:"type" xml:"type"` + // Desired shortcode for the emoji, without surrounding colons. This must be unique for the domain. + // example: blobcat_uwu + Shortcode *string `form:"shortcode"` + // Image file to use for the emoji. + // Must be png or gif and no larger than 50kb. + Image *multipart.FileHeader `form:"image"` + // Category in which to place the emoji. + CategoryName *string `form:"category"` +} + +// EmojiUpdateType models an admin update action to take on a custom emoji. +type EmojiUpdateType string + +const ( + EmojiUpdateModify EmojiUpdateType = "modify" // modify local emoji + EmojiUpdateDisable EmojiUpdateType = "disable" // disable remote emoji + EmojiUpdateCopy EmojiUpdateType = "copy" // copy remote emoji -> local +) |