about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorbeatrix <beatrix.bitrot@gmail.com>2017-07-20 11:24:32 -0400
committerGitHub <noreply@github.com>2017-07-20 11:24:32 -0400
commite7edb4d1eeba6c12a1c71271faa30d2bbf00d054 (patch)
treef373d05c4ea43bd335910f3603fab3d866a2486e /app/controllers
parentd2352246920800e491466d84b0146feb4d1d791f (diff)
parent1fcdaafa6fbe6d746a096c33263d76e6819da46d (diff)
Merge pull request #87 from tootsuite/master
merge upstream
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/accounts_controller.rb2
-rw-r--r--app/controllers/api/base_controller.rb6
-rw-r--r--app/controllers/settings/sessions_controller.rb17
-rw-r--r--app/controllers/stream_entries_controller.rb2
4 files changed, 20 insertions, 7 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb
index 37a1e540f..c270eb000 100644
--- a/app/controllers/accounts_controller.rb
+++ b/app/controllers/accounts_controller.rb
@@ -13,7 +13,7 @@ class AccountsController < ApplicationController
 
       format.atom do
         @entries = @account.stream_entries.where(hidden: false).with_includes.paginate_by_max_id(20, params[:max_id], params[:since_id])
-        render xml: Ostatus::AtomSerializer.render(Ostatus::AtomSerializer.new.feed(@account, @entries.to_a))
+        render xml: OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.feed(@account, @entries.to_a))
       end
 
       format.json do
diff --git a/app/controllers/api/base_controller.rb b/app/controllers/api/base_controller.rb
index c1b2ec3cf..105a2859d 100644
--- a/app/controllers/api/base_controller.rb
+++ b/app/controllers/api/base_controller.rb
@@ -17,11 +17,7 @@ class Api::BaseController < ApplicationController
     render json: { error: 'Record not found' }, status: 404
   end
 
-  rescue_from Goldfinger::Error do
-    render json: { error: 'Remote account could not be resolved' }, status: 422
-  end
-
-  rescue_from HTTP::Error do
+  rescue_from HTTP::Error, Mastodon::UnexpectedResponseError do
     render json: { error: 'Remote data could not be fetched' }, status: 503
   end
 
diff --git a/app/controllers/settings/sessions_controller.rb b/app/controllers/settings/sessions_controller.rb
new file mode 100644
index 000000000..0da1b027b
--- /dev/null
+++ b/app/controllers/settings/sessions_controller.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class Settings::SessionsController < ApplicationController
+  before_action :set_session, only: :destroy
+
+  def destroy
+    @session.destroy!
+    flash[:notice] = I18n.t('sessions.revoke_success')
+    redirect_to edit_user_registration_path
+  end
+
+  private
+
+  def set_session
+    @session = current_user.session_activations.find(params[:id])
+  end
+end
diff --git a/app/controllers/stream_entries_controller.rb b/app/controllers/stream_entries_controller.rb
index e3db77caa..3eb91d830 100644
--- a/app/controllers/stream_entries_controller.rb
+++ b/app/controllers/stream_entries_controller.rb
@@ -19,7 +19,7 @@ class StreamEntriesController < ApplicationController
       end
 
       format.atom do
-        render xml: Ostatus::AtomSerializer.render(Ostatus::AtomSerializer.new.entry(@stream_entry, true))
+        render xml: OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.entry(@stream_entry, true))
       end
     end
   end