diff --git a/app/lib/potential_friendship_tracker.rb b/app/lib/potential_friendship_tracker.rb index dfca54f7bc01269d5c5e9210b9c3835a82d606b7..017a9748d5f979caa16712c3a2fabe4d185be702 100644 --- a/app/lib/potential_friendship_tracker.rb +++ b/app/lib/potential_friendship_tracker.rb @@ -20,8 +20,6 @@ class PotentialFriendshipTracker redis.zincrby(key, weight, target_account_id) redis.zremrangebyrank(key, 0, -MAX_ITEMS) redis.expire(key, EXPIRE_AFTER) - - ActivityTracker.increment('activity:interactions') end def remove(account_id, target_account_id) diff --git a/app/services/favourite_service.rb b/app/services/favourite_service.rb index 6e1ac3ba99b046c97891bac152cd76e8f5fda495..b565bcc3203f30c9f2544c0fccbab496d7fddf7c 100644 --- a/app/services/favourite_service.rb +++ b/app/services/favourite_service.rb @@ -37,6 +37,7 @@ class FavouriteService < BaseService end def bump_potential_friendship(account, status) + ActivityTracker.increment('activity:interactions') return if account.following?(status.account_id) PotentialFriendshipTracker.record(account.id, status.account_id, :favourite) end diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index 4c3485853dd5a57eec218e799e3205b73a583486..300eae547a0eac1b2f768448c6048ec33b855fd1 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -83,7 +83,9 @@ class PostStatusService < BaseService end def bump_potential_friendship(account, status) - return if !status.reply? || account.following?(status.in_reply_to_account_id) + return if !status.reply? || account.id == status.in_reply_to_account_id + ActivityTracker.increment('activity:interactions') + return if account.following?(status.in_reply_to_account_id) PotentialFriendshipTracker.record(account.id, status.in_reply_to_account_id, :reply) end end diff --git a/app/services/reblog_service.rb b/app/services/reblog_service.rb index 0ee8bac2f24c5bc7a6e9620ca5ab5c04833d6500..33ddef8b88d9482d63b0128ea5a9a53b96e13a6b 100644 --- a/app/services/reblog_service.rb +++ b/app/services/reblog_service.rb @@ -44,6 +44,7 @@ class ReblogService < BaseService end def bump_potential_friendship(account, reblog) + ActivityTracker.increment('activity:interactions') return if account.following?(reblog.reblog.account_id) PotentialFriendshipTracker.record(account.id, reblog.reblog.account_id, :reblog) end