forked from treehouse/mastodon
Fix activity:interactions counter to count all interactions (#8037)
parent
8f64b17d98
commit
a23ac107e4
|
@ -20,8 +20,6 @@ class PotentialFriendshipTracker
|
||||||
redis.zincrby(key, weight, target_account_id)
|
redis.zincrby(key, weight, target_account_id)
|
||||||
redis.zremrangebyrank(key, 0, -MAX_ITEMS)
|
redis.zremrangebyrank(key, 0, -MAX_ITEMS)
|
||||||
redis.expire(key, EXPIRE_AFTER)
|
redis.expire(key, EXPIRE_AFTER)
|
||||||
|
|
||||||
ActivityTracker.increment('activity:interactions')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove(account_id, target_account_id)
|
def remove(account_id, target_account_id)
|
||||||
|
|
|
@ -37,6 +37,7 @@ class FavouriteService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def bump_potential_friendship(account, status)
|
def bump_potential_friendship(account, status)
|
||||||
|
ActivityTracker.increment('activity:interactions')
|
||||||
return if account.following?(status.account_id)
|
return if account.following?(status.account_id)
|
||||||
PotentialFriendshipTracker.record(account.id, status.account_id, :favourite)
|
PotentialFriendshipTracker.record(account.id, status.account_id, :favourite)
|
||||||
end
|
end
|
||||||
|
|
|
@ -83,7 +83,9 @@ class PostStatusService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def bump_potential_friendship(account, status)
|
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)
|
PotentialFriendshipTracker.record(account.id, status.in_reply_to_account_id, :reply)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -44,6 +44,7 @@ class ReblogService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def bump_potential_friendship(account, reblog)
|
def bump_potential_friendship(account, reblog)
|
||||||
|
ActivityTracker.increment('activity:interactions')
|
||||||
return if account.following?(reblog.reblog.account_id)
|
return if account.following?(reblog.reblog.account_id)
|
||||||
PotentialFriendshipTracker.record(account.id, reblog.reblog.account_id, :reblog)
|
PotentialFriendshipTracker.record(account.id, reblog.reblog.account_id, :reblog)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue