discourse-chat-integration/app/controllers/public_controller.rb

17 lines
375 B
Ruby
Raw Normal View History

class DiscourseChat::PublicController < ApplicationController
requires_plugin DiscourseChat::PLUGIN_NAME
def post_transcript
params.require(:secret)
2017-10-03 05:42:07 -04:00
redis_key = "chat_integration:transcript:#{params[:secret]}"
content = $redis.get(redis_key)
if content
2017-08-01 15:53:39 -04:00
render json: { content: content }
2017-10-03 05:42:07 -04:00
else
raise Discourse::NotFound
end
end
2017-08-01 15:53:39 -04:00
end