aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-09-07 18:14:30 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-09-07 18:14:30 -0700
commit6d1b64065aa1f44e2b9d864ddba97891ca85d1e5 (patch)
treebfc5961a5391cb8bd43ca7071e45c344f510992c /mod/item.php
parent2f52b6c164a76435a957ad6a0562a55ae0becc2a (diff)
downloadvolse-hubzilla-6d1b64065aa1f44e2b9d864ddba97891ca85d1e5.tar.gz
volse-hubzilla-6d1b64065aa1f44e2b9d864ddba97891ca85d1e5.tar.bz2
volse-hubzilla-6d1b64065aa1f44e2b9d864ddba97891ca85d1e5.zip
consolidate import_items/sync_items
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/mod/item.php b/mod/item.php
index c93560771..a92040627 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -884,14 +884,28 @@ function item_post(&$a) {
// NOTREACHED
}
- if($parent) {
+
+ update_remote_id($channel,$post_id,$webpage,$pagetitle,$namespace,$remote_id,$mid);
+
+ if(($parent) && ($parent != $post_id)) {
// Store the comment signature information in case we need to relay to Diaspora
$ditem = $datarray;
$ditem['author'] = $observer;
store_diaspora_comment_sig($ditem,$channel,$parent_item, $post_id, (($walltowall_comment) ? 1 : 0));
}
-
- update_remote_id($channel,$post_id,$webpage,$pagetitle,$namespace,$remote_id,$mid);
+ else {
+ $r = q("select * from item where id = %d",
+ intval($post_id)
+ );
+ if($r) {
+ xchan_query($r);
+ $sync_item = fetch_post_tags($r);
+ $rid = q("select * from item_id where iid = %d",
+ intval($post_id)
+ );
+ build_sync_packet($uid,array('item' => array(encode_item($sync_item[0],true)),'item_id' => $rid));
+ }
+ }
$datarray['id'] = $post_id;
$datarray['llink'] = $a->get_baseurl() . '/display/' . $channel['channel_address'] . '/' . $post_id;
@@ -903,6 +917,11 @@ function item_post(&$a) {
logger('post_complete');
+
+
+
+
+
// figure out how to return, depending on from whence we came
if($api_source)