+/**
+ * @brief Build the item array for the mirrored post
+ *
+ * @param object $a Application class
+ * @param integer $uid User id
+ * @param object $post Twitter object with the post
+ *
+ * @return array item data to be posted
+ */
+function twitter_do_mirrorpost($a, $uid, $post) {
+ $datarray["type"] = "wall";
+ $datarray["api_source"] = true;
+ $datarray["profile_uid"] = $uid;
+ $datarray["extid"] = NETWORK_TWITTER;
+ $datarray['message_id'] = item_new_uri($a->get_hostname(), $uid, NETWORK_TWITTER.":".$post->id);
+ $datarray['object'] = json_encode($post);
+ $datarray["title"] = "";
+
+ if (is_object($post->retweeted_status)) {
+ // We don't support nested shares, so we mustn't show quotes as shares on retweets
+ $item = twitter_createpost($a, $uid, $post->retweeted_status, array('id' => 0), false, false, true);
+
+ $datarray['body'] = "\n".share_header($item['author-name'], $item['author-link'], $item['author-avatar'], "",
+ $item['created'], $item['plink']);
+
+ $datarray['body'] .= $item['body'].'[/share]';
+ } else {
+ $item = twitter_createpost($a, $uid, $post, array('id' => 0), false, false, false);
+
+ $datarray['body'] = $item['body'];
+ }
+
+ $datarray["source"] = $item['app'];
+ $datarray["verb"] = $item['verb'];
+
+ if (isset($item["location"])) {
+ $datarray["location"] = $item["location"];
+ }
+
+ if (isset($item["coord"])) {
+ $datarray["coord"] = $item["coord"];
+ }
+
+ return $datarray;
+}
+