diff --git a/model/settings.go b/model/settings.go index d515ef1..7c7ae99 100644 --- a/model/settings.go +++ b/model/settings.go @@ -12,6 +12,7 @@ type Settings struct { DarkMode bool `json:"dark_mode"` AntiDopamineMode bool `json:"anti_dopamine_mode"` HideUnsupportedNotifs bool `json:"hide_unsupported_notifs"` + InstanceEmojiFilter string `json:"instance_emoji_filter"` AddReactionsFilter string `json:"add_reactions_filter"` CSS string `json:"css"` } @@ -29,6 +30,7 @@ func NewSettings() *Settings { DarkMode: false, AntiDopamineMode: false, HideUnsupportedNotifs: false, + InstanceEmojiFilter: "", AddReactionsFilter: "", CSS: "", } diff --git a/renderer/model.go b/renderer/model.go index 688319b..a92bae7 100644 --- a/renderer/model.go +++ b/renderer/model.go @@ -14,6 +14,7 @@ type Context struct { CSRFToken string UserID string AntiDopamineMode bool + InstanceEmojiFilter string AddReactionsFilter string UserCSS string Referrer string diff --git a/service/service.go b/service/service.go index 09bdc1a..eef434a 100644 --- a/service/service.go +++ b/service/service.go @@ -66,6 +66,7 @@ func (s *service) authenticate(c *client, sid string, csrf string, ref string, t UserID: c.s.UserID, AntiDopamineMode: sett.AntiDopamineMode, UserCSS: sett.CSS, + InstanceEmojiFilter: sett.InstanceEmojiFilter, AddReactionsFilter: sett.AddReactionsFilter, Referrer: ref, } diff --git a/service/transport.go b/service/transport.go index 3741587..2f204ab 100644 --- a/service/transport.go +++ b/service/transport.go @@ -519,6 +519,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler { darkMode := c.r.FormValue("dark_mode") == "true" antiDopamineMode := c.r.FormValue("anti_dopamine_mode") == "true" hideUnsupportedNotifs := c.r.FormValue("hide_unsupported_notifs") == "true" + instanceEmojiFilter := c.r.FormValue("instance-emoji-filter") addReactionsFilter := c.r.FormValue("pleroma-reactions-filter") css := c.r.FormValue("css") @@ -534,6 +535,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler { DarkMode: darkMode, AntiDopamineMode: antiDopamineMode, HideUnsupportedNotifs: hideUnsupportedNotifs, + InstanceEmojiFilter: instanceEmojiFilter, AddReactionsFilter: addReactionsFilter, CSS: css, } diff --git a/templates/emoji.tmpl b/templates/emoji.tmpl index a5e953a..dcd0259 100644 --- a/templates/emoji.tmpl +++ b/templates/emoji.tmpl @@ -3,8 +3,9 @@
Emojis
+ {{$emoji_filter := $.Ctx.InstanceEmojiFilter}} {{range .Emojis}} - {{if Allowed_emoji_page .ShortCode "blobfox senko shiro cirno pleroma udongein"}} + {{if Allowed_emoji_page .ShortCode $emoji_filter}}
{{.ShortCode}} diff --git a/templates/settings.tmpl b/templates/settings.tmpl index bb9785e..ebea002 100644 --- a/templates/settings.tmpl +++ b/templates/settings.tmpl @@ -70,6 +70,12 @@
+
+ +
+
+ +