summary refs log tree commit diff
diff options
context:
space:
mode:
authorStarfall <admin@plural.cafe>2020-05-08 22:36:15 -0500
committerStarfall <admin@plural.cafe>2020-05-08 22:39:43 -0500
commitfaabe3cc4fdb127da6e5e5c97bf0cf570a74593c (patch)
treed49e4e8bf77fe5a3f4208e056d1eec3296f22beb
parent5c73ecd8f61338bc2029ed58061bbf1a1280672b (diff)
Rails snippet: hide mutant standard color variants
Original source
https://monsterware.dev/multiple_creatures/junk-in-the-trunk/commit/07143558bb296e02b9e8aaff6488ad08688f1c26
-rw-r--r--masto-hide-mutstd-variants.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/masto-hide-mutstd-variants.rb b/masto-hide-mutstd-variants.rb
new file mode 100644
index 0000000..a8466e9
--- /dev/null
+++ b/masto-hide-mutstd-variants.rb
@@ -0,0 +1,15 @@
+# MIT License
+# Copyright (c) 2019 multiple creatures collective
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# original source: https://monsterware.dev/multiple_creatures/junk-in-the-trunk/commit/07143558bb296e02b9e8aaff6488ad08688f1c26
+
+CustomEmoji.local.each do |e|
+  # hide the mutstd variants
+  if e.shortcode =~ /^ms_/ and e.shortcode =~ /_\w\w?\d+$/ then
+    e.visible_in_picker = false
+    e.save!
+  end
+end