From 268f252e0d517f2693b30d03fb8a68a0764a43bc Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 12 Sep 2022 13:03:23 +0200 Subject: [feature] Fetch + display custom emoji in statuses from remote instances (#807) * start implementing remote emoji fetcher * update status where pk * aaa * tidy up a little * check size limits for emojis * thank you linter, i love you <3 * update swagger docs * add emoji dereference test * make emoji max sizes configurable * normalize db.ErrAlreadyExists --- internal/config/helpers.gen.go | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'internal/config/helpers.gen.go') diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index a5dcc4c1c..51891a537 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -793,6 +793,56 @@ func GetMediaRemoteCacheDays() int { return global.GetMediaRemoteCacheDays() } // SetMediaRemoteCacheDays safely sets the value for global configuration 'MediaRemoteCacheDays' field func SetMediaRemoteCacheDays(v int) { global.SetMediaRemoteCacheDays(v) } +// GetMediaEmojiLocalMaxSize safely fetches the Configuration value for state's 'MediaEmojiLocalMaxSize' field +func (st *ConfigState) GetMediaEmojiLocalMaxSize() (v int) { + st.mutex.Lock() + v = st.config.MediaEmojiLocalMaxSize + st.mutex.Unlock() + return +} + +// SetMediaEmojiLocalMaxSize safely sets the Configuration value for state's 'MediaEmojiLocalMaxSize' field +func (st *ConfigState) SetMediaEmojiLocalMaxSize(v int) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.MediaEmojiLocalMaxSize = v + st.reloadToViper() +} + +// MediaEmojiLocalMaxSizeFlag returns the flag name for the 'MediaEmojiLocalMaxSize' field +func MediaEmojiLocalMaxSizeFlag() string { return "media-emoji-local-max-size" } + +// GetMediaEmojiLocalMaxSize safely fetches the value for global configuration 'MediaEmojiLocalMaxSize' field +func GetMediaEmojiLocalMaxSize() int { return global.GetMediaEmojiLocalMaxSize() } + +// SetMediaEmojiLocalMaxSize safely sets the value for global configuration 'MediaEmojiLocalMaxSize' field +func SetMediaEmojiLocalMaxSize(v int) { global.SetMediaEmojiLocalMaxSize(v) } + +// GetMediaEmojiRemoteMaxSize safely fetches the Configuration value for state's 'MediaEmojiRemoteMaxSize' field +func (st *ConfigState) GetMediaEmojiRemoteMaxSize() (v int) { + st.mutex.Lock() + v = st.config.MediaEmojiRemoteMaxSize + st.mutex.Unlock() + return +} + +// SetMediaEmojiRemoteMaxSize safely sets the Configuration value for state's 'MediaEmojiRemoteMaxSize' field +func (st *ConfigState) SetMediaEmojiRemoteMaxSize(v int) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.MediaEmojiRemoteMaxSize = v + st.reloadToViper() +} + +// MediaEmojiRemoteMaxSizeFlag returns the flag name for the 'MediaEmojiRemoteMaxSize' field +func MediaEmojiRemoteMaxSizeFlag() string { return "media-emoji-remote-max-size" } + +// GetMediaEmojiRemoteMaxSize safely fetches the value for global configuration 'MediaEmojiRemoteMaxSize' field +func GetMediaEmojiRemoteMaxSize() int { return global.GetMediaEmojiRemoteMaxSize() } + +// SetMediaEmojiRemoteMaxSize safely sets the value for global configuration 'MediaEmojiRemoteMaxSize' field +func SetMediaEmojiRemoteMaxSize(v int) { global.SetMediaEmojiRemoteMaxSize(v) } + // GetStorageBackend safely fetches the Configuration value for state's 'StorageBackend' field func (st *ConfigState) GetStorageBackend() (v string) { st.mutex.Lock() -- cgit v1.2.3