about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorHolly 'Frinkel' Lotor <admin@frinkel.tech>2020-01-20 21:14:05 +0000
committerHolly 'Frinkel' Lotor <admin@frinkel.tech>2020-01-20 16:58:12 -0500
commit7dc114f5895905151d7d903b1adb6928da46a45a (patch)
treec2d195213a8514f5c020d9927b3386bb976d4d06 /app
parente37c5a967af4b9c4338df709646375ea427f157e (diff)
More smoke testing, I believe the stability is passable now
Diffstat (limited to 'app')
-rw-r--r--app/controllers/well_known/webfinger_controller.rb11
-rw-r--r--app/serializers/webfinger_serializer.rb2
-rw-r--r--app/services/after_block_domain_from_account_service.rb2
-rw-r--r--app/services/authorize_follow_service.rb2
-rw-r--r--app/services/block_service.rb2
-rw-r--r--app/services/follow_service.rb4
-rw-r--r--app/services/reject_follow_service.rb2
-rw-r--r--app/services/resolve_account_service.rb2
-rw-r--r--app/services/unblock_service.rb2
-rw-r--r--app/services/unfavourite_service.rb2
-rw-r--r--app/services/unfollow_service.rb4
11 files changed, 12 insertions, 23 deletions
diff --git a/app/controllers/well_known/webfinger_controller.rb b/app/controllers/well_known/webfinger_controller.rb
index 53f7f1e27..bf4e5d6b9 100644
--- a/app/controllers/well_known/webfinger_controller.rb
+++ b/app/controllers/well_known/webfinger_controller.rb
@@ -9,17 +9,8 @@ module WellKnown
     def show
       @account = Account.find_local!(username_from_resource)
 
-      respond_to do |format|
-        format.any(:json, :html) do
-          render json: @account, serializer: WebfingerSerializer, content_type: 'application/jrd+json'
-        end
-
-        format.xml do
-          render content_type: 'application/xrd+xml'
-        end
-      end
-
       expires_in 3.days, public: true
+      render json: @account, serializer: WebfingerSErializer, content_type: 'application/jrd+json'
     rescue ActiveRecord::RecordNotFound
       head 404
     end
diff --git a/app/serializers/webfinger_serializer.rb b/app/serializers/webfinger_serializer.rb
index ca4beca37..67c5f1ac2 100644
--- a/app/serializers/webfinger_serializer.rb
+++ b/app/serializers/webfinger_serializer.rb
@@ -26,8 +26,6 @@ class WebfingerSerializer < ActiveModel::Serializer
     else
       [
         { rel: 'http://webfinger.net/rel/profile-page', type: 'text/html', href: short_account_url(object) },
-      # TODO: Make sure commenting the next line doesn't cause other instances to catch on fire
-#        { rel: 'http://schemas.google.com/g/2010#updates-from', type: 'application/atom+xml', href: account_url(object, format: 'atom') },
         { rel: 'self', type: 'application/activity+json', href: account_url(object) },
       ]
     end
diff --git a/app/services/after_block_domain_from_account_service.rb b/app/services/after_block_domain_from_account_service.rb
index a87c2e792..343e7ec11 100644
--- a/app/services/after_block_domain_from_account_service.rb
+++ b/app/services/after_block_domain_from_account_service.rb
@@ -31,7 +31,7 @@ class AfterBlockDomainFromAccountService < BaseService
   def reject_follow!(follow)
     follow.destroy
 
-    return unless follow.account.activitypub?
+#    return unless follow.account.activitypub?
 
     ActivityPub::DeliveryWorker.perform_async(Oj.dump(serialize_payload(follow, ActivityPub::RejectFollowSerializer)), @account.id, follow.account.inbox_url)
   end
diff --git a/app/services/authorize_follow_service.rb b/app/services/authorize_follow_service.rb
index 49bef727e..116532f66 100644
--- a/app/services/authorize_follow_service.rb
+++ b/app/services/authorize_follow_service.rb
@@ -11,7 +11,7 @@ class AuthorizeFollowService < BaseService
       follow_request.authorize!
     end
 
-    create_notification(follow_request) if !source_account.local? && source_account.activitypub?
+    create_notification(follow_request) if !source_account.local?
     follow_request
   end
 
diff --git a/app/services/block_service.rb b/app/services/block_service.rb
index da06361c2..4d756afb8 100644
--- a/app/services/block_service.rb
+++ b/app/services/block_service.rb
@@ -13,7 +13,7 @@ class BlockService < BaseService
     block = account.block!(target_account)
 
     BlockWorker.perform_async(account.id, target_account.id)
