about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-18 15:20:39 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-18 15:20:39 +0100
commitaed25932b528f16861c4e016cbeb7a3de6231fe7 (patch)
tree08da19d028a3b238ecd472ff65ab4092a1e4c454 /app/controllers
parent6de079a5af328d26d7cbc8daf3367d16c311fddb (diff)
Add OEmbed iframe HTML, convert emojis on public pages, increase size of attachment thumbnails
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api/oembed_controller.rb4
-rw-r--r--app/controllers/stream_entries_controller.rb9
2 files changed, 11 insertions, 2 deletions
diff --git a/app/controllers/api/oembed_controller.rb b/app/controllers/api/oembed_controller.rb
index 4a591dc22..d30ae8152 100644
--- a/app/controllers/api/oembed_controller.rb
+++ b/app/controllers/api/oembed_controller.rb
@@ -5,8 +5,8 @@ class Api::OembedController < ApiController
 
   def show
     @stream_entry = stream_entry_from_url(params[:url])
-    @width        = [300, params[:maxwidth].to_i].min
-    @height       = [200, params[:maxheight].to_i].min
+    @width        = [300, params[:maxwidth].to_i].max
+    @height       = [200, params[:maxheight].to_i].max
   end
 
   private
diff --git a/app/controllers/stream_entries_controller.rb b/app/controllers/stream_entries_controller.rb
index 98d029030..933bdf737 100644
--- a/app/controllers/stream_entries_controller.rb
+++ b/app/controllers/stream_entries_controller.rb
@@ -25,6 +25,15 @@ class StreamEntriesController < ApplicationController
     end
   end
 
+  def embed
+    response.headers['X-Frame-Options'] = 'ALLOWALL'
+    @type = @stream_entry.activity_type.downcase
+
+    return gone if @stream_entry.activity.nil?
+
+    render layout: 'embedded'
+  end
+
   private
 
   def set_account