diff options
author | 6543 <6543@obermui.de> | 2021-06-29 16:28:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 16:28:38 +0200 |
commit | 65548359cc5c78455b638c5be6fdec3e321e717a (patch) | |
tree | 0236a4aaa8e0c2a781e0383a39a667cf03528a1e /modules/setting/setting.go | |
parent | aac663e0da0af644ae1011d268d027160265dce3 (diff) | |
download | gitea-65548359cc5c78455b638c5be6fdec3e321e717a.tar.gz gitea-65548359cc5c78455b638c5be6fdec3e321e717a.zip |
Add custom emoji support (#16004)
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r-- | modules/setting/setting.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index de167e288a..e37b788342 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -208,7 +208,9 @@ var ( DefaultTheme string Themes []string Reactions []string - ReactionsMap map[string]bool + ReactionsMap map[string]bool `ini:"-"` + CustomEmojis []string + CustomEmojisMap map[string]string `ini:"-"` SearchRepoDescription bool UseServiceWorker bool @@ -256,6 +258,8 @@ var ( DefaultTheme: `gitea`, Themes: []string{`gitea`, `arc-green`}, Reactions: []string{`+1`, `-1`, `laugh`, `hooray`, `confused`, `heart`, `rocket`, `eyes`}, + CustomEmojis: []string{`gitea`}, + CustomEmojisMap: map[string]string{"gitea": ":gitea:"}, Notification: struct { MinTimeout time.Duration TimeoutStep time.Duration @@ -983,6 +987,10 @@ func NewContext() { for _, reaction := range UI.Reactions { UI.ReactionsMap[reaction] = true } + UI.CustomEmojisMap = make(map[string]string) + for _, emoji := range UI.CustomEmojis { + UI.CustomEmojisMap[emoji] = ":" + emoji + ":" + } } func parseAuthorizedPrincipalsAllow(values []string) ([]string, bool) { |