about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/bangtags.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index c1bb62c3d..497cb6a4d 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -280,6 +280,18 @@ class Bangtags
                 Rails.cache.delete("statuses/#{status.id}")
               end
             end
+          when 'emoji'
+            next if status.conversation_id.nil?
+            roars = Status.where(conversation_id: status.conversation_id, account_id: @account.id)
+            roars.each do |roar|
+              roar.emojis.each do |theirs|
+                ours = CustomEmoji.find_or_initialize_by(shortcode: theirs.shortcode, domain: nil)
+                if ours.id.nil?
+                  ours.image = theirs.image
+                  ours.save
+                end
+              end
+            end
           end
         when 'parent'
           chunk = nil
@@ -287,6 +299,14 @@ class Bangtags
           case cmd[1].downcase
           when 'permalink'
             chunk = TagManager.instance.url_for(@parent_status)
+          when 'emoji'
+            @parent_status.emojis.each do |theirs|
+              ours = CustomEmoji.find_or_initialize_by(shortcode: theirs.shortcode, domain: nil)
+              if ours.id.nil?
+                ours.image = theirs.image
+                ours.save
+              end
+            end
           end
         when 'media'
           chunk = nil