From c22da3da1c5d3c5418cb9f142883adb838db9f76 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 2 Sep 2015 20:12:40 -0700 Subject: start to modularise the clone import and sync functions --- mod/thing.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'mod/thing.php') diff --git a/mod/thing.php b/mod/thing.php index 86712d9eb..03dc7db5b 100644 --- a/mod/thing.php +++ b/mod/thing.php @@ -109,6 +109,15 @@ function thing_init(&$a) { ); info( t('Thing updated') . EOL); + + $r = q("select * from obj where obj_channel = %d and obj_obj = '%s' limit 1", + intval(local_channel()), + dbesc($term_hash) + ); + if($r) { + build_sync_packet(0, array('obj' => $r)); + } + return; } @@ -157,6 +166,14 @@ function thing_init(&$a) { info( t('Thing added')); + $r = q("select * from obj where obj_channel = %d and obj_obj = '%s' limit 1", + intval(local_channel()), + dbesc($hash) + ); + if($r) { + build_sync_packet(0, array('obj' => $r)); + } + if($activity) { $arr = array(); $links = array(array('rel' => 'alternate','type' => 'text/html', 'href' => $url)); @@ -310,6 +327,10 @@ function thing_content(&$a) { intval(local_channel()) ); + $r[0]['obj_deleted'] = 1; + + build_sync_packet(0,array('obj' => $r)); + return $o; } -- cgit v1.2.3