@@ -64,6 +64,10 @@ def replies_uri_for(target, page_params = nil)
6464 account_status_replies_url ( target . account , target , page_params )
6565 end
6666
67+ def followers_uri_for ( target )
68+ target . local? ? account_followers_url ( target ) : target . followers_url . presence
69+ end
70+
6771 # Primary audience of a status
6872 # Public statuses go out to primarily the public collection
6973 # Unlisted and private statuses go out primarily to the followers collection
@@ -80,17 +84,17 @@ def to(status)
8084 account_ids = status . active_mentions . pluck ( :account_id )
8185 to = status . account . followers . where ( id : account_ids ) . each_with_object ( [ ] ) do |account , result |
8286 result << uri_for ( account )
83- result << account_followers_url ( account ) if account . group?
87+ result << followers_uri_for ( account ) if account . group?
8488 end
8589 to . concat ( FollowRequest . where ( target_account_id : status . account_id , account_id : account_ids ) . each_with_object ( [ ] ) do |request , result |
8690 result << uri_for ( request . account )
87- result << account_followers_url ( request . account ) if request . account . group?
88- end )
91+ result << followers_uri_for ( request . account ) if request . account . group?
92+ end ) . compact
8993 else
9094 status . active_mentions . each_with_object ( [ ] ) do |mention , result |
9195 result << uri_for ( mention . account )
92- result << account_followers_url ( mention . account ) if mention . account . group?
93- end
96+ result << followers_uri_for ( mention . account ) if mention . account . group?
97+ end . compact
9498 end
9599 end
96100 end
@@ -118,17 +122,17 @@ def cc(status)
118122 account_ids = status . active_mentions . pluck ( :account_id )
119123 cc . concat ( status . account . followers . where ( id : account_ids ) . each_with_object ( [ ] ) do |account , result |
120124 result << uri_for ( account )
121- result << account_followers_url ( account ) if account . group?
122- end )
125+ result << followers_uri_for ( account ) if account . group?
126+ end . compact )
123127 cc . concat ( FollowRequest . where ( target_account_id : status . account_id , account_id : account_ids ) . each_with_object ( [ ] ) do |request , result |
124128 result << uri_for ( request . account )
125- result << account_followers_url ( request . account ) if request . account . group?
126- end )
129+ result << followers_uri_for ( request . account ) if request . account . group?
130+ end . compact )
127131 else
128132 cc . concat ( status . active_mentions . each_with_object ( [ ] ) do |mention , result |
129133 result << uri_for ( mention . account )
130- result << account_followers_url ( mention . account ) if mention . account . group?
131- end )
134+ result << followers_uri_for ( mention . account ) if mention . account . group?
135+ end . compact )
132136 end
133137 end
134138
0 commit comments