remote-self: Seting the author name to the owner name

This commit is contained in:
Michael Vogel 2014-09-01 09:59:58 +02:00
parent c81df2c005
commit 522b9edffe

View file

@ -2552,6 +2552,13 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
$datarray['owner-avatar'] = $contact['thumb']; $datarray['owner-avatar'] = $contact['thumb'];
} }
// We've allowed "followers" to reach this point so we can decide if they are
// posting an @-tag delivery, which followers are allowed to do for certain
// page types. Now that we've parsed the post, let's check if it is legit. Otherwise ignore it.
if(($contact['rel'] == CONTACT_IS_FOLLOWER) && (! tgroup_check($importer['uid'],$datarray)))
continue;
// This is my contact on another system, but it's really me. // This is my contact on another system, but it's really me.
// Turn this into a wall post. // Turn this into a wall post.
@ -2570,14 +2577,6 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
} else } else
$notify = false; $notify = false;
// We've allowed "followers" to reach this point so we can decide if they are
// posting an @-tag delivery, which followers are allowed to do for certain
// page types. Now that we've parsed the post, let's check if it is legit. Otherwise ignore it.
if(($contact['rel'] == CONTACT_IS_FOLLOWER) && (! tgroup_check($importer['uid'],$datarray)))
continue;
$r = item_store($datarray, false, $notify); $r = item_store($datarray, false, $notify);
continue; continue;
@ -3646,16 +3645,6 @@ function local_delivery($importer,$data) {
continue; continue;
} }
// This is my contact on another system, but it's really me.
// Turn this into a wall post.
if($importer['remote_self']) {
$datarray['wall'] = 1;
$notify = true;
} else
$notify = false;
$datarray['parent-uri'] = $item_id; $datarray['parent-uri'] = $item_id;
$datarray['uid'] = $importer['importer_uid']; $datarray['uid'] = $importer['importer_uid'];
$datarray['contact-id'] = $importer['id']; $datarray['contact-id'] = $importer['id'];
@ -3675,6 +3664,21 @@ function local_delivery($importer,$data) {
if(($importer['rel'] == CONTACT_IS_FOLLOWER) && (! tgroup_check($importer['importer_uid'],$datarray))) if(($importer['rel'] == CONTACT_IS_FOLLOWER) && (! tgroup_check($importer['importer_uid'],$datarray)))
continue; continue;
// This is my contact on another system, but it's really me.
// Turn this into a wall post.
if($importer['remote_self']) {
$datarray['wall'] = 1;
// Test
$datarray['author-name'] = $datarray['owner-name'];
$datarray['author-link'] = $datarray['owner-link'];
$datarray['author-avatar'] = $datarray['owner-avatar'];
$notify = true;
} else
$notify = false;
$posted_id = item_store($datarray, false, $notify); $posted_id = item_store($datarray, false, $notify);
if(stristr($datarray['verb'],ACTIVITY_POKE)) { if(stristr($datarray['verb'],ACTIVITY_POKE)) {