only try to merge mention inboxes when valid
This commit is contained in:
parent
e3a78fbadc
commit
af3e61ca83
1 changed files with 10 additions and 1 deletions
|
@ -140,11 +140,20 @@ class Activity_Dispatcher {
|
||||||
*/
|
*/
|
||||||
private static function send_activity_to_inboxes( $activity, $user_id ) {
|
private static function send_activity_to_inboxes( $activity, $user_id ) {
|
||||||
$follower_inboxes = Followers::get_inboxes( $user_id );
|
$follower_inboxes = Followers::get_inboxes( $user_id );
|
||||||
$mentioned_inboxes = Mention::get_inboxes( $activity->get_cc() );
|
|
||||||
|
$mentioned_inboxes = array();
|
||||||
|
$cc = $activity->get_cc();
|
||||||
|
if ( $cc ) {
|
||||||
|
$mentioned_inboxes = Mention::get_inboxes( $cc );
|
||||||
|
}
|
||||||
|
|
||||||
$inboxes = array_merge( $follower_inboxes, $mentioned_inboxes );
|
$inboxes = array_merge( $follower_inboxes, $mentioned_inboxes );
|
||||||
$inboxes = array_unique( $inboxes );
|
$inboxes = array_unique( $inboxes );
|
||||||
|
|
||||||
|
if ( empty( $inboxes ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$json = $activity->to_json();
|
$json = $activity->to_json();
|
||||||
|
|
||||||
foreach ( $inboxes as $inbox ) {
|
foreach ( $inboxes as $inbox ) {
|
||||||
|
|
Loading…
Reference in a new issue