-    create_notification(block) if !target_account.local? && target_account.activitypub?
+    create_notification(block) if !target_account.local?
     block
   end
 
diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb
index e3f4bf19d..7b714bfb2 100644
--- a/app/services/follow_service.rb
+++ b/app/services/follow_service.rb
@@ -13,7 +13,7 @@ class FollowService < BaseService
     target_account = ResolveAccountService.new.call(target_account, skip_webfinger: true)
 
     raise ActiveRecord::RecordNotFound if target_account.nil? || target_account.id == source_account.id || target_account.suspended?
-    raise Mastodon::NotPermittedError  if target_account.blocking?(source_account) || source_account.blocking?(target_account) || target_account.moved? || (!target_account.local? && target_account.ostatus?)
+    raise Mastodon::NotPermittedError  if target_account.blocking?(source_account) || source_account.blocking?(target_account) || target_account.moved?
 
     target_account.mark_known! unless !Setting.auto_mark_known || target_account.known?
 
@@ -52,7 +52,7 @@ class FollowService < BaseService
 
     if target_account.local?
       LocalNotificationWorker.perform_async(target_account.id, follow_request.id, follow_request.class.name)
-    elsif target_account.activitypub?
+    else
       ActivityPub::DeliveryWorker.perform_async(build_json(follow_request), source_account.id, target_account.inbox_url)
     end
 
diff --git a/app/services/reject_follow_service.rb b/app/services/reject_follow_service.rb
index bc0000c8c..afdb165e0 100644
--- a/app/services/reject_follow_service.rb
+++ b/app/services/reject_follow_service.rb
@@ -6,7 +6,7 @@ class RejectFollowService < BaseService
   def call(source_account, target_account)
     follow_request = FollowRequest.find_by!(account: source_account, target_account: target_account)
     follow_request.reject!
-    create_notification(follow_request) if !source_account.local? && source_account.activitypub?
+    create_notification(follow_request) if !source_account.local?
     follow_request
   end
 
diff --git a/app/services/resolve_account_service.rb b/app/services/resolve_account_service.rb
index 7c03bfc3e..c0356a4b3 100644
--- a/app/services/resolve_account_service.rb
+++ b/app/services/resolve_account_service.rb
@@ -93,7 +93,7 @@ class ResolveAccountService < BaseService
       if lock.acquired?
         @account = Account.find_remote(@username, @domain)
 
-        next if (@account.present? && !@account.activitypub?) || actor_json.nil?
+        next if @account.present? || actor_json.nil?
 
         @account = ActivityPub::ProcessAccountService.new.call(@username, @domain, actor_json)
       else
diff --git a/app/services/unblock_service.rb b/app/services/unblock_service.rb
index c263ac8af..80eed426a 100644
--- a/app/services/unblock_service.rb
+++ b/app/services/unblock_service.rb
@@ -7,7 +7,7 @@ class UnblockService < BaseService
     return unless account.blocking?(target_account)
 
     unblock = account.unblock!(target_account)
-    create_notification(unblock) if !target_account.local? && target_account.activitypub?
+    create_notification(unblock) if !target_account.local?
     unblock
   end
 
diff --git a/app/services/unfavourite_service.rb b/app/services/unfavourite_service.rb
index 37917a64f..d0298db46 100644
--- a/app/services/unfavourite_service.rb
+++ b/app/services/unfavourite_service.rb
@@ -6,7 +6,7 @@ class UnfavouriteService < BaseService
   def call(account, status)
     favourite = Favourite.find_by!(account: account, status: status)
     favourite.destroy!
-    create_notification(favourite) if !status.account.local? && status.account.activitypub?
+    create_notification(favourite) if !status.account.local?
     favourite
   end
 
diff --git a/app/services/unfollow_service.rb b/app/services/unfollow_service.rb
index b7033d7eb..3f8daffa3 100644
--- a/app/services/unfollow_service.rb
+++ b/app/services/unfollow_service.rb
@@ -21,8 +21,8 @@ class UnfollowService < BaseService
     return unless follow
 
     follow.destroy!
-    create_notification(follow) if !@target_account.local? && @target_account.activitypub?
-    create_reject_notification(follow) if @target_account.local? && !@source_account.local? && @source_account.activitypub?
+    create_notification(follow) if !@target_account.local?
+    create_reject_notification(follow) if @target_account.local? && !@source_account.local?
     UnmergeWorker.perform_async(@target_account.id, @source_account.id)
     follow
   end