- $plink = '[url=' . App::get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
- $arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink );
-
- $arr['verb'] = $activity;
- $arr['object-type'] = $objtype;
- $arr['object'] = $obj;
- $arr['allow_cid'] = $item['allow_cid'];
- $arr['allow_gid'] = $item['allow_gid'];
- $arr['deny_cid'] = $item['deny_cid'];
- $arr['deny_gid'] = $item['deny_gid'];
- $arr['visible'] = 1;
- $arr['unseen'] = 1;
- $arr['last-child'] = 0;
-
- $post_id = item_store($arr);
-
- if(! $item['visible']) {
- $r = q("UPDATE `item` SET `visible` = 1 WHERE `id` = %d AND `uid` = %d",
+ $plink = '[url=' . App::get_baseurl() . '/display/' . $owner_self_contact['nick'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
+
+ $new_item = array(
+ 'guid' => get_guid(32),
+ 'uri' => item_new_uri($a->get_hostname(), $item['uid']),
+ 'uid' => $item['uid'],
+ 'contact-id' => $item_contact_id,
+ 'type' => 'activity',
+ 'wall' => $item['wall'],
+ 'origin' => 1,
+ 'gravity' => GRAVITY_LIKE,
+ 'parent' => $item['id'],
+ 'parent-uri' => $item['uri'],
+ 'thr-parent' => $item['uri'],
+ 'owner-id' => $item['owner-id'],
+ 'owner-name' => $item['owner-name'],
+ 'owner-link' => $item['owner-link'],
+ 'owner-avatar' => $item['owner-avatar'],
+ 'author-id' => $author_contact['id'],
+ 'author-name' => $author_contact['name'],
+ 'author-link' => $author_contact['url'],
+ 'author-avatar' => $author_contact['thumb'],
+ 'body' => sprintf($bodyverb, $ulink, $alink, $plink),
+ 'verb' => $activity,
+ 'object-type' => $objtype,
+ 'object' => $obj,
+ 'allow_cid' => $item['allow_cid'],
+ 'allow_gid' => $item['allow_gid'],
+ 'deny_cid' => $item['deny_cid'],
+ 'deny_gid' => $item['deny_gid'],
+ 'visible' => 1,
+ 'unseen' => 1,
+ 'last-child' => 0
+ );
+
+ $new_item_id = item_store($new_item);
+
+ // @todo: Explain this block
+ if (! $item['visible']) {
+ q("UPDATE `item` SET `visible` = 1 WHERE `id` = %d AND `uid` = %d